| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 |
| 2 |
// RUN: %clang_cc1 -triple amdgcn-- -target-cpu gfx1100 %s -emit-llvm -o - | FileCheck %s |
| 3 |
|
| 4 |
#pragma OPENCL EXTENSION cl_khr_fp16 : enable |
| 5 |
|
| 6 |
typedef int int4 __attribute__((ext_vector_type(4))); |
| 7 |
typedef float float4 __attribute__((ext_vector_type(4))); |
| 8 |
typedef _Float16 float16_4 __attribute__((ext_vector_type(4))); |
| 9 |
typedef half half4 __attribute__((ext_vector_type(4))); |
| 10 |
|
| 11 |
// CHECK-LABEL: define dso_local noundef <4 x half> @test_assign_half4_to_float16_4( |
| 12 |
// CHECK-SAME: <4 x half> noundef returned [[F16_4:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 13 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 14 |
// CHECK-NEXT: ret <4 x half> [[F16_4]] |
| 15 |
// |
| 16 |
half4 test_assign_half4_to_float16_4(float16_4 f16_4) { |
| 17 |
return f16_4; |
| 18 |
} |
| 19 |
|
| 20 |
// CHECK-LABEL: define dso_local noundef <4 x half> @test_assign_float16_4_to_half4( |
| 21 |
// CHECK-SAME: <4 x half> noundef returned [[H4:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 22 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 23 |
// CHECK-NEXT: ret <4 x half> [[H4]] |
| 24 |
// |
| 25 |
float16_4 test_assign_float16_4_to_half4(half4 h4) { |
| 26 |
return h4; |
| 27 |
} |
| 28 |
|
| 29 |
// CHECK-LABEL: define dso_local noundef <4 x half> @test_float16_4_to_half4( |
| 30 |
// CHECK-SAME: <4 x half> noundef returned [[F16_4:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 31 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 32 |
// CHECK-NEXT: ret <4 x half> [[F16_4]] |
| 33 |
// |
| 34 |
half4 test_float16_4_to_half4(float16_4 f16_4) { |
| 35 |
return (half4)f16_4; |
| 36 |
} |