Skip to content

Commit 383d93c

Browse files
karolherbstsys-ce-bb
authored andcommitted
Add reverse translation test for integer convert with explicit rounding (#3128)
As discussed in KhronosGroup/SPIRV-LLVM-Translator#3120 (review) Original commit: KhronosGroup/SPIRV-LLVM-Translator@590666a8fd6c9e7
1 parent f50ce99 commit 383d93c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm-spirv/test/transcoding/OpenCL/convert_functions.ll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@ entry:
5353
%x.addr = alloca i32, align 4
5454
store i32 %x, ptr %x.addr, align 4
5555
%0 = load i32, ptr %x.addr, align 4
56+
; We don't get the convert_char_rtei back, but that's fine because they are
57+
; functionally equivalent anyway. The rounding information is lost when
58+
; translating to SPIR-V.
59+
; CHECK-LLVM: call spir_func i8 @_Z12convert_chari(i32 %[[#]])
60+
call spir_func signext i8 @_Z16convert_char_rtei(i32 noundef %0) #1
5661
; CHECK-LLVM: %[[Call:[a-z]+]] = sitofp i32 %[[#]] to float
5762
; CHECK-LLVM: call spir_func void @_Z18convert_float_func(float %[[Call]])
5863
; CHECK-LLVM: call spir_func void @_Z20convert_uint_satfunc(i32 %[[#]])
5964
; CHECK-LLVM: call spir_func void @_Z21convert_float_rtzfunc(float %[[Call]])
60-
call spir_func signext i8 @_Z16convert_char_rtei(i32 noundef %0) #1
6165
%call = call spir_func float @_Z13convert_floati(i32 noundef %0) #1
6266
call spir_func void @_Z18convert_float_func(float noundef %call) #0
6367
call spir_func void @_Z20convert_uint_satfunc(i32 noundef %0) #0

0 commit comments

Comments
 (0)