brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · d2d929b Raw
53 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 6; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 327; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 168 9; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 410; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 411 12; CHECK-LABEL: Begin function degrees_float13define noundef float @degrees_float(float noundef %a) {14entry:15; CHECK: %[[#float_32_arg:]] = OpFunctionParameter %[[#float_32]]16; CHECK: %[[#]] = OpExtInst %[[#float_32]] %[[#op_ext_glsl]] Degrees %[[#float_32_arg]]17  %elt.degrees = call float @llvm.spv.degrees.f32(float %a)18  ret float %elt.degrees19}20 21; CHECK-LABEL: Begin function degrees_half22define noundef half @degrees_half(half noundef %a) {23entry:24; CHECK: %[[#float_16_arg:]] = OpFunctionParameter %[[#float_16]]25; CHECK: %[[#]] = OpExtInst %[[#float_16]] %[[#op_ext_glsl]] Degrees %[[#float_16_arg]]26  %elt.degrees = call half @llvm.spv.degrees.f16(half %a)27  ret half %elt.degrees28}29 30; CHECK-LABEL: Begin function degrees_float_vector31define noundef <4 x float> @degrees_float_vector(<4 x float> noundef %a) {32entry:33; CHECK: %[[#vec4_float_32_arg:]] = OpFunctionParameter %[[#vec4_float_32]]34; CHECK: %[[#]] = OpExtInst %[[#vec4_float_32]] %[[#op_ext_glsl]] Degrees %[[#vec4_float_32_arg]]35  %elt.degrees = call <4 x float> @llvm.spv.degrees.v4f32(<4 x float> %a)36  ret <4 x float> %elt.degrees37}38 39; CHECK-LABEL: Begin function degrees_half_vector40define noundef <4 x half> @degrees_half_vector(<4 x half> noundef %a) {41entry:42; CHECK: %[[#vec4_float_16_arg:]] = OpFunctionParameter %[[#vec4_float_16]]43; CHECK: %[[#]] = OpExtInst %[[#vec4_float_16]] %[[#op_ext_glsl]] Degrees %[[#vec4_float_16_arg]]44  %elt.degrees = call <4 x half> @llvm.spv.degrees.v4f16(<4 x half> %a)45  ret <4 x half> %elt.degrees46}47 48declare half @llvm.spv.degrees.f16(half)49declare float @llvm.spv.degrees.f32(float)50 51declare <4 x float> @llvm.spv.degrees.v4f32(<4 x float>)52declare <4 x half> @llvm.spv.degrees.v4f16(<4 x half>)53