brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 6b7e209 Raw
34 lines · plain
1; RUN: llc -O0 -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}3 4; Make sure SPIRV operation function calls for cross are lowered correctly.5 6; CHECK-DAG: %[[#op_ext_glsl:]] = OpExtInstImport "GLSL.std.450"7; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 328; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 169; CHECK-DAG: %[[#vec3_float_16:]] = OpTypeVector %[[#float_16]] 310; CHECK-DAG: %[[#vec3_float_32:]] = OpTypeVector %[[#float_32]] 311 12define noundef <3 x half> @cross_half4(<3 x half> noundef %a, <3 x half> noundef %b) {13entry:14  ; CHECK: %[[#]] = OpFunction %[[#vec3_float_16]] None %[[#]]15  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec3_float_16]]16  ; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#vec3_float_16]]17  ; CHECK: %[[#]] = OpExtInst %[[#vec3_float_16]] %[[#op_ext_glsl]] Cross %[[#arg0]] %[[#arg1]]18  %hlsl.cross = call <3 x half> @llvm.spv.cross.v3f16(<3 x half> %a, <3 x half> %b)19  ret <3 x half> %hlsl.cross20}21 22define noundef <3 x float> @cross_float4(<3 x float> noundef %a, <3 x float> noundef %b) {23entry:24  ; CHECK: %[[#]] = OpFunction %[[#vec3_float_32]] None %[[#]]25  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec3_float_32]]26  ; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#vec3_float_32]]27  ; CHECK: %[[#]] = OpExtInst %[[#vec3_float_32]] %[[#op_ext_glsl]] Cross %[[#arg0]] %[[#arg1]]28  %hlsl.cross = call <3 x float> @llvm.spv.cross.v3f32(<3 x float> %a, <3 x float> %b)29  ret <3 x float> %hlsl.cross30}31 32declare <3 x half> @llvm.spv.cross.v3f16(<3 x half>, <3 x half>)33declare <3 x float> @llvm.spv.cross.v3f32(<3 x float>, <3 x float>)34