brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · 4a80ef2 Raw
68 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 52 3// RUN: %clang_cc1 -O1 -triple spirv-pc-vulkan-compute %s -emit-llvm -o - | FileCheck %s4 5typedef _Float16 half;6typedef half half2 __attribute__((ext_vector_type(2)));7typedef half half3 __attribute__((ext_vector_type(3)));8typedef half half4 __attribute__((ext_vector_type(4)));9typedef float float2 __attribute__((ext_vector_type(2)));10typedef float float3 __attribute__((ext_vector_type(3)));11typedef float float4 __attribute__((ext_vector_type(4)));12 13// CHECK-LABEL: define spir_func half @test_faceforward_half(14// CHECK-SAME: half noundef [[N:%.*]], half noundef [[I:%.*]], half noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {15// CHECK-NEXT:  [[ENTRY:.*:]]16// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call half @llvm.spv.faceforward.f16(half [[N]], half [[I]], half [[NG]])17// CHECK-NEXT:    ret half [[SPV_FACEFORWARD]]18half test_faceforward_half(half N, half I, half Ng) { return __builtin_spirv_faceforward(N, I, Ng); }19 20// CHECK-LABEL: define spir_func <2 x half> @test_faceforward_half2(21// CHECK-SAME: <2 x half> noundef [[N:%.*]], <2 x half> noundef [[I:%.*]], <2 x half> noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {22// CHECK-NEXT:  [[ENTRY:.*:]]23// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call <2 x half> @llvm.spv.faceforward.v2f16(<2 x half> [[N]], <2 x half> [[I]], <2 x half> [[NG]])24// CHECK-NEXT:    ret <2 x half> [[SPV_FACEFORWARD]]25half2 test_faceforward_half2(half2 N, half2 I, half2 Ng) { return __builtin_spirv_faceforward(N, I, Ng); }26 27// CHECK-LABEL: define spir_func <3 x half> @test_faceforward_half3(28// CHECK-SAME: <3 x half> noundef [[N:%.*]], <3 x half> noundef [[I:%.*]], <3 x half> noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {29// CHECK-NEXT:  [[ENTRY:.*:]]30// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call <3 x half> @llvm.spv.faceforward.v3f16(<3 x half> [[N]], <3 x half> [[I]], <3 x half> [[NG]])31// CHECK-NEXT:    ret <3 x half> [[SPV_FACEFORWARD]]32half3 test_faceforward_half3(half3 N, half3 I, half3 Ng) { return __builtin_spirv_faceforward(N, I, Ng); }33 34// CHECK-LABEL: define spir_func <4 x half> @test_faceforward_half4(35// CHECK-SAME: <4 x half> noundef [[N:%.*]], <4 x half> noundef [[I:%.*]], <4 x half> noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {36// CHECK-NEXT:  [[ENTRY:.*:]]37// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call <4 x half> @llvm.spv.faceforward.v4f16(<4 x half> [[N]], <4 x half> [[I]], <4 x half> [[NG]])38// CHECK-NEXT:    ret <4 x half> [[SPV_FACEFORWARD]]39half4 test_faceforward_half4(half4 N, half4 I, half4 Ng) { return __builtin_spirv_faceforward(N, I, Ng); }40 41// CHECK-LABEL: define spir_func float @test_faceforward_float(42// CHECK-SAME: float noundef [[N:%.*]], float noundef [[I:%.*]], float noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {43// CHECK-NEXT:  [[ENTRY:.*:]]44// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call float @llvm.spv.faceforward.f32(float [[N]], float [[I]], float [[NG]])45// CHECK-NEXT:    ret float [[SPV_FACEFORWARD]]46float test_faceforward_float(float N, float I, float Ng) { return __builtin_spirv_faceforward(N, I, Ng); }47 48// CHECK-LABEL: define spir_func <2 x float> @test_faceforward_float2(49// CHECK-SAME: <2 x float> noundef [[N:%.*]], <2 x float> noundef [[I:%.*]], <2 x float> noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {50// CHECK-NEXT:  [[ENTRY:.*:]]51// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call <2 x float> @llvm.spv.faceforward.v2f32(<2 x float> [[N]], <2 x float> [[I]], <2 x float> [[NG]])52// CHECK-NEXT:    ret <2 x float> [[SPV_FACEFORWARD]]53float2 test_faceforward_float2(float2 N, float2 I, float2 Ng) { return __builtin_spirv_faceforward(N, I, Ng); }54 55// CHECK-LABEL: define spir_func <3 x float> @test_faceforward_float3(56// CHECK-SAME: <3 x float> noundef [[N:%.*]], <3 x float> noundef [[I:%.*]], <3 x float> noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {57// CHECK-NEXT:  [[ENTRY:.*:]]58// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call <3 x float> @llvm.spv.faceforward.v3f32(<3 x float> [[N]], <3 x float> [[I]], <3 x float> [[NG]])59// CHECK-NEXT:    ret <3 x float> [[SPV_FACEFORWARD]]60float3 test_faceforward_float3(float3 N, float3 I, float3 Ng) { return __builtin_spirv_faceforward(N, I, Ng); }61 62// CHECK-LABEL: define spir_func <4 x float> @test_faceforward_float4(63// CHECK-SAME: <4 x float> noundef [[N:%.*]], <4 x float> noundef [[I:%.*]], <4 x float> noundef [[NG:%.*]]) local_unnamed_addr #[[ATTR0]] {64// CHECK-NEXT:  [[ENTRY:.*:]]65// CHECK-NEXT:    [[SPV_FACEFORWARD:%.*]] = tail call <4 x float> @llvm.spv.faceforward.v4f32(<4 x float> [[N]], <4 x float> [[I]], <4 x float> [[NG]])66// CHECK-NEXT:    ret <4 x float> [[SPV_FACEFORWARD]]67float4 test_faceforward_float4(float4 N, float4 I, float4 Ng) { return __builtin_spirv_faceforward(N, I, Ng); }68