intel/compiler: Support fmul_fsign opt for fp64 when int64 isn't supported
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 31 Mar 2023 23:52:50 +0000 (16:52 -0700)
committerMarge Bot <emma+marge@anholt.net>
Wed, 5 Apr 2023 18:48:21 +0000 (18:48 +0000)
commiteef7a117a1a1b045444a520a6dfc2a43069ae1fc
tree84883f278f3a2a19a794fc6708f62c0089ccd157
parent7abd8c499b4388f1e2947d78c59aafa0b52c254a
intel/compiler: Support fmul_fsign opt for fp64 when int64 isn't supported

MTL support fp64, but not int64. The fsign(double(x))*FOO optimization
would try to use a 64-bit int xor operation to conditionally toggle
the sign bit off the result.

Since this only affects high bit of the result, we can do a 32-bit
move of the low dword, and a 32-bit xor on the high dword.

Fixes dEQP-VK.spirv_assembly.instruction.compute.float_controls.fp64.input_args.modf_denorm_flush_to_zero
on MTL.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22259>
src/intel/compiler/brw_fs_nir.cpp