| 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 [[var0:[0-9]+]] 16 |
| 12 |
; CHECK: 3 TypeFloat [[var1:[0-9]+]] 32 |
| 13 |
; CHECK: 3 TypeFloat [[var2:[0-9]+]] 64 |
| 14 |
; CHECK: 4 TypeVector [[var3:[0-9]+]] [[var1]] 4 |
| 15 |
|
| 16 |
; CHECK: Function |
| 17 |
; CHECK: 6 ExtInst [[var0]] {{[0-9]+}} [[extinst_id]] fabs |
| 18 |
; CHECK: FunctionEnd |
| 19 |
|
| 20 |
; Function Attrs: nounwind readnone |
| 21 |
define spir_func half @TestFabs16(half %x) local_unnamed_addr #0 { |
| 22 |
entry: |
| 23 |
%0 = tail call half @llvm.fabs.f16(half %x) |
| 24 |
ret half %0 |
| 25 |
} |
| 26 |
|
| 27 |
; CHECK: Function |
| 28 |
; CHECK: 6 ExtInst [[var1]] {{[0-9]+}} [[extinst_id]] fabs |
| 29 |
; CHECK: FunctionEnd |
| 30 |
|
| 31 |
; Function Attrs: nounwind readnone |
| 32 |
define spir_func float @TestFabs32(float %x) local_unnamed_addr #0 { |
| 33 |
entry: |
| 34 |
%0 = tail call float @llvm.fabs.f32(float %x) |
| 35 |
ret float %0 |
| 36 |
} |
| 37 |
|
| 38 |
; CHECK: Function |
| 39 |
; CHECK: 6 ExtInst [[var2]] {{[0-9]+}} [[extinst_id]] fabs |
| 40 |
; CHECK: FunctionEnd |
| 41 |
|
| 42 |
; Function Attrs: nounwind readnone |
| 43 |
define spir_func double @TestFabs64(double %x) local_unnamed_addr #0 { |
| 44 |
entry: |
| 45 |
%0 = tail call double @llvm.fabs.f64(double %x) |
| 46 |
ret double %0 |
| 47 |
} |
| 48 |
|
| 49 |
; CHECK: Function |
| 50 |
; CHECK: 6 ExtInst [[var3]] {{[0-9]+}} [[extinst_id]] fabs |
| 51 |
; CHECK: FunctionEnd |
| 52 |
|
| 53 |
; Function Attrs: nounwind readnone |
| 54 |
define spir_func <4 x float> @TestFabsVec(<4 x float> %x) local_unnamed_addr #0 { |
| 55 |
entry: |
| 56 |
%0 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %x) |
| 57 |
ret <4 x float> %0 |
| 58 |
} |
| 59 |
|
| 60 |
; Function Attrs: nounwind readnone |
| 61 |
declare half @llvm.fabs.f16(half) #1 |
| 62 |
|
| 63 |
; Function Attrs: nounwind readnone |
| 64 |
declare float @llvm.fabs.f32(float) #1 |
| 65 |
|
| 66 |
; Function Attrs: nounwind readnone |
| 67 |
declare double @llvm.fabs.f64(double) #1 |
| 68 |
|
| 69 |
; Function Attrs: nounwind readnone |
| 70 |
declare <4 x float> @llvm.fabs.v4f32(<4 x float>) #1 |
| 71 |
|
| 72 |
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" } |
| 73 |
attributes #1 = { nounwind readnone speculatable willreturn } |
| 74 |
|
| 75 |
!llvm.module.flags = !{!0} |
| 76 |
!opencl.ocl.version = !{!1} |
| 77 |
!opencl.spir.version = !{!2} |
| 78 |
|
| 79 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 80 |
!1 = !{i32 1, i32 0} |
| 81 |
!2 = !{i32 1, i32 2} |