| 1 |
; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s |
| 2 |
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %} |
| 3 |
|
| 4 |
; CHECK-DAG: %[[#op_ext_glsl:]] = OpExtInstImport "GLSL.std.450" |
| 5 |
; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 32 |
| 6 |
; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 16 |
| 7 |
; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 4 |
| 8 |
; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 4 |
| 9 |
|
| 10 |
define noundef float @acos_float(float noundef %a) { |
| 11 |
entry: |
| 12 |
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]] |
| 13 |
; CHECK: %[[#]] = OpExtInst %[[#float_32]] %[[#op_ext_glsl]] Acos %[[#arg0]] |
| 14 |
%elt.acos = call float @llvm.acos.f32(float %a) |
| 15 |
ret float %elt.acos |
| 16 |
} |
| 17 |
|
| 18 |
define noundef half @acos_half(half noundef %a) { |
| 19 |
entry: |
| 20 |
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]] |
| 21 |
; CHECK: %[[#]] = OpExtInst %[[#float_16]] %[[#op_ext_glsl]] Acos %[[#arg0]] |
| 22 |
%elt.acos = call half @llvm.acos.f16(half %a) |
| 23 |
ret half %elt.acos |
| 24 |
} |
| 25 |
|
| 26 |
define noundef <4 x float> @acos_float4(<4 x float> noundef %a) { |
| 27 |
entry: |
| 28 |
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]] |
| 29 |
; CHECK: %[[#]] = OpExtInst %[[#vec4_float_32]] %[[#op_ext_glsl]] Acos %[[#arg0]] |
| 30 |
%elt.acos = call <4 x float> @llvm.acos.v4f32(<4 x float> %a) |
| 31 |
ret <4 x float> %elt.acos |
| 32 |
} |
| 33 |
|
| 34 |
define noundef <4 x half> @acos_half4(<4 x half> noundef %a) { |
| 35 |
entry: |
| 36 |
; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]] |
| 37 |
; CHECK: %[[#]] = OpExtInst %[[#vec4_float_16]] %[[#op_ext_glsl]] Acos %[[#arg0]] |
| 38 |
%elt.acos = call <4 x half> @llvm.acos.v4f16(<4 x half> %a) |
| 39 |
ret <4 x half> %elt.acos |
| 40 |
} |
| 41 |
|
| 42 |
declare half @llvm.acos.f16(half) |
| 43 |
declare float @llvm.acos.f32(float) |
| 44 |
declare <4 x half> @llvm.acos.v4f16(<4 x half>) |
| 45 |
declare <4 x float> @llvm.acos.v4f32(<4 x float>) |