4
4
//@ compile-flags: -C opt-level=0
5
5
//@ needs-llvm-components: arm
6
6
7
- #![ feature( no_core, lang_items, rustc_attrs, repr_simd) ]
7
+ #![ feature( no_core, lang_items, rustc_attrs, repr_simd, f16 ) ]
8
8
#![ crate_type = "rlib" ]
9
9
#![ no_core]
10
10
#![ allow( asm_sub_register, non_camel_case_types) ]
@@ -38,6 +38,8 @@ pub struct i32x2(i32, i32);
38
38
#[ repr( simd) ]
39
39
pub struct i64x1 ( i64 ) ;
40
40
#[ repr( simd) ]
41
+ pub struct f16x4 ( f16 , f16 , f16 , f16 ) ;
42
+ #[ repr( simd) ]
41
43
pub struct f32x2 ( f32 , f32 ) ;
42
44
#[ repr( simd) ]
43
45
pub struct i8x16 ( i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 , i8 ) ;
@@ -48,11 +50,14 @@ pub struct i32x4(i32, i32, i32, i32);
48
50
#[ repr( simd) ]
49
51
pub struct i64x2 ( i64 , i64 ) ;
50
52
#[ repr( simd) ]
53
+ pub struct f16x8 ( f16 , f16 , f16 , f16 , f16 , f16 , f16 , f16 ) ;
54
+ #[ repr( simd) ]
51
55
pub struct f32x4 ( f32 , f32 , f32 , f32 ) ;
52
56
53
57
impl Copy for i8 { }
54
58
impl Copy for i16 { }
55
59
impl Copy for i32 { }
60
+ impl Copy for f16 { }
56
61
impl Copy for f32 { }
57
62
impl Copy for i64 { }
58
63
impl Copy for f64 { }
@@ -61,11 +66,13 @@ impl Copy for i8x8 {}
61
66
impl Copy for i16x4 { }
62
67
impl Copy for i32x2 { }
63
68
impl Copy for i64x1 { }
69
+ impl Copy for f16x4 { }
64
70
impl Copy for f32x2 { }
65
71
impl Copy for i8x16 { }
66
72
impl Copy for i16x8 { }
67
73
impl Copy for i32x4 { }
68
74
impl Copy for i64x2 { }
75
+ impl Copy for f16x8 { }
69
76
impl Copy for f32x4 { }
70
77
71
78
extern "C" {
@@ -152,6 +159,12 @@ check!(reg_i16 i16 reg "mov");
152
159
// CHECK: @NO_APP
153
160
check ! ( reg_i32 i32 reg "mov" ) ;
154
161
162
+ // CHECK-LABEL: reg_f16:
163
+ // CHECK: @APP
164
+ // CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}}
165
+ // CHECK: @NO_APP
166
+ check ! ( reg_f16 f16 reg "mov" ) ;
167
+
155
168
// CHECK-LABEL: reg_f32:
156
169
// CHECK: @APP
157
170
// CHECK: mov {{[a-z0-9]+}}, {{[a-z0-9]+}}
@@ -170,6 +183,12 @@ check!(reg_ptr ptr reg "mov");
170
183
// CHECK: @NO_APP
171
184
check ! ( sreg_i32 i32 sreg "vmov.f32" ) ;
172
185
186
+ // CHECK-LABEL: sreg_f16:
187
+ // CHECK: @APP
188
+ // CHECK: vmov.f32 s{{[0-9]+}}, s{{[0-9]+}}
189
+ // CHECK: @NO_APP
190
+ check ! ( sreg_f16 f16 sreg "vmov.f32" ) ;
191
+
173
192
// CHECK-LABEL: sreg_f32:
174
193
// CHECK: @APP
175
194
// CHECK: vmov.f32 s{{[0-9]+}}, s{{[0-9]+}}
@@ -188,6 +207,12 @@ check!(sreg_ptr ptr sreg "vmov.f32");
188
207
// CHECK: @NO_APP
189
208
check ! ( sreg_low16_i32 i32 sreg_low16 "vmov.f32" ) ;
190
209
210
+ // CHECK-LABEL: sreg_low16_f16:
211
+ // CHECK: @APP
212
+ // CHECK: vmov.f32 s{{[0-9]+}}, s{{[0-9]+}}
213
+ // CHECK: @NO_APP
214
+ check ! ( sreg_low16_f16 f16 sreg_low16 "vmov.f32" ) ;
215
+
191
216
// CHECK-LABEL: sreg_low16_f32:
192
217
// CHECK: @APP
193
218
// CHECK: vmov.f32 s{{[0-9]+}}, s{{[0-9]+}}
@@ -230,6 +255,12 @@ check!(dreg_i32x2 i32x2 dreg "vmov.f64");
230
255
// CHECK: @NO_APP
231
256
check ! ( dreg_i64x1 i64x1 dreg "vmov.f64" ) ;
232
257
258
+ // CHECK-LABEL: dreg_f16x4:
259
+ // CHECK: @APP
260
+ // CHECK: vmov.f64 d{{[0-9]+}}, d{{[0-9]+}}
261
+ // CHECK: @NO_APP
262
+ check ! ( dreg_f16x4 f16x4 dreg "vmov.f64" ) ;
263
+
233
264
// CHECK-LABEL: dreg_f32x2:
234
265
// CHECK: @APP
235
266
// CHECK: vmov.f64 d{{[0-9]+}}, d{{[0-9]+}}
@@ -272,6 +303,12 @@ check!(dreg_low16_i32x2 i32x2 dreg_low16 "vmov.f64");
272
303
// CHECK: @NO_APP
273
304
check ! ( dreg_low16_i64x1 i64x1 dreg_low16 "vmov.f64" ) ;
274
305
306
+ // CHECK-LABEL: dreg_low16_f16x4:
307
+ // CHECK: @APP
308
+ // CHECK: vmov.f64 d{{[0-9]+}}, d{{[0-9]+}}
309
+ // CHECK: @NO_APP
310
+ check ! ( dreg_low16_f16x4 f16x4 dreg_low16 "vmov.f64" ) ;
311
+
275
312
// CHECK-LABEL: dreg_low16_f32x2:
276
313
// CHECK: @APP
277
314
// CHECK: vmov.f64 d{{[0-9]+}}, d{{[0-9]+}}
@@ -314,6 +351,12 @@ check!(dreg_low8_i32x2 i32x2 dreg_low8 "vmov.f64");
314
351
// CHECK: @NO_APP
315
352
check ! ( dreg_low8_i64x1 i64x1 dreg_low8 "vmov.f64" ) ;
316
353
354
+ // CHECK-LABEL: dreg_low8_f16x4:
355
+ // CHECK: @APP
356
+ // CHECK: vmov.f64 d{{[0-9]+}}, d{{[0-9]+}}
357
+ // CHECK: @NO_APP
358
+ check ! ( dreg_low8_f16x4 f16x4 dreg_low8 "vmov.f64" ) ;
359
+
317
360
// CHECK-LABEL: dreg_low8_f32x2:
318
361
// CHECK: @APP
319
362
// CHECK: vmov.f64 d{{[0-9]+}}, d{{[0-9]+}}
@@ -344,6 +387,12 @@ check!(qreg_i32x4 i32x4 qreg "vmov");
344
387
// CHECK: @NO_APP
345
388
check ! ( qreg_i64x2 i64x2 qreg "vmov" ) ;
346
389
390
+ // CHECK-LABEL: qreg_f16x8:
391
+ // CHECK: @APP
392
+ // CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
393
+ // CHECK: @NO_APP
394
+ check ! ( qreg_f16x8 f16x8 qreg "vmov" ) ;
395
+
347
396
// CHECK-LABEL: qreg_f32x4:
348
397
// CHECK: @APP
349
398
// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
@@ -374,6 +423,12 @@ check!(qreg_low8_i32x4 i32x4 qreg_low8 "vmov");
374
423
// CHECK: @NO_APP
375
424
check ! ( qreg_low8_i64x2 i64x2 qreg_low8 "vmov" ) ;
376
425
426
+ // CHECK-LABEL: qreg_low8_f16x8:
427
+ // CHECK: @APP
428
+ // CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
429
+ // CHECK: @NO_APP
430
+ check ! ( qreg_low8_f16x8 f16x8 qreg_low8 "vmov" ) ;
431
+
377
432
// CHECK-LABEL: qreg_low8_f32x4:
378
433
// CHECK: @APP
379
434
// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
@@ -404,6 +459,12 @@ check!(qreg_low4_i32x4 i32x4 qreg_low4 "vmov");
404
459
// CHECK: @NO_APP
405
460
check ! ( qreg_low4_i64x2 i64x2 qreg_low4 "vmov" ) ;
406
461
462
+ // CHECK-LABEL: qreg_low4_f16x8:
463
+ // CHECK: @APP
464
+ // CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
465
+ // CHECK: @NO_APP
466
+ check ! ( qreg_low4_f16x8 f16x8 qreg_low4 "vmov" ) ;
467
+
407
468
// CHECK-LABEL: qreg_low4_f32x4:
408
469
// CHECK: @APP
409
470
// CHECK: vorr q{{[0-9]+}}, q{{[0-9]+}}, q{{[0-9]+}}
@@ -428,6 +489,12 @@ check_reg!(r0_i16 i16 "r0" "mov");
428
489
// CHECK: @NO_APP
429
490
check_reg ! ( r0_i32 i32 "r0" "mov" ) ;
430
491
492
+ // CHECK-LABEL: r0_f16:
493
+ // CHECK: @APP
494
+ // CHECK: mov r0, r0
495
+ // CHECK: @NO_APP
496
+ check_reg ! ( r0_f16 f16 "r0" "mov" ) ;
497
+
431
498
// CHECK-LABEL: r0_f32:
432
499
// CHECK: @APP
433
500
// CHECK: mov r0, r0
@@ -446,6 +513,12 @@ check_reg!(r0_ptr ptr "r0" "mov");
446
513
// CHECK: @NO_APP
447
514
check_reg ! ( s0_i32 i32 "s0" "vmov.f32" ) ;
448
515
516
+ // CHECK-LABEL: s0_f16:
517
+ // CHECK: @APP
518
+ // CHECK: vmov.f32 s0, s0
519
+ // CHECK: @NO_APP
520
+ check_reg ! ( s0_f16 f16 "s0" "vmov.f32" ) ;
521
+
449
522
// CHECK-LABEL: s0_f32:
450
523
// CHECK: @APP
451
524
// CHECK: vmov.f32 s0, s0
@@ -494,6 +567,12 @@ check_reg!(d0_i32x2 i32x2 "d0" "vmov.f64");
494
567
// CHECK: @NO_APP
495
568
check_reg ! ( d0_i64x1 i64x1 "d0" "vmov.f64" ) ;
496
569
570
+ // CHECK-LABEL: d0_f16x4:
571
+ // CHECK: @APP
572
+ // CHECK: vmov.f64 d0, d0
573
+ // CHECK: @NO_APP
574
+ check_reg ! ( d0_f16x4 f16x4 "d0" "vmov.f64" ) ;
575
+
497
576
// CHECK-LABEL: d0_f32x2:
498
577
// CHECK: @APP
499
578
// CHECK: vmov.f64 d0, d0
@@ -524,6 +603,12 @@ check_reg!(q0_i32x4 i32x4 "q0" "vmov");
524
603
// CHECK: @NO_APP
525
604
check_reg ! ( q0_i64x2 i64x2 "q0" "vmov" ) ;
526
605
606
+ // CHECK-LABEL: q0_f16x8:
607
+ // CHECK: @APP
608
+ // CHECK: vorr q0, q0, q0
609
+ // CHECK: @NO_APP
610
+ check_reg ! ( q0_f16x8 f16x8 "q0" "vmov" ) ;
611
+
527
612
// CHECK-LABEL: q0_f32x4:
528
613
// CHECK: @APP
529
614
// CHECK: vorr q0, q0, q0
0 commit comments