1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
3 ; CHECK: %[[#extinst_id:]] = OpExtInstImport "OpenCL.std"
5 ; CHECK: %[[#var0:]] = OpTypeFloat 16
6 ; CHECK: %[[#var1:]] = OpTypeFloat 32
7 ; CHECK: %[[#var2:]] = OpTypeFloat 64
8 ; CHECK: %[[#var3:]] = OpTypeVector %[[#var1]] 4
11 ; CHECK: %[[#]] = OpExtInst %[[#var0]] %[[#extinst_id]] fabs
12 ; CHECK: OpFunctionEnd
14 define spir_func half @TestFabs16(half %x) local_unnamed_addr {
16 %0 = tail call half @llvm.fabs.f16(half %x)
21 ; CHECK: %[[#]] = OpExtInst %[[#var1]] %[[#extinst_id]] fabs
22 ; CHECK: OpFunctionEnd
24 define spir_func float @TestFabs32(float %x) local_unnamed_addr {
26 %0 = tail call float @llvm.fabs.f32(float %x)
31 ; CHECK: %[[#]] = OpExtInst %[[#var2]] %[[#extinst_id]] fabs
32 ; CHECK: OpFunctionEnd
34 define spir_func double @TestFabs64(double %x) local_unnamed_addr {
36 %0 = tail call double @llvm.fabs.f64(double %x)
41 ; CHECK: %[[#]] = OpExtInst %[[#var3]] %[[#extinst_id]] fabs
42 ; CHECK: OpFunctionEnd
44 define spir_func <4 x float> @TestFabsVec(<4 x float> %x) local_unnamed_addr {
46 %0 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %x)
50 declare half @llvm.fabs.f16(half)
52 declare float @llvm.fabs.f32(float)
54 declare double @llvm.fabs.f64(double)
56 declare <4 x float> @llvm.fabs.v4f32(<4 x float>)