Summary: | nir_op_imod is incorrectly implemented as LLVM's srem | ||
---|---|---|---|
Product: | Mesa | Reporter: | programmerjake |
Component: | Drivers/Vulkan/radeon | Assignee: | mesa-dev |
Status: | RESOLVED NOTABUG | QA Contact: | mesa-dev |
Severity: | normal | ||
Priority: | medium | CC: | programmerjake |
Version: | git | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
programmerjake
2017-08-03 22:08:37 UTC
I went looking to why there were no good CTS tests for this and found this in the vulkan spec: For the OpSRem and OpSMod instructions, if either operand is negative the result is undefined. Note While the OpSRem and OpSMod instructions are supported by the Vulkan environment, they require non-negative values and thus do not enable additional functionality beyond what OpUMod provides. While I'm open to fixing this, you may want to rethink what you are doing. (In reply to Bas Nieuwenhuizen from comment #1) > I went looking to why there were no good CTS tests for this and found this > in the vulkan spec: > > For the OpSRem and OpSMod instructions, if either operand is negative the > result is undefined. I think this bug should be fixed to support OpenCL. I have not found any references in the OpenCL specs to results of the remainder operator, so I'm guessing it uses the definition eventually derived from C99 section 6.5.5.6 which defines the results for negative operands. radv is not a CL driver though, so you can't depend on this working on any unextended vulkan driver. (In reply to Bas Nieuwenhuizen from comment #3) > radv is not a CL driver though, so you can't depend on this working on any > unextended vulkan driver. NIR is not specific to Vulkan though. yes, but GL_ARB_spirv has the same spec language and there currently is no CL driver based on the AMD NIR->LLVM code. So none of the currently supported frontends need it. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.