From 69d21a3dee67fe63346ce92c102a497f81d4e607 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 1 Jul 2022 14:13:25 +0100 Subject: [PATCH] nir: rename fsin_r600/fcos_r600 to fsin_amd/fcos_amd GCN has better range, but constant folding is the same. Signed-off-by: Rhys Perry Reviewed-by: Samuel Pitoiset Part-of: --- src/compiler/nir/nir_opcodes.py | 6 +++--- src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp | 8 ++++---- src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 70d7f1fe3b7..0afb86f0e8f 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -1261,11 +1261,11 @@ unop_horiz("cube_r600", 4, tfloat32, 3, tfloat32, """ } """) -# r600 specific sin and cos +# r600/gcn specific sin and cos # these trigeometric functions need some lowering because the supported # input values are expected to be normalized by dividing by (2 * pi) -unop("fsin_r600", tfloat32, "sinf(6.2831853 * src0)") -unop("fcos_r600", tfloat32, "cosf(6.2831853 * src0)") +unop("fsin_amd", tfloat32, "sinf(6.2831853 * src0)") +unop("fcos_amd", tfloat32, "cosf(6.2831853 * src0)") # AGX specific sin with input expressed in quadrants. Used in the lowering for # fsin/fcos. This corresponds to a sequence of 3 ALU ops in the backend (where diff --git a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp index cd4d949059d..583102d4e2d 100644 --- a/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_instr_alu.cpp @@ -1175,13 +1175,13 @@ bool AluInstr::from_nir(nir_alu_instr *alu, Shader& shader) if (shader.chip_class() == ISA_CC_CAYMAN) { switch (alu->op) { - case nir_op_fcos_r600: return emit_alu_trans_op1_cayman(*alu, op1_cos, shader); + case nir_op_fcos_amd: return emit_alu_trans_op1_cayman(*alu, op1_cos, shader); case nir_op_fexp2: return emit_alu_trans_op1_cayman(*alu, op1_exp_ieee, shader); case nir_op_flog2: return emit_alu_trans_op1_cayman(*alu, op1_log_clamped, shader); case nir_op_frcp: return emit_alu_trans_op1_cayman(*alu, op1_recip_ieee, shader); case nir_op_frsq: return emit_alu_trans_op1_cayman(*alu, op1_recipsqrt_ieee1, shader); case nir_op_fsqrt: return emit_alu_trans_op1_cayman(*alu, op1_sqrt_ieee, shader); - case nir_op_fsin_r600: return emit_alu_trans_op1_cayman(*alu, op1_sin, shader); + case nir_op_fsin_amd: return emit_alu_trans_op1_cayman(*alu, op1_sin, shader); case nir_op_i2f32: return emit_alu_op1(*alu, op1_int_to_flt, shader); case nir_op_u2f32: return emit_alu_op1(*alu, op1_uint_to_flt, shader); case nir_op_imul: return emit_alu_trans_op2_cayman(*alu, op2_mullo_int, shader); @@ -1194,12 +1194,12 @@ bool AluInstr::from_nir(nir_alu_instr *alu, Shader& shader) } } else { switch (alu->op) { - case nir_op_fcos_r600: return emit_alu_trans_op1_eg(*alu, op1_cos, shader); + case nir_op_fcos_amd: return emit_alu_trans_op1_eg(*alu, op1_cos, shader); case nir_op_fexp2: return emit_alu_trans_op1_eg(*alu, op1_exp_ieee, shader); case nir_op_flog2: return emit_alu_trans_op1_eg(*alu, op1_log_clamped, shader); case nir_op_frcp: return emit_alu_trans_op1_eg(*alu, op1_recip_ieee, shader); case nir_op_frsq: return emit_alu_trans_op1_eg(*alu, op1_recipsqrt_ieee1, shader); - case nir_op_fsin_r600: return emit_alu_trans_op1_eg(*alu, op1_sin, shader); + case nir_op_fsin_amd: return emit_alu_trans_op1_eg(*alu, op1_sin, shader); case nir_op_fsqrt: return emit_alu_trans_op1_eg(*alu, op1_sqrt_ieee, shader); case nir_op_i2f32: return emit_alu_trans_op1_eg(*alu, op1_int_to_flt, shader); case nir_op_u2f32: return emit_alu_trans_op1_eg(*alu, op1_uint_to_flt, shader); diff --git a/src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp b/src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp index 561c7468f91..e5311f9a87c 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir_lower_alu.cpp @@ -83,9 +83,9 @@ nir_ssa_def *LowerSinCos::lower(nir_instr *instr) nir_imm_float(b, -0.5)); if (alu->op == nir_op_fsin) - return nir_fsin_r600(b, normalized); + return nir_fsin_amd(b, normalized); else - return nir_fcos_r600(b, normalized); + return nir_fcos_amd(b, normalized); }