Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/llvm-intrinsics/ceil.ll

raw
1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -spirv-text -o - | FileCheck %s
3 ; RUN: llvm-spirv %t.bc -o %t.spv
4 ; RUN: spirv-val %t.spv
5
6 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
7 target triple = "spir64-unknown-unknown"
8
9 ; CHECK: ExtInstImport [[extinst_id:[0-9]+]] "OpenCL.std"
10
11 ; CHECK: 3 TypeFloat [[var1:[0-9]+]] 32
12 ; CHECK: 3 TypeFloat [[var2:[0-9]+]] 64
13 ; CHECK: 4 TypeVector [[var3:[0-9]+]] [[var1]] 4
14
15 ; CHECK: Function
16 ; CHECK: 6 ExtInst [[var1]] {{[0-9]+}} [[extinst_id]] ceil
17 ; CHECK: FunctionEnd
18
19 ; Function Attrs: nounwind readnone
20 define spir_func float @TestCeil32(float %x) local_unnamed_addr #0 {
21 entry:
22 %0 = tail call float @llvm.ceil.f32(float %x)
23 ret float %0
24 }
25
26 ; CHECK: Function
27 ; CHECK: 6 ExtInst [[var2]] {{[0-9]+}} [[extinst_id]] ceil
28 ; CHECK: FunctionEnd
29
30 ; Function Attrs: nounwind readnone
31 define spir_func double @TestCeil64(double %x) local_unnamed_addr #0 {
32 entry:
33 %0 = tail call double @llvm.ceil.f64(double %x)
34 ret double %0
35 }
36
37 ; CHECK: Function
38 ; CHECK: 6 ExtInst [[var3]] {{[0-9]+}} [[extinst_id]] ceil
39 ; CHECK: FunctionEnd
40
41 ; Function Attrs: nounwind readnone
42 define spir_func <4 x float> @TestCeilVec(<4 x float> %x) local_unnamed_addr #0 {
43 entry:
44 %0 = tail call <4 x float> @llvm.ceil.v4f32(<4 x float> %x)
45 ret <4 x float> %0
46 }
47
48 ; Function Attrs: nounwind readnone
49 declare float @llvm.ceil.f32(float) #1
50
51 ; Function Attrs: nounwind readnone
52 declare double @llvm.ceil.f64(double) #1
53
54 ; Function Attrs: nounwind readnone
55 declare <4 x float> @llvm.ceil.v4f32(<4 x float>) #1
56
57 attributes #0 = { nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
58 attributes #1 = { nounwind readnone speculatable willreturn }
59
60 !llvm.module.flags = !{!0}
61 !opencl.ocl.version = !{!1}
62 !opencl.spir.version = !{!2}
63
64 !0 = !{i32 1, !"wchar_size", i32 4}
65 !1 = !{i32 1, i32 0}
66 !2 = !{i32 1, i32 2}