33; SYCL source code for this test:
44; #include "CL/__spirv/spirv_ops.hpp"
55;
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;
711;
812; template <int EA, int MA, int Eout, int Mout>
913; void ap_float_cast() {
1822; ap_int<WA> A;
1923; ap_int<1+Eout+Mout> cast_from_int_res =
2024; __spirv_ArbitraryFloatCastFromIntINTEL<WA, 1+Eout+Mout>(
21- ; A, Mout, Subnorm, RndMode, RndAcc);
25+ ; A, Mout, FromSign, Subnorm, RndMode, RndAcc);
2226; }
2327;
2428; template <int EA, int MA, int Wout>
2529; void ap_float_cast_to_int() {
2630; ap_int<1+EA+MA> A;
2731; ap_int<Wout> cast_to_int_res =
2832; __spirv_ArbitraryFloatCastToIntINTEL<1+EA+MA, Wout>(
29- ; A, MA, Subnorm, RndMode, RndAcc);
33+ ; A, MA, ToSign, Subnorm, RndMode, RndAcc);
3034; }
3135;
3236; Test also that the same arbitrary precision floating point intrinsic with
397401; }
398402
399403; 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
401405
402406; RUN: llvm-as %s -o %t.bc
403407; 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
566570 %4 = bitcast i25* %2 to i8*
567571 call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %4 ) #5
568572 %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
570574; 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)
573577 store i25 %6 , i25* %2 , align 4 , !tbaa !13
574578 %7 = bitcast i25* %2 to i8*
575579 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
587591 %4 = bitcast i30* %2 to i8*
588592 call void @llvm.lifetime.start.p0i8 (i64 4 , i8* %4 ) #5
589593 %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
591595; 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)
594598 store i30 %6 , i30* %2 , align 4 , !tbaa !17
595599 %7 = bitcast i30* %2 to i8*
596600 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
15621566declare dso_local spir_func i40 @_Z31__spirv_ArbitraryFloatCastINTELILi40ELi40EEU7_ExtIntIXT0_EEiU7_ExtIntIXT_EEiiiiii (i40 , i32 , i32 , i32 , i32 , i32 ) #4
15631567
15641568; 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
15661570
15671571; 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
15691573
15701574; Function Attrs: nounwind
15711575declare 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