Debian Codegraph @

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/degrees.ll

raw
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
6 ; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 32
7 ; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 16
8
9 ; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 4
10 ; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 4
11
12 ; CHECK-LABEL: Begin function degrees_float
13 define noundef float @degrees_float(float noundef %a) {
14 entry:
15 ; CHECK: %[[#float_32_arg:]] = OpFunctionParameter %[[#float_32]]
16 ; CHECK: %[[#]] = OpExtInst %[[#float_32]] %[[#op_ext_glsl]] Degrees %[[#float_32_arg]]
17 %elt.degrees = call float @llvm.spv.degrees.f32(float %a)
18 ret float %elt.degrees
19 }
20
21 ; CHECK-LABEL: Begin function degrees_half
22 define noundef half @degrees_half(half noundef %a) {
23 entry:
24 ; CHECK: %[[#float_16_arg:]] = OpFunctionParameter %[[#float_16]]
25 ; CHECK: %[[#]] = OpExtInst %[[#float_16]] %[[#op_ext_glsl]] Degrees %[[#float_16_arg]]
26 %elt.degrees = call half @llvm.spv.degrees.f16(half %a)
27 ret half %elt.degrees
28 }
29
30 ; CHECK-LABEL: Begin function degrees_float_vector
31 define noundef <4 x float> @degrees_float_vector(<4 x float> noundef %a) {
32 entry:
33 ; CHECK: %[[#vec4_float_32_arg:]] = OpFunctionParameter %[[#vec4_float_32]]
34 ; CHECK: %[[#]] = OpExtInst %[[#vec4_float_32]] %[[#op_ext_glsl]] Degrees %[[#vec4_float_32_arg]]
35 %elt.degrees = call <4 x float> @llvm.spv.degrees.v4f32(<4 x float> %a)
36 ret <4 x float> %elt.degrees
37 }
38
39 ; CHECK-LABEL: Begin function degrees_half_vector
40 define noundef <4 x half> @degrees_half_vector(<4 x half> noundef %a) {
41 entry:
42 ; CHECK: %[[#vec4_float_16_arg:]] = OpFunctionParameter %[[#vec4_float_16]]
43 ; CHECK: %[[#]] = OpExtInst %[[#vec4_float_16]] %[[#op_ext_glsl]] Degrees %[[#vec4_float_16_arg]]
44 %elt.degrees = call <4 x half> @llvm.spv.degrees.v4f16(<4 x half> %a)
45 ret <4 x half> %elt.degrees
46 }
47
48 declare half @llvm.spv.degrees.f16(half)
49 declare float @llvm.spv.degrees.f32(float)
50
51 declare <4 x float> @llvm.spv.degrees.v4f32(<4 x float>)
52 declare <4 x half> @llvm.spv.degrees.v4f16(<4 x half>)