[mlir][StandardToSPIRV] Fix conversion for signed remainder
Per the Vulkan's SPIR-V environment spec, "for the OpSRem and OpSMod instructions, if either operand is negative the result is undefined." So we cannot directly use spv.SRem/spv.SMod if either operand can be negative. Emulate it via spv.UMod. Because the emulation uses spv.SNegate, this commit also defines spv.SNegate. Differential Revision: https://reviews.llvm.org/D83679
Loading
Please register or sign in to comment