50 lines · plain
1; RUN: llc -O0 -verify-machineinstrs -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; CHECK-DAG: %[[#op_ext_glsl:]] = OpExtInstImport "GLSL.std.450"5; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 326; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 167; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 48; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 49 10define noundef float @atan2_float(float noundef %a, float noundef %b) {11entry:12; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]]13; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#]]14; CHECK: %[[#]] = OpExtInst %[[#float_32]] %[[#op_ext_glsl]] Atan2 %[[#arg0]] %[[#arg1]]15 %elt.atan2 = call float @llvm.atan2.f32(float %a, float %b)16 ret float %elt.atan217}18 19define noundef half @atan2_half(half noundef %a, half noundef %b) {20entry:21; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]]22; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#]]23; CHECK: %[[#]] = OpExtInst %[[#float_16]] %[[#op_ext_glsl]] Atan2 %[[#arg0]] %[[#arg1]]24 %elt.atan2 = call half @llvm.atan2.f16(half %a, half %b)25 ret half %elt.atan226}27 28define noundef <4 x float> @atan2_float4(<4 x float> noundef %a, <4 x float> noundef %b) {29entry:30 ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]]31 ; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#]]32 ; CHECK: %[[#]] = OpExtInst %[[#vec4_float_32]] %[[#op_ext_glsl]] Atan2 %[[#arg0]] %[[#arg1]]33 %elt.atan2 = call <4 x float> @llvm.atan2.v4f32(<4 x float> %a, <4 x float> %b)34 ret <4 x float> %elt.atan235}36 37define noundef <4 x half> @atan2_half4(<4 x half> noundef %a, <4 x half> noundef %b) {38entry:39 ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#]]40 ; CHECK: %[[#arg1:]] = OpFunctionParameter %[[#]]41 ; CHECK: %[[#]] = OpExtInst %[[#vec4_float_16]] %[[#op_ext_glsl]] Atan2 %[[#arg0]] %[[#arg1]]42 %elt.atan2 = call <4 x half> @llvm.atan2.v4f16(<4 x half> %a, <4 x half> %b)43 ret <4 x half> %elt.atan244}45 46declare half @llvm.atan2.f16(half, half)47declare float @llvm.atan2.f32(float, float)48declare <4 x half> @llvm.atan2.v4f16(<4 x half>, <4 x half>)49declare <4 x float> @llvm.atan2.v4f32(<4 x float>, <4 x float>)50