| 1 |
// RUN: %clang_cc1 -triple amdgcn-- -target-cpu gfx908 -verify -S -o - %s |
| 2 |
// RUN: %clang_cc1 -triple spirv64-amd-amdhsa -verify -S -o - %s |
| 3 |
|
| 4 |
#pragma OPENCL EXTENSION cl_khr_fp64:enable |
| 5 |
|
| 6 |
typedef float v4f __attribute__((ext_vector_type(4))); |
| 7 |
typedef float v16f __attribute__((ext_vector_type(16))); |
| 8 |
typedef float v32f __attribute__((ext_vector_type(32))); |
| 9 |
typedef half v4h __attribute__((ext_vector_type(4))); |
| 10 |
typedef half v16h __attribute__((ext_vector_type(16))); |
| 11 |
typedef half v32h __attribute__((ext_vector_type(32))); |
| 12 |
typedef int v4i __attribute__((ext_vector_type(4))); |
| 13 |
typedef int v16i __attribute__((ext_vector_type(16))); |
| 14 |
typedef int v32i __attribute__((ext_vector_type(32))); |
| 15 |
typedef short v2s __attribute__((ext_vector_type(2))); |
| 16 |
typedef short v4s __attribute__((ext_vector_type(4))); |
| 17 |
typedef short v16s __attribute__((ext_vector_type(16))); |
| 18 |
typedef short v32s __attribute__((ext_vector_type(32))); |
| 19 |
typedef double v4d __attribute__((ext_vector_type(4))); |
| 20 |
|
| 21 |
|
| 22 |
void test_mfma_f32_32x32x1f32(global v32f* out, float a, float b, v32f c, int d) |
| 23 |
{ |
| 24 |
*out = __builtin_amdgcn_mfma_f32_32x32x1f32(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x1f32' must be a constant integer}} |
| 25 |
*out = __builtin_amdgcn_mfma_f32_32x32x1f32(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x1f32' must be a constant integer}} |
| 26 |
*out = __builtin_amdgcn_mfma_f32_32x32x1f32(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x1f32' must be a constant integer}} |
| 27 |
} |
| 28 |
|
| 29 |
void test_mfma_f32_16x16x1f32(global v16f* out, float a, float b, v16f c, int d) |
| 30 |
{ |
| 31 |
*out = __builtin_amdgcn_mfma_f32_16x16x1f32(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x1f32' must be a constant integer}} |
| 32 |
*out = __builtin_amdgcn_mfma_f32_16x16x1f32(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x1f32' must be a constant integer}} |
| 33 |
*out = __builtin_amdgcn_mfma_f32_16x16x1f32(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x1f32' must be a constant integer}} |
| 34 |
} |
| 35 |
|
| 36 |
void test_mfma_f32_4x4x1f32(global v4f* out, float a, float b, v4f c, int d) |
| 37 |
{ |
| 38 |
*out = __builtin_amdgcn_mfma_f32_4x4x1f32(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x1f32' must be a constant integer}} |
| 39 |
*out = __builtin_amdgcn_mfma_f32_4x4x1f32(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x1f32' must be a constant integer}} |
| 40 |
*out = __builtin_amdgcn_mfma_f32_4x4x1f32(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x1f32' must be a constant integer}} |
| 41 |
} |
| 42 |
|
| 43 |
void test_mfma_f32_32x32x2f32(global v16f* out, float a, float b, v16f c, int d) |
| 44 |
{ |
| 45 |
*out = __builtin_amdgcn_mfma_f32_32x32x2f32(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x2f32' must be a constant integer}} |
| 46 |
*out = __builtin_amdgcn_mfma_f32_32x32x2f32(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x2f32' must be a constant integer}} |
| 47 |
*out = __builtin_amdgcn_mfma_f32_32x32x2f32(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x2f32' must be a constant integer}} |
| 48 |
} |
| 49 |
|
| 50 |
void test_mfma_f32_16x16x4f32(global v4f* out, float a, float b, v4f c, int d) |
| 51 |
{ |
| 52 |
*out = __builtin_amdgcn_mfma_f32_16x16x4f32(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x4f32' must be a constant integer}} |
| 53 |
*out = __builtin_amdgcn_mfma_f32_16x16x4f32(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x4f32' must be a constant integer}} |
| 54 |
*out = __builtin_amdgcn_mfma_f32_16x16x4f32(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x4f32' must be a constant integer}} |
| 55 |
} |
| 56 |
|
| 57 |
void test_mfma_f32_32x32x4f16(global v32f* out, v4h a, v4h b, v32f c, int d) |
| 58 |
{ |
| 59 |
*out = __builtin_amdgcn_mfma_f32_32x32x4f16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4f16' must be a constant integer}} |
| 60 |
*out = __builtin_amdgcn_mfma_f32_32x32x4f16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4f16' must be a constant integer}} |
| 61 |
*out = __builtin_amdgcn_mfma_f32_32x32x4f16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4f16' must be a constant integer}} |
| 62 |
} |
| 63 |
|
| 64 |
void test_mfma_f32_16x16x4f16(global v16f* out, v4h a, v4h b, v16f c, int d) |
| 65 |
{ |
| 66 |
*out = __builtin_amdgcn_mfma_f32_16x16x4f16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x4f16' must be a constant integer}} |
| 67 |
*out = __builtin_amdgcn_mfma_f32_16x16x4f16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x4f16' must be a constant integer}} |
| 68 |
*out = __builtin_amdgcn_mfma_f32_16x16x4f16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x4f16' must be a constant integer}} |
| 69 |
} |
| 70 |
|
| 71 |
void test_mfma_f32_4x4x4f16(global v4f* out, v4h a, v4h b, v4f c, int d) |
| 72 |
{ |
| 73 |
*out = __builtin_amdgcn_mfma_f32_4x4x4f16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x4f16' must be a constant integer}} |
| 74 |
*out = __builtin_amdgcn_mfma_f32_4x4x4f16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x4f16' must be a constant integer}} |
| 75 |
*out = __builtin_amdgcn_mfma_f32_4x4x4f16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x4f16' must be a constant integer}} |
| 76 |
} |
| 77 |
|
| 78 |
void test_mfma_f32_32x32x8f16(global v16f* out, v4h a, v4h b, v16f c, int d) |
| 79 |
{ |
| 80 |
*out = __builtin_amdgcn_mfma_f32_32x32x8f16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x8f16' must be a constant integer}} |
| 81 |
*out = __builtin_amdgcn_mfma_f32_32x32x8f16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x8f16' must be a constant integer}} |
| 82 |
*out = __builtin_amdgcn_mfma_f32_32x32x8f16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x8f16' must be a constant integer}} |
| 83 |
} |
| 84 |
|
| 85 |
void test_mfma_f32_16x16x16f16(global v4f* out, v4h a, v4h b, v4f c, int d) |
| 86 |
{ |
| 87 |
*out = __builtin_amdgcn_mfma_f32_16x16x16f16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x16f16' must be a constant integer}} |
| 88 |
*out = __builtin_amdgcn_mfma_f32_16x16x16f16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x16f16' must be a constant integer}} |
| 89 |
*out = __builtin_amdgcn_mfma_f32_16x16x16f16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x16f16' must be a constant integer}} |
| 90 |
} |
| 91 |
|
| 92 |
void test_mfma_i32_32x32x4i8(global v32i* out, int a, int b, v32i c, int d) |
| 93 |
{ |
| 94 |
*out = __builtin_amdgcn_mfma_i32_32x32x4i8(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x4i8' must be a constant integer}} |
| 95 |
*out = __builtin_amdgcn_mfma_i32_32x32x4i8(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x4i8' must be a constant integer}} |
| 96 |
*out = __builtin_amdgcn_mfma_i32_32x32x4i8(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x4i8' must be a constant integer}} |
| 97 |
} |
| 98 |
|
| 99 |
void test_mfma_i32_16x16x4i8(global v16i* out, int a, int b, v16i c, int d) |
| 100 |
{ |
| 101 |
*out = __builtin_amdgcn_mfma_i32_16x16x4i8(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x4i8' must be a constant integer}} |
| 102 |
*out = __builtin_amdgcn_mfma_i32_16x16x4i8(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x4i8' must be a constant integer}} |
| 103 |
*out = __builtin_amdgcn_mfma_i32_16x16x4i8(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x4i8' must be a constant integer}} |
| 104 |
} |
| 105 |
|
| 106 |
void test_mfma_i32_4x4x4i8(global v4i* out, int a, int b, v4i c, int d) |
| 107 |
{ |
| 108 |
*out = __builtin_amdgcn_mfma_i32_4x4x4i8(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_4x4x4i8' must be a constant integer}} |
| 109 |
*out = __builtin_amdgcn_mfma_i32_4x4x4i8(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_4x4x4i8' must be a constant integer}} |
| 110 |
*out = __builtin_amdgcn_mfma_i32_4x4x4i8(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_4x4x4i8' must be a constant integer}} |
| 111 |
} |
| 112 |
|
| 113 |
void test_mfma_i32_32x32x8i8(global v16i* out, int a, int b, v16i c, int d) |
| 114 |
{ |
| 115 |
*out = __builtin_amdgcn_mfma_i32_32x32x8i8(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x8i8' must be a constant integer}} |
| 116 |
*out = __builtin_amdgcn_mfma_i32_32x32x8i8(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x8i8' must be a constant integer}} |
| 117 |
*out = __builtin_amdgcn_mfma_i32_32x32x8i8(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_32x32x8i8' must be a constant integer}} |
| 118 |
} |
| 119 |
|
| 120 |
void test_mfma_i32_16x16x16i8(global v4i* out, int a, int b, v4i c, int d) |
| 121 |
{ |
| 122 |
*out = __builtin_amdgcn_mfma_i32_16x16x16i8(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x16i8' must be a constant integer}} |
| 123 |
*out = __builtin_amdgcn_mfma_i32_16x16x16i8(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x16i8' must be a constant integer}} |
| 124 |
*out = __builtin_amdgcn_mfma_i32_16x16x16i8(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_i32_16x16x16i8' must be a constant integer}} |
| 125 |
} |
| 126 |
|
| 127 |
void test_mfma_f32_32x32x2bf16(global v32f* out, v2s a, v2s b, v32f c, int d) |
| 128 |
{ |
| 129 |
*out = __builtin_amdgcn_mfma_f32_32x32x2bf16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x2bf16' must be a constant integer}} |
| 130 |
*out = __builtin_amdgcn_mfma_f32_32x32x2bf16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x2bf16' must be a constant integer}} |
| 131 |
*out = __builtin_amdgcn_mfma_f32_32x32x2bf16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x2bf16' must be a constant integer}} |
| 132 |
} |
| 133 |
|
| 134 |
void test_mfma_f32_16x16x2bf16(global v16f* out, v2s a, v2s b, v16f c, int d) |
| 135 |
{ |
| 136 |
*out = __builtin_amdgcn_mfma_f32_16x16x2bf16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x2bf16' must be a constant integer}} |
| 137 |
*out = __builtin_amdgcn_mfma_f32_16x16x2bf16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x2bf16' must be a constant integer}} |
| 138 |
*out = __builtin_amdgcn_mfma_f32_16x16x2bf16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x2bf16' must be a constant integer}} |
| 139 |
} |
| 140 |
|
| 141 |
void test_mfma_f32_4x4x2bf16(global v4f* out, v2s a, v2s b, v4f c, int d) |
| 142 |
{ |
| 143 |
*out = __builtin_amdgcn_mfma_f32_4x4x2bf16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x2bf16' must be a constant integer}} |
| 144 |
*out = __builtin_amdgcn_mfma_f32_4x4x2bf16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x2bf16' must be a constant integer}} |
| 145 |
*out = __builtin_amdgcn_mfma_f32_4x4x2bf16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_4x4x2bf16' must be a constant integer}} |
| 146 |
} |
| 147 |
|
| 148 |
void test_mfma_f32_32x32x4bf16(global v16f* out, v2s a, v2s b, v16f c, int d) |
| 149 |
{ |
| 150 |
*out = __builtin_amdgcn_mfma_f32_32x32x4bf16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4bf16' must be a constant integer}} |
| 151 |
*out = __builtin_amdgcn_mfma_f32_32x32x4bf16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4bf16' must be a constant integer}} |
| 152 |
*out = __builtin_amdgcn_mfma_f32_32x32x4bf16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_32x32x4bf16' must be a constant integer}} |
| 153 |
} |
| 154 |
|
| 155 |
void test_mfma_f32_16x16x8bf16(global v4f* out, v2s a, v2s b, v4f c, int d) |
| 156 |
{ |
| 157 |
*out = __builtin_amdgcn_mfma_f32_16x16x8bf16(a, b, c, d, 0, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x8bf16' must be a constant integer}} |
| 158 |
*out = __builtin_amdgcn_mfma_f32_16x16x8bf16(a, b, c, 0, d, 0); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x8bf16' must be a constant integer}} |
| 159 |
*out = __builtin_amdgcn_mfma_f32_16x16x8bf16(a, b, c, 0, 0, d); // expected-error{{argument to '__builtin_amdgcn_mfma_f32_16x16x8bf16' must be a constant integer}} |
| 160 |
} |