diff options
Diffstat (limited to 'src/compiler/nir/nir_builder.h')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 68cf886fa1c..e14151ab7b5 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -492,26 +492,10 @@ nir_vec(nir_builder *build, nir_ssa_def **comp, unsigned num_components) return nir_build_alu_src_arr(build, nir_op_vec(num_components), comp); } -/** - * Similar to nir_fmov, but takes a nir_alu_src instead of a nir_ssa_def. - */ -static inline nir_ssa_def * -nir_fmov_alu(nir_builder *build, nir_alu_src src, unsigned num_components) -{ - nir_alu_instr *mov = nir_alu_instr_create(build->shader, nir_op_fmov); - nir_ssa_dest_init(&mov->instr, &mov->dest.dest, num_components, - nir_src_bit_size(src.src), NULL); - mov->exact = build->exact; - mov->dest.write_mask = (1 << num_components) - 1; - mov->src[0] = src; - nir_builder_instr_insert(build, &mov->instr); - - return &mov->dest.dest.ssa; -} - static inline nir_ssa_def * -nir_imov_alu(nir_builder *build, nir_alu_src src, unsigned num_components) +nir_mov_alu(nir_builder *build, nir_alu_src src, unsigned num_components) { + assert(!src.abs && !src.negate); nir_alu_instr *mov = nir_alu_instr_create(build->shader, nir_op_imov); nir_ssa_dest_init(&mov->instr, &mov->dest.dest, num_components, nir_src_bit_size(src.src), NULL); @@ -544,7 +528,7 @@ nir_swizzle(nir_builder *build, nir_ssa_def *src, const unsigned *swiz, if (num_components == src->num_components && is_identity_swizzle) return src; - return nir_imov_alu(build, alu_src, num_components); + return nir_mov_alu(build, alu_src, num_components); } /* Selects the right fdot given the number of components in each source. */ @@ -838,7 +822,7 @@ nir_ssa_for_src(nir_builder *build, nir_src src, int num_components) for (int j = 0; j < 4; j++) alu.swizzle[j] = j; - return nir_imov_alu(build, alu, num_components); + return nir_mov_alu(build, alu, num_components); } /** @@ -859,7 +843,7 @@ nir_ssa_for_alu_src(nir_builder *build, nir_alu_instr *instr, unsigned srcn) (memcmp(src->swizzle, trivial_swizzle, num_components) == 0)) return src->src.ssa; - return nir_imov_alu(build, *src, num_components); + return nir_mov_alu(build, *src, num_components); } static inline unsigned |