From 4507d8a57af7df679fc0e7b56f4441519ff7e3d4 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 13 Jan 2016 15:09:45 -0800 Subject: [PATCH] nir/spirv/alu: Properly implement mod/rem --- src/glsl/nir/spirv/vtn_alu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"); } -- 2.30.2