1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +sse2 < %s | FileCheck %s --check-prefixes=CHECK
struct bfloat1 {
__bf16 a;
};
struct bfloat1 h1(__bf16 a) {
// CHECK: define{{.*}}bfloat @
struct bfloat1 x;
x.a = a;
return x;
}
struct bfloat2 {
__bf16 a;
__bf16 b;
};
struct bfloat2 h2(__bf16 a, __bf16 b) {
// CHECK: define{{.*}}<2 x bfloat> @
struct bfloat2 x;
x.a = a;
x.b = b;
return x;
}
struct bfloat3 {
__bf16 a;
__bf16 b;
__bf16 c;
};
struct bfloat3 h3(__bf16 a, __bf16 b, __bf16 c) {
// CHECK: define{{.*}}<4 x bfloat> @
struct bfloat3 x;
x.a = a;
x.b = b;
x.c = c;
return x;
}
struct bfloat4 {
__bf16 a;
__bf16 b;
__bf16 c;
__bf16 d;
};
struct bfloat4 h4(__bf16 a, __bf16 b, __bf16 c, __bf16 d) {
// CHECK: define{{.*}}<4 x bfloat> @
struct bfloat4 x;
x.a = a;
x.b = b;
x.c = c;
x.d = d;
return x;
}
struct floatbfloat {
float a;
__bf16 b;
};
struct floatbfloat fh(float a, __bf16 b) {
// CHECK: define{{.*}}<4 x half> @
struct floatbfloat x;
x.a = a;
x.b = b;
return x;
}
struct floatbfloat2 {
float a;
__bf16 b;
__bf16 c;
};
struct floatbfloat2 fh2(float a, __bf16 b, __bf16 c) {
// CHECK: define{{.*}}<4 x half> @
struct floatbfloat2 x;
x.a = a;
x.b = b;
x.c = c;
return x;
}
struct bfloatfloat {
__bf16 a;
float b;
};
struct bfloatfloat hf(__bf16 a, float b) {
// CHECK: define{{.*}}<4 x half> @
struct bfloatfloat x;
x.a = a;
x.b = b;
return x;
}
struct bfloat2float {
__bf16 a;
__bf16 b;
float c;
};
struct bfloat2float h2f(__bf16 a, __bf16 b, float c) {
// CHECK: define{{.*}}<4 x bfloat> @
struct bfloat2float x;
x.a = a;
x.b = b;
x.c = c;
return x;
}
struct floatbfloat3 {
float a;
__bf16 b;
__bf16 c;
__bf16 d;
};
struct floatbfloat3 fh3(float a, __bf16 b, __bf16 c, __bf16 d) {
// CHECK: define{{.*}}{ <4 x half>, bfloat } @
struct floatbfloat3 x;
x.a = a;
x.b = b;
x.c = c;
x.d = d;
return x;
}
struct bfloat5 {
__bf16 a;
__bf16 b;
__bf16 c;
__bf16 d;
__bf16 e;
};
struct bfloat5 h5(__bf16 a, __bf16 b, __bf16 c, __bf16 d, __bf16 e) {
// CHECK: define{{.*}}{ <4 x bfloat>, bfloat } @
struct bfloat5 x;
x.a = a;
x.b = b;
x.c = c;
x.d = d;
x.e = e;
return x;
}
|