| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4 |
| 2 |
// REQUIRES: riscv-registered-target |
| 3 |
// RUN: %clang_cc1 -triple riscv64 -target-feature +v \ |
| 4 |
// RUN: -target-feature +zvfbfmin \ |
| 5 |
// RUN: -target-feature +zvfbfwma -disable-O0-optnone \ |
| 6 |
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \ |
| 7 |
// RUN: FileCheck --check-prefix=CHECK-RV64 %s |
| 8 |
|
| 9 |
#include <riscv_vector.h> |
| 10 |
|
| 11 |
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x bfloat> @test_vreinterpret_v_i16mf4_bf16mf4( |
| 12 |
// CHECK-RV64-SAME: <vscale x 1 x i16> [[SRC:%.*]]) #[[ATTR0:[0-9]+]] { |
| 13 |
// CHECK-RV64-NEXT: entry: |
| 14 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 1 x i16> [[SRC]] to <vscale x 1 x bfloat> |
| 15 |
// CHECK-RV64-NEXT: ret <vscale x 1 x bfloat> [[TMP0]] |
| 16 |
// |
| 17 |
vbfloat16mf4_t test_vreinterpret_v_i16mf4_bf16mf4(vint16mf4_t src) { |
| 18 |
return __riscv_vreinterpret_bf16mf4(src); |
| 19 |
} |
| 20 |
|
| 21 |
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x bfloat> @test_vreinterpret_v_i16mf2_bf16mf2( |
| 22 |
// CHECK-RV64-SAME: <vscale x 2 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 23 |
// CHECK-RV64-NEXT: entry: |
| 24 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 2 x i16> [[SRC]] to <vscale x 2 x bfloat> |
| 25 |
// CHECK-RV64-NEXT: ret <vscale x 2 x bfloat> [[TMP0]] |
| 26 |
// |
| 27 |
vbfloat16mf2_t test_vreinterpret_v_i16mf2_bf16mf2(vint16mf2_t src) { |
| 28 |
return __riscv_vreinterpret_bf16mf2(src); |
| 29 |
} |
| 30 |
|
| 31 |
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x bfloat> @test_vreinterpret_v_i16m1_bf16m1( |
| 32 |
// CHECK-RV64-SAME: <vscale x 4 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 33 |
// CHECK-RV64-NEXT: entry: |
| 34 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 4 x i16> [[SRC]] to <vscale x 4 x bfloat> |
| 35 |
// CHECK-RV64-NEXT: ret <vscale x 4 x bfloat> [[TMP0]] |
| 36 |
// |
| 37 |
vbfloat16m1_t test_vreinterpret_v_i16m1_bf16m1(vint16m1_t src) { |
| 38 |
return __riscv_vreinterpret_bf16m1(src); |
| 39 |
} |
| 40 |
|
| 41 |
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x bfloat> @test_vreinterpret_v_i16m2_bf16m2( |
| 42 |
// CHECK-RV64-SAME: <vscale x 8 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 43 |
// CHECK-RV64-NEXT: entry: |
| 44 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 8 x i16> [[SRC]] to <vscale x 8 x bfloat> |
| 45 |
// CHECK-RV64-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] |
| 46 |
// |
| 47 |
vbfloat16m2_t test_vreinterpret_v_i16m2_bf16m2(vint16m2_t src) { |
| 48 |
return __riscv_vreinterpret_bf16m2(src); |
| 49 |
} |
| 50 |
|
| 51 |
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x bfloat> @test_vreinterpret_v_i16m4_bf16m4( |
| 52 |
// CHECK-RV64-SAME: <vscale x 16 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 53 |
// CHECK-RV64-NEXT: entry: |
| 54 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i16> [[SRC]] to <vscale x 16 x bfloat> |
| 55 |
// CHECK-RV64-NEXT: ret <vscale x 16 x bfloat> [[TMP0]] |
| 56 |
// |
| 57 |
vbfloat16m4_t test_vreinterpret_v_i16m4_bf16m4(vint16m4_t src) { |
| 58 |
return __riscv_vreinterpret_bf16m4(src); |
| 59 |
} |
| 60 |
|
| 61 |
// CHECK-RV64-LABEL: define dso_local <vscale x 32 x bfloat> @test_vreinterpret_v_i16m8_bf16m8( |
| 62 |
// CHECK-RV64-SAME: <vscale x 32 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 63 |
// CHECK-RV64-NEXT: entry: |
| 64 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 32 x i16> [[SRC]] to <vscale x 32 x bfloat> |
| 65 |
// CHECK-RV64-NEXT: ret <vscale x 32 x bfloat> [[TMP0]] |
| 66 |
// |
| 67 |
vbfloat16m8_t test_vreinterpret_v_i16m8_bf16m8(vint16m8_t src) { |
| 68 |
return __riscv_vreinterpret_bf16m8(src); |
| 69 |
} |
| 70 |
|
| 71 |
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x bfloat> @test_vreinterpret_v_u16mf4_bf16mf4( |
| 72 |
// CHECK-RV64-SAME: <vscale x 1 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 73 |
// CHECK-RV64-NEXT: entry: |
| 74 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 1 x i16> [[SRC]] to <vscale x 1 x bfloat> |
| 75 |
// CHECK-RV64-NEXT: ret <vscale x 1 x bfloat> [[TMP0]] |
| 76 |
// |
| 77 |
vbfloat16mf4_t test_vreinterpret_v_u16mf4_bf16mf4(vuint16mf4_t src) { |
| 78 |
return __riscv_vreinterpret_bf16mf4(src); |
| 79 |
} |
| 80 |
|
| 81 |
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x bfloat> @test_vreinterpret_v_u16mf2_bf16mf2( |
| 82 |
// CHECK-RV64-SAME: <vscale x 2 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 83 |
// CHECK-RV64-NEXT: entry: |
| 84 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 2 x i16> [[SRC]] to <vscale x 2 x bfloat> |
| 85 |
// CHECK-RV64-NEXT: ret <vscale x 2 x bfloat> [[TMP0]] |
| 86 |
// |
| 87 |
vbfloat16mf2_t test_vreinterpret_v_u16mf2_bf16mf2(vuint16mf2_t src) { |
| 88 |
return __riscv_vreinterpret_bf16mf2(src); |
| 89 |
} |
| 90 |
|
| 91 |
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x bfloat> @test_vreinterpret_v_u16m1_bf16m1( |
| 92 |
// CHECK-RV64-SAME: <vscale x 4 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 93 |
// CHECK-RV64-NEXT: entry: |
| 94 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 4 x i16> [[SRC]] to <vscale x 4 x bfloat> |
| 95 |
// CHECK-RV64-NEXT: ret <vscale x 4 x bfloat> [[TMP0]] |
| 96 |
// |
| 97 |
vbfloat16m1_t test_vreinterpret_v_u16m1_bf16m1(vuint16m1_t src) { |
| 98 |
return __riscv_vreinterpret_bf16m1(src); |
| 99 |
} |
| 100 |
|
| 101 |
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x bfloat> @test_vreinterpret_v_u16m2_bf16m2( |
| 102 |
// CHECK-RV64-SAME: <vscale x 8 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 103 |
// CHECK-RV64-NEXT: entry: |
| 104 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 8 x i16> [[SRC]] to <vscale x 8 x bfloat> |
| 105 |
// CHECK-RV64-NEXT: ret <vscale x 8 x bfloat> [[TMP0]] |
| 106 |
// |
| 107 |
vbfloat16m2_t test_vreinterpret_v_u16m2_bf16m2(vuint16m2_t src) { |
| 108 |
return __riscv_vreinterpret_bf16m2(src); |
| 109 |
} |
| 110 |
|
| 111 |
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x bfloat> @test_vreinterpret_v_u16m4_bf16m4( |
| 112 |
// CHECK-RV64-SAME: <vscale x 16 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 113 |
// CHECK-RV64-NEXT: entry: |
| 114 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x i16> [[SRC]] to <vscale x 16 x bfloat> |
| 115 |
// CHECK-RV64-NEXT: ret <vscale x 16 x bfloat> [[TMP0]] |
| 116 |
// |
| 117 |
vbfloat16m4_t test_vreinterpret_v_u16m4_bf16m4(vuint16m4_t src) { |
| 118 |
return __riscv_vreinterpret_bf16m4(src); |
| 119 |
} |
| 120 |
|
| 121 |
// CHECK-RV64-LABEL: define dso_local <vscale x 32 x bfloat> @test_vreinterpret_v_u16m8_bf16m8( |
| 122 |
// CHECK-RV64-SAME: <vscale x 32 x i16> [[SRC:%.*]]) #[[ATTR0]] { |
| 123 |
// CHECK-RV64-NEXT: entry: |
| 124 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 32 x i16> [[SRC]] to <vscale x 32 x bfloat> |
| 125 |
// CHECK-RV64-NEXT: ret <vscale x 32 x bfloat> [[TMP0]] |
| 126 |
// |
| 127 |
vbfloat16m8_t test_vreinterpret_v_u16m8_bf16m8(vuint16m8_t src) { |
| 128 |
return __riscv_vreinterpret_bf16m8(src); |
| 129 |
} |
| 130 |
|
| 131 |
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x i16> @test_vreinterpret_v_bf16mf4_i16mf4( |
| 132 |
// CHECK-RV64-SAME: <vscale x 1 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 133 |
// CHECK-RV64-NEXT: entry: |
| 134 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 1 x bfloat> [[SRC]] to <vscale x 1 x i16> |
| 135 |
// CHECK-RV64-NEXT: ret <vscale x 1 x i16> [[TMP0]] |
| 136 |
// |
| 137 |
vint16mf4_t test_vreinterpret_v_bf16mf4_i16mf4(vbfloat16mf4_t src) { |
| 138 |
return __riscv_vreinterpret_i16mf4(src); |
| 139 |
} |
| 140 |
|
| 141 |
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i16> @test_vreinterpret_v_bf16mf2_i16mf2( |
| 142 |
// CHECK-RV64-SAME: <vscale x 2 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 143 |
// CHECK-RV64-NEXT: entry: |
| 144 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 2 x bfloat> [[SRC]] to <vscale x 2 x i16> |
| 145 |
// CHECK-RV64-NEXT: ret <vscale x 2 x i16> [[TMP0]] |
| 146 |
// |
| 147 |
vint16mf2_t test_vreinterpret_v_bf16mf2_i16mf2(vbfloat16mf2_t src) { |
| 148 |
return __riscv_vreinterpret_i16mf2(src); |
| 149 |
} |
| 150 |
|
| 151 |
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i16> @test_vreinterpret_v_bf16m1_i16m1( |
| 152 |
// CHECK-RV64-SAME: <vscale x 4 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 153 |
// CHECK-RV64-NEXT: entry: |
| 154 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 4 x bfloat> [[SRC]] to <vscale x 4 x i16> |
| 155 |
// CHECK-RV64-NEXT: ret <vscale x 4 x i16> [[TMP0]] |
| 156 |
// |
| 157 |
vint16m1_t test_vreinterpret_v_bf16m1_i16m1(vbfloat16m1_t src) { |
| 158 |
return __riscv_vreinterpret_i16m1(src); |
| 159 |
} |
| 160 |
|
| 161 |
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x i16> @test_vreinterpret_v_bf16m2_i16m2( |
| 162 |
// CHECK-RV64-SAME: <vscale x 8 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 163 |
// CHECK-RV64-NEXT: entry: |
| 164 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 8 x bfloat> [[SRC]] to <vscale x 8 x i16> |
| 165 |
// CHECK-RV64-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 166 |
// |
| 167 |
vint16m2_t test_vreinterpret_v_bf16m2_i16m2(vbfloat16m2_t src) { |
| 168 |
return __riscv_vreinterpret_i16m2(src); |
| 169 |
} |
| 170 |
|
| 171 |
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x i16> @test_vreinterpret_v_bf16m4_i16m4( |
| 172 |
// CHECK-RV64-SAME: <vscale x 16 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 173 |
// CHECK-RV64-NEXT: entry: |
| 174 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x bfloat> [[SRC]] to <vscale x 16 x i16> |
| 175 |
// CHECK-RV64-NEXT: ret <vscale x 16 x i16> [[TMP0]] |
| 176 |
// |
| 177 |
vint16m4_t test_vreinterpret_v_bf16m4_i16m4(vbfloat16m4_t src) { |
| 178 |
return __riscv_vreinterpret_i16m4(src); |
| 179 |
} |
| 180 |
|
| 181 |
// CHECK-RV64-LABEL: define dso_local <vscale x 32 x i16> @test_vreinterpret_v_bf16m8_i16m8( |
| 182 |
// CHECK-RV64-SAME: <vscale x 32 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 183 |
// CHECK-RV64-NEXT: entry: |
| 184 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 32 x bfloat> [[SRC]] to <vscale x 32 x i16> |
| 185 |
// CHECK-RV64-NEXT: ret <vscale x 32 x i16> [[TMP0]] |
| 186 |
// |
| 187 |
vint16m8_t test_vreinterpret_v_bf16m8_i16m8(vbfloat16m8_t src) { |
| 188 |
return __riscv_vreinterpret_i16m8(src); |
| 189 |
} |
| 190 |
|
| 191 |
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x i16> @test_vreinterpret_v_bf16mf4_u16mf4( |
| 192 |
// CHECK-RV64-SAME: <vscale x 1 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 193 |
// CHECK-RV64-NEXT: entry: |
| 194 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 1 x bfloat> [[SRC]] to <vscale x 1 x i16> |
| 195 |
// CHECK-RV64-NEXT: ret <vscale x 1 x i16> [[TMP0]] |
| 196 |
// |
| 197 |
vuint16mf4_t test_vreinterpret_v_bf16mf4_u16mf4(vbfloat16mf4_t src) { |
| 198 |
return __riscv_vreinterpret_u16mf4(src); |
| 199 |
} |
| 200 |
|
| 201 |
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i16> @test_vreinterpret_v_bf16mf2_u16mf2( |
| 202 |
// CHECK-RV64-SAME: <vscale x 2 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 203 |
// CHECK-RV64-NEXT: entry: |
| 204 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 2 x bfloat> [[SRC]] to <vscale x 2 x i16> |
| 205 |
// CHECK-RV64-NEXT: ret <vscale x 2 x i16> [[TMP0]] |
| 206 |
// |
| 207 |
vuint16mf2_t test_vreinterpret_v_bf16mf2_u16mf2(vbfloat16mf2_t src) { |
| 208 |
return __riscv_vreinterpret_u16mf2(src); |
| 209 |
} |
| 210 |
|
| 211 |
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i16> @test_vreinterpret_v_bf16m1_u16m1( |
| 212 |
// CHECK-RV64-SAME: <vscale x 4 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 213 |
// CHECK-RV64-NEXT: entry: |
| 214 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 4 x bfloat> [[SRC]] to <vscale x 4 x i16> |
| 215 |
// CHECK-RV64-NEXT: ret <vscale x 4 x i16> [[TMP0]] |
| 216 |
// |
| 217 |
vuint16m1_t test_vreinterpret_v_bf16m1_u16m1(vbfloat16m1_t src) { |
| 218 |
return __riscv_vreinterpret_u16m1(src); |
| 219 |
} |
| 220 |
|
| 221 |
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x i16> @test_vreinterpret_v_bf16m2_u16m2( |
| 222 |
// CHECK-RV64-SAME: <vscale x 8 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 223 |
// CHECK-RV64-NEXT: entry: |
| 224 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 8 x bfloat> [[SRC]] to <vscale x 8 x i16> |
| 225 |
// CHECK-RV64-NEXT: ret <vscale x 8 x i16> [[TMP0]] |
| 226 |
// |
| 227 |
vuint16m2_t test_vreinterpret_v_bf16m2_u16m2(vbfloat16m2_t src) { |
| 228 |
return __riscv_vreinterpret_u16m2(src); |
| 229 |
} |
| 230 |
|
| 231 |
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x i16> @test_vreinterpret_v_bf16m4_u16m4( |
| 232 |
// CHECK-RV64-SAME: <vscale x 16 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 233 |
// CHECK-RV64-NEXT: entry: |
| 234 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 16 x bfloat> [[SRC]] to <vscale x 16 x i16> |
| 235 |
// CHECK-RV64-NEXT: ret <vscale x 16 x i16> [[TMP0]] |
| 236 |
// |
| 237 |
vuint16m4_t test_vreinterpret_v_bf16m4_u16m4(vbfloat16m4_t src) { |
| 238 |
return __riscv_vreinterpret_u16m4(src); |
| 239 |
} |
| 240 |
|
| 241 |
// CHECK-RV64-LABEL: define dso_local <vscale x 32 x i16> @test_vreinterpret_v_bf16m8_u16m8( |
| 242 |
// CHECK-RV64-SAME: <vscale x 32 x bfloat> [[SRC:%.*]]) #[[ATTR0]] { |
| 243 |
// CHECK-RV64-NEXT: entry: |
| 244 |
// CHECK-RV64-NEXT: [[TMP0:%.*]] = bitcast <vscale x 32 x bfloat> [[SRC]] to <vscale x 32 x i16> |
| 245 |
// CHECK-RV64-NEXT: ret <vscale x 32 x i16> [[TMP0]] |
| 246 |
// |
| 247 |
vuint16m8_t test_vreinterpret_v_bf16m8_u16m8(vbfloat16m8_t src) { |
| 248 |
return __riscv_vreinterpret_u16m8(src); |
| 249 |
} |