| 1 |
; ModuleID = '/nfs/site/home/aelizuno/tmp/conversions.bc' |
| 2 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 3 |
target triple = "spir64-unknown-unknown" |
| 4 |
|
| 5 |
; RUN: llvm-as %s -o %t.bc |
| 6 |
; RUN: llvm-spirv %t.bc -o %t.spv |
| 7 |
; RUN: spirv-val %t.spv |
| 8 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc |
| 9 |
; RUN: llvm-dis < %t.bc | FileCheck %s |
| 10 |
|
| 11 |
; Check vector conversions w\o decorations are translated back to calls |
| 12 |
; to OCL built-ins. |
| 13 |
|
| 14 |
; CHECK: call spir_func <8 x i16> @_Z14convert_short8Dv8_c(<8 x i8> |
| 15 |
; CHECK: call spir_func <8 x i32> @_Z12convert_int8Dv8_t(<8 x i16> |
| 16 |
; CHECK: call spir_func <8 x i8> @_Z13convert_char8Dv8_i(<8 x i32> |
| 17 |
; CHECK: call spir_func <8 x double> @_Z15convert_double8Dv8_c(<8 x i8> |
| 18 |
; CHECK: call spir_func <8 x float> @_Z14convert_float8Dv8_d(<8 x double> |
| 19 |
; CHECK: call spir_func <8 x double> @_Z15convert_double8Dv8_f(<8 x float> |
| 20 |
; CHECK: call spir_func <8 x i32> @_Z13convert_uint8Dv8_d(<8 x double> |
| 21 |
; CHECK: call spir_func <8 x float> @_Z14convert_float8Dv8_j(<8 x i32> |
| 22 |
; CHECK: call spir_func <8 x i32> @_Z12convert_int8Dv8_f(<8 x float> |
| 23 |
|
| 24 |
; Function Attrs: nounwind |
| 25 |
define spir_kernel void @test_default_conversions(<8 x double> addrspace(1)* nocapture %out, <8 x i8> %in) #0 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !5 !kernel_arg_type_qual !4 { |
| 26 |
%1 = tail call spir_func <8 x i16> @_Z15convert_ushort8Dv8_c(<8 x i8> %in) #1 |
| 27 |
%2 = tail call spir_func <8 x i32> @_Z12convert_int8Dv8_t(<8 x i16> %1) #1 |
| 28 |
%3 = tail call spir_func <8 x i8> @_Z13convert_char8Dv8_i(<8 x i32> %2) #1 |
| 29 |
%4 = tail call spir_func <8 x double> @_Z15convert_double8Dv8_c(<8 x i8> %3) #1 |
| 30 |
%5 = tail call spir_func <8 x float> @_Z14convert_float8Dv8_d(<8 x double> %4) #1 |
| 31 |
%6 = tail call spir_func <8 x double> @_Z15convert_double8Dv8_f(<8 x float> %5) #1 |
| 32 |
%7 = tail call spir_func <8 x i32> @_Z13convert_uint8Dv8_d(<8 x double> %6) #1 |
| 33 |
%8 = tail call spir_func <8 x float> @_Z14convert_float8Dv8_j(<8 x i32> %7) #1 |
| 34 |
%9 = tail call spir_func <8 x i32> @_Z12convert_int8Dv8_f(<8 x float> %8) #1 |
| 35 |
%10 = tail call spir_func <8 x double> @_Z15convert_double8Dv8_i(<8 x i32> %9) #1 |
| 36 |
store <8 x double> %10, <8 x double> addrspace(1)* %out, align 64, !tbaa !9 |
| 37 |
ret void |
| 38 |
} |
| 39 |
|
| 40 |
; Function Attrs: nounwind readnone |
| 41 |
declare spir_func <8 x i16> @_Z15convert_ushort8Dv8_c(<8 x i8>) #1 |
| 42 |
|
| 43 |
; Function Attrs: nounwind readnone |
| 44 |
declare spir_func <8 x i32> @_Z12convert_int8Dv8_t(<8 x i16>) #1 |
| 45 |
|
| 46 |
; Function Attrs: nounwind readnone |
| 47 |
declare spir_func <8 x i8> @_Z13convert_char8Dv8_i(<8 x i32>) #1 |
| 48 |
|
| 49 |
; Function Attrs: nounwind readnone |
| 50 |
declare spir_func <8 x double> @_Z15convert_double8Dv8_c(<8 x i8>) #1 |
| 51 |
|
| 52 |
; Function Attrs: nounwind readnone |
| 53 |
declare spir_func <8 x float> @_Z14convert_float8Dv8_d(<8 x double>) #1 |
| 54 |
|
| 55 |
; Function Attrs: nounwind readnone |
| 56 |
declare spir_func <8 x double> @_Z15convert_double8Dv8_f(<8 x float>) #1 |
| 57 |
|
| 58 |
; Function Attrs: nounwind readnone |
| 59 |
declare spir_func <8 x i32> @_Z13convert_uint8Dv8_d(<8 x double>) #1 |
| 60 |
|
| 61 |
; Function Attrs: nounwind readnone |
| 62 |
declare spir_func <8 x float> @_Z14convert_float8Dv8_j(<8 x i32>) #1 |
| 63 |
|
| 64 |
; Function Attrs: nounwind readnone |
| 65 |
declare spir_func <8 x i32> @_Z12convert_int8Dv8_f(<8 x float>) #1 |
| 66 |
|
| 67 |
; Function Attrs: nounwind readnone |
| 68 |
declare spir_func <8 x double> @_Z15convert_double8Dv8_i(<8 x i32>) #1 |
| 69 |
|
| 70 |
attributes #0 = { nounwind } |
| 71 |
attributes #1 = { nounwind readnone } |
| 72 |
|
| 73 |
!opencl.enable.FP_CONTRACT = !{} |
| 74 |
!opencl.spir.version = !{!6} |
| 75 |
!opencl.ocl.version = !{!6} |
| 76 |
!opencl.used.extensions = !{!7} |
| 77 |
!opencl.used.optional.core.features = !{!8} |
| 78 |
!opencl.compiler.options = !{!7} |
| 79 |
|
| 80 |
!1 = !{i32 1, i32 0} |
| 81 |
!2 = !{!"none", !"none"} |
| 82 |
!3 = !{!"double8*", !"char8"} |
| 83 |
!4 = !{!"", !""} |
| 84 |
!5 = !{!"double8*", !"char8"} |
| 85 |
!6 = !{i32 1, i32 2} |
| 86 |
!7 = !{} |
| 87 |
!8 = !{!"cl_doubles"} |
| 88 |
!9 = !{!10, !10, i64 0} |
| 89 |
!10 = !{!"omnipotent char", !11} |
| 90 |
!11 = !{!"Simple C/C++ TBAA"} |