From: Jason Ekstrand Date: Wed, 13 Jan 2016 23:09:45 +0000 (-0800) Subject: nir/spirv/alu: Properly implement mod/rem X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4507d8a57af7df679fc0e7b56f4441519ff7e3d4;p=mesa.git nir/spirv/alu: Properly implement mod/rem --- diff --git a/src/glsl/nir/spirv/vtn_alu.c b/src/glsl/nir/spirv/vtn_alu.c index 4c45e234998..d866da7445e 100644 --- a/src/glsl/nir/spirv/vtn_alu.c +++ b/src/glsl/nir/spirv/vtn_alu.c @@ -232,8 +232,10 @@ vtn_nir_alu_op_for_spirv_opcode(SpvOp opcode, bool *swap) case SpvOpSDiv: return nir_op_idiv; case SpvOpFDiv: return nir_op_fdiv; case SpvOpUMod: return nir_op_umod; - case SpvOpSMod: return nir_op_umod; /* FIXME? */ + case SpvOpSMod: return nir_op_imod; case SpvOpFMod: return nir_op_fmod; + case SpvOpSRem: return nir_op_irem; + case SpvOpFRem: return nir_op_frem; case SpvOpShiftRightLogical: return nir_op_ushr; case SpvOpShiftRightArithmetic: return nir_op_ishr; @@ -298,8 +300,6 @@ vtn_nir_alu_op_for_spirv_opcode(SpvOp opcode, bool *swap) case SpvOpDPdxCoarse: return nir_op_fddx_coarse; case SpvOpDPdyCoarse: return nir_op_fddy_coarse; - case SpvOpSRem: - case SpvOpFRem: default: unreachable("No NIR equivalent"); }