vtn/opencl: native rsqrt support
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 29 Apr 2020 16:31:44 +0000 (18:31 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 May 2020 11:31:29 +0000 (11:31 +0000)
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-By: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4811>

src/compiler/spirv/vtn_opencl.c

index 2ea8f714774c07799a0635964e862879f1b174e2..0c524b61605c93c0cbab6bbb624d51380c2996a6 100644 (file)
@@ -90,6 +90,7 @@ nir_alu_op_for_opencl_opcode(struct vtn_builder *b,
    case OpenCLstd_Native_log2: return nir_op_flog2;
    case OpenCLstd_Native_powr: return nir_op_fpow;
    case OpenCLstd_Native_recip: return nir_op_frcp;
+   case OpenCLstd_Native_rsqrt: return nir_op_frsq;
    case OpenCLstd_Native_sin: return nir_op_fsin;
    case OpenCLstd_SMul_hi: return nir_op_imul_high;
    case OpenCLstd_UMul_hi: return nir_op_umul_high;
@@ -363,6 +364,7 @@ vtn_handle_opencl_instruction(struct vtn_builder *b, SpvOp ext_opcode,
    case OpenCLstd_Native_log2:
    case OpenCLstd_Native_powr:
    case OpenCLstd_Native_recip:
+   case OpenCLstd_Native_rsqrt:
    case OpenCLstd_Native_sin:
    case OpenCLstd_Fmod:
    case OpenCLstd_SMul_hi: