3
3
; SYCL source code for this test:
4
4
; #include "CL/__spirv/spirv_ops.hpp"
5
5
;
6
- ; constexpr int32_t Subnorm = 0, RndMode = 2, RndAcc = 1;
6
+ ; constexpr int32_t Subnorm = 0;
7
+ ; constexpr int32_t RndMode = 2;
8
+ ; constexpr int32_t RndAcc = 1;
9
+ ; constexpr bool FromSign = false;
10
+ ; constexpr bool ToSign = true;
7
11
;
8
12
; template <int EA, int MA, int Eout, int Mout>
9
13
; void ap_float_cast() {
18
22
; ap_int<WA> A;
19
23
; ap_int<1+Eout+Mout> cast_from_int_res =
20
24
; __spirv_ArbitraryFloatCastFromIntINTEL<WA, 1+Eout+Mout>(
21
- ; A, Mout, Subnorm, RndMode, RndAcc);
25
+ ; A, Mout, FromSign, Subnorm, RndMode, RndAcc);
22
26
; }
23
27
;
24
28
; template <int EA, int MA, int Wout>
25
29
; void ap_float_cast_to_int() {
26
30
; ap_int<1+EA+MA> A;
27
31
; ap_int<Wout> cast_to_int_res =
28
32
; __spirv_ArbitraryFloatCastToIntINTEL<1+EA+MA, Wout>(
29
- ; A, MA, Subnorm, RndMode, RndAcc);
33
+ ; A, MA, ToSign, Subnorm, RndMode, RndAcc);
30
34
; }
31
35
;
32
36
; Test also that the same arbitrary precision floating point intrinsic with
397
401
; }
398
402
399
403
; LLVM IR compilation command:
400
- ; clang -I llvm/include/sycl -S -emit-llvm -fsycl-device-only capability-arbitrary-precision-floating-point.cpp
404
+ ; clang -I llvm/include/sycl -S -emit-llvm -fno-sycl-early-optimizations - fsycl-device-only capability-arbitrary-precision-floating-point.cpp
401
405
402
406
; RUN: llvm-as %s -o %t.bc
403
407
; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_arbitrary_precision_floating_point -o %t.spv
@@ -566,10 +570,10 @@ define linkonce_odr dso_local spir_func void @_Z22ap_float_cast_from_intILi43ELi
566
570
%4 = bitcast i25* %2 to i8*
567
571
call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %4 ) #5
568
572
%5 = load i43 , i43* %1 , align 8 , !tbaa !11
569
- %6 = call spir_func signext i25 @_Z38__spirv_ArbitraryFloatCastFromIntINTELILi43ELi25EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiiiii (i43 %5 , i32 16 , i32 0 , i32 2 , i32 1 ) #5
573
+ %6 = call spir_func signext i25 @_Z38__spirv_ArbitraryFloatCastFromIntINTELILi43ELi25EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiibiii (i43 %5 , i32 16 , i1 zeroext false , i32 0 , i32 2 , i32 1 ) #5
570
574
; CHECK-SPIRV: 6 Load [[Ty_43]] [[CastFromInt_AId:[0-9]+]]
571
- ; CHECK-SPIRV-NEXT: 8 ArbitraryFloatCastFromIntINTEL [[Ty_25]] [[#]] [[CastFromInt_AId]] 16 0 2 1
572
- ; CHECK-LLVM: call i25 @intel_arbitrary_float_cast_from_int.i25.i43(i43 %[[#]], i32 16, i32 0, i32 2, i32 1)
575
+ ; CHECK-SPIRV-NEXT: 9 ArbitraryFloatCastFromIntINTEL [[Ty_25]] [[#]] [[CastFromInt_AId]] 16 0 0 2 1
576
+ ; CHECK-LLVM: call i25 @intel_arbitrary_float_cast_from_int.i25.i43(i43 %[[#]], i32 16, i1 false, i32 0, i32 2, i32 1)
573
577
store i25 %6 , i25* %2 , align 4 , !tbaa !13
574
578
%7 = bitcast i25* %2 to i8*
575
579
call void @llvm.lifetime.end.p0i8 (i64 4 , i8* %7 ) #5
@@ -587,10 +591,10 @@ define linkonce_odr dso_local spir_func void @_Z20ap_float_cast_to_intILi7ELi15E
587
591
%4 = bitcast i30* %2 to i8*
588
592
call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %4 ) #5
589
593
%5 = load i23 , i23* %1 , align 4 , !tbaa !15
590
- %6 = call spir_func signext i30 @_Z36__spirv_ArbitraryFloatCastToIntINTELILi23ELi30EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiiiii (i23 signext %5 , i32 15 , i32 0 , i32 2 , i32 1 ) #5
594
+ %6 = call spir_func signext i30 @_Z36__spirv_ArbitraryFloatCastToIntINTELILi23ELi30EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiibiii (i23 signext %5 , i32 15 , i1 zeroext true , i32 0 , i32 2 , i32 1 ) #5
591
595
; CHECK-SPIRV: 6 Load [[Ty_23]] [[CastToInt_AId:[0-9]+]]
592
- ; CHECK-SPIRV-NEXT: 8 ArbitraryFloatCastToIntINTEL [[Ty_30]] [[#]] [[CastToInt_AId]] 15 0 2 1
593
- ; CHECK-LLVM: call i30 @intel_arbitrary_float_cast_to_int.i30.i23(i23 %[[#]], i32 15, i32 0, i32 2, i32 1)
596
+ ; CHECK-SPIRV-NEXT: 9 ArbitraryFloatCastToIntINTEL [[Ty_30]] [[#]] [[CastToInt_AId]] 15 1 0 2 1
597
+ ; CHECK-LLVM: call i30 @intel_arbitrary_float_cast_to_int.i30.i23(i23 %[[#]], i32 15, i1 true, i32 0, i32 2, i32 1)
594
598
store i30 %6 , i30* %2 , align 4 , !tbaa !17
595
599
%7 = bitcast i30* %2 to i8*
596
600
call void @llvm.lifetime.end.p0i8 (i64 4 , i8* %7 ) #5
@@ -1562,10 +1566,10 @@ define linkonce_odr dso_local spir_func void @_Z13ap_float_pownILi4ELi7ELi10ELi5
1562
1566
declare dso_local spir_func i40 @_Z31__spirv_ArbitraryFloatCastINTELILi40ELi40EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiiiiii (i40 , i32 , i32 , i32 , i32 , i32 ) #4
1563
1567
1564
1568
; Function Attrs: nounwind
1565
- declare dso_local spir_func signext i25 @_Z38__spirv_ArbitraryFloatCastFromIntINTELILi43ELi25EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiiiii (i43 , i32 , i32 , i32 , i32 ) #4
1569
+ declare dso_local spir_func signext i25 @_Z38__spirv_ArbitraryFloatCastFromIntINTELILi43ELi25EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiibiii (i43 , i32 , i1 zeroext , i32 , i32 , i32 ) #4
1566
1570
1567
1571
; Function Attrs: nounwind
1568
- declare dso_local spir_func signext i30 @_Z36__spirv_ArbitraryFloatCastToIntINTELILi23ELi30EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiiiii (i23 signext , i32 , i32 , i32 , i32 ) #4
1572
+ declare dso_local spir_func signext i30 @_Z36__spirv_ArbitraryFloatCastToIntINTELILi23ELi30EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiibiii (i23 signext , i32 , i1 zeroext , i32 , i32 , i32 ) #4
1569
1573
1570
1574
; Function Attrs: nounwind
1571
1575
declare dso_local spir_func signext i14 @_Z30__spirv_ArbitraryFloatAddINTELILi13ELi15ELi14EEU7_ExtIntIXT1_EEiU7_ExtIntIXT_EEiiU7_ExtIntIXT0_EEiiiiii (i13 signext , i32 , i15 signext , i32 , i32 , i32 , i32 , i32 ) #4
0 commit comments