Debian Codegraph @

llvm/test/CodeGen/SPIRV/llvm-intrinsics/fabs.ll

raw
1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2
3 ; CHECK: %[[#extinst_id:]] = OpExtInstImport "OpenCL.std"
4
5 ; CHECK: %[[#var0:]] = OpTypeFloat 16
6 ; CHECK: %[[#var1:]] = OpTypeFloat 32
7 ; CHECK: %[[#var2:]] = OpTypeFloat 64
8 ; CHECK: %[[#var3:]] = OpTypeVector %[[#var1]] 4
9
10 ; CHECK: OpFunction
11 ; CHECK: %[[#]] = OpExtInst %[[#var0]] %[[#extinst_id]] fabs
12 ; CHECK: OpFunctionEnd
13
14 define spir_func half @TestFabs16(half %x) local_unnamed_addr {
15 entry:
16 %0 = tail call half @llvm.fabs.f16(half %x)
17 ret half %0
18 }
19
20 ; CHECK: OpFunction
21 ; CHECK: %[[#]] = OpExtInst %[[#var1]] %[[#extinst_id]] fabs
22 ; CHECK: OpFunctionEnd
23
24 define spir_func float @TestFabs32(float %x) local_unnamed_addr {
25 entry:
26 %0 = tail call float @llvm.fabs.f32(float %x)
27 ret float %0
28 }
29
30 ; CHECK: OpFunction
31 ; CHECK: %[[#]] = OpExtInst %[[#var2]] %[[#extinst_id]] fabs
32 ; CHECK: OpFunctionEnd
33
34 define spir_func double @TestFabs64(double %x) local_unnamed_addr {
35 entry:
36 %0 = tail call double @llvm.fabs.f64(double %x)
37 ret double %0
38 }
39
40 ; CHECK: OpFunction
41 ; CHECK: %[[#]] = OpExtInst %[[#var3]] %[[#extinst_id]] fabs
42 ; CHECK: OpFunctionEnd
43
44 define spir_func <4 x float> @TestFabsVec(<4 x float> %x) local_unnamed_addr {
45 entry:
46 %0 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %x)
47 ret <4 x float> %0
48 }
49
50 declare half @llvm.fabs.f16(half)
51
52 declare float @llvm.fabs.f32(float)
53
54 declare double @llvm.fabs.f64(double)
55
56 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)