diff --git a/src/intel/compiler/jay/jay_lower_post_ra.c b/src/intel/compiler/jay/jay_lower_post_ra.c index b44c977e6a8..adadf65741e 100644 --- a/src/intel/compiler/jay/jay_lower_post_ra.c +++ b/src/intel/compiler/jay/jay_lower_post_ra.c @@ -107,18 +107,6 @@ lower(jay_builder *b, jay_inst *I) return false; } - case JAY_OPCODE_SWAP: { - jay_def x = I->src[0], y = I->src[1]; - /* TODO: Need stride-aware lowering here too like MOV. Same ideas. */ - if (jay_def_stride(b->shader, x) != jay_def_stride(b->shader, y)) - UNREACHABLE("todo"); - - jay_XOR(b, JAY_TYPE_U32, x, y, x); - jay_XOR(b, JAY_TYPE_U32, y, x, y); - jay_XOR(b, JAY_TYPE_U32, x, y, x); - return true; - } - case JAY_OPCODE_ZERO_FLAG: { jay_MOV(b, jay_bare_reg(FLAG, jay_zero_flag_reg(I)), 0)->type = JAY_TYPE_U32; diff --git a/src/intel/compiler/jay/jay_opcodes.py b/src/intel/compiler/jay/jay_opcodes.py index aaadf74d51e..c27bfe35c4a 100644 --- a/src/intel/compiler/jay/jay_opcodes.py +++ b/src/intel/compiler/jay/jay_opcodes.py @@ -170,9 +170,6 @@ op('expand_quad', 2, 'u32') op('offset_packed_pixel_coords', 1, 'u32') op('extract_layer', 2, 'u32') -# Generated by RA and lowered after. Valid only for GPR/UGPR. -op('swap', 2, 'u32', Props.NO_DEST) - # Phi function representations # # Unlike in NIR, we represent Phi functions as a pair of opcodes, purely diff --git a/src/intel/compiler/jay/jay_register_allocate.c b/src/intel/compiler/jay/jay_register_allocate.c index 24b95702774..a444598181b 100644 --- a/src/intel/compiler/jay/jay_register_allocate.c +++ b/src/intel/compiler/jay/jay_register_allocate.c @@ -569,19 +569,15 @@ jay_emit_parallel_copies(jay_builder *b, assert(dst.file == src.file); enum jay_file file = dst.file; jay_reg tmp = (file == GPR || file == MEM) ? temps.gpr : temps.ugpr; - - if (tmp != NO_REG) { - struct jay_temp_regs t = { .gpr = temps.gpr2, .ugpr = temps.ugpr2 }; - jay_def temp = push_temp(b, tmp, file == MEM /* stride4 */); - { - mov(b, temp, dst, t); - mov(b, dst, src, t); - mov(b, src, temp, t); - } - pop_temp(b, temps, temp); - } else { - jay_SWAP(b, dst, src); + assert(tmp != NO_REG); + struct jay_temp_regs t = { .gpr = temps.gpr2, .ugpr = temps.ugpr2 }; + jay_def temp = push_temp(b, tmp, file == MEM /* stride4 */); + { + mov(b, temp, dst, t); + mov(b, dst, src, t); + mov(b, src, temp, t); } + pop_temp(b, temps, temp); for (unsigned j = 0; j < num_copies; j++) { if (pcopies[j].src == copy->dst) diff --git a/src/intel/compiler/jay/jay_validate.c b/src/intel/compiler/jay/jay_validate.c index 9f5b0e76424..78adb2b232c 100644 --- a/src/intel/compiler/jay/jay_validate.c +++ b/src/intel/compiler/jay/jay_validate.c @@ -248,15 +248,8 @@ validate_inst(struct validate_state *validate, jay_inst *I) CHECK(!I->src[s].negate || jay_has_src_mods(I, s)); } - switch (I->op) { - case JAY_OPCODE_SEL: + if (I->op == JAY_OPCODE_SEL) { CHECK(jay_is_flag(I->src[2]) && "SEL src[2] (selector) must be a flag"); - break; - case JAY_OPCODE_SWAP: - CHECK(I->src[0].file == I->src[1].file && "SWAP files must match"); - break; - default: - break; } } diff --git a/src/intel/compiler/jay/jay_validate_ra.c b/src/intel/compiler/jay/jay_validate_ra.c index 07bec1b4ba0..0a44733cd75 100644 --- a/src/intel/compiler/jay/jay_validate_ra.c +++ b/src/intel/compiler/jay/jay_validate_ra.c @@ -171,12 +171,6 @@ validate_block(jay_function *func, jay_block *block, struct regfile *blocks) jay_foreach_comp(I->dst, c) { *def_reg(rf, I->dst, c) = *def_reg(rf, I->src[0], c); } - } else if (I->op == JAY_OPCODE_SWAP) { - assert(jay_num_values(I->src[0]) == jay_num_values(I->src[1])); - - jay_foreach_comp(I->src[0], c) { - SWAP(*def_reg(rf, I->src[0], c), *def_reg(rf, I->src[1], c)); - } } }