@@ -341,14 +341,27 @@ impl Compiler {
341
341
Compiler :: CraneliftNative => config. legacy_exceptions ( ) ,
342
342
343
343
Compiler :: Winch => {
344
- config. gc ( )
344
+ let unsupported_base = config. gc ( )
345
345
|| config. tail_call ( )
346
346
|| config. function_references ( )
347
347
|| config. gc ( )
348
348
|| config. relaxed_simd ( )
349
349
|| config. gc_types ( )
350
350
|| config. exceptions ( )
351
- || config. legacy_exceptions ( )
351
+ || config. legacy_exceptions ( ) ;
352
+
353
+ if cfg ! ( target_arch = "x86_64" ) {
354
+ return unsupported_base;
355
+ }
356
+
357
+ if cfg ! ( target_arch = "aarch64" ) {
358
+ return unsupported_base
359
+ || config. simd ( )
360
+ || config. wide_arithmetic ( )
361
+ || config. threads ( ) ;
362
+ }
363
+
364
+ false
352
365
}
353
366
354
367
Compiler :: CraneliftPulley => config. threads ( ) || config. legacy_exceptions ( ) ,
@@ -365,9 +378,7 @@ impl Compiler {
365
378
|| cfg ! ( target_arch = "riscv64" )
366
379
|| cfg ! ( target_arch = "s390x" )
367
380
}
368
- Compiler :: Winch => {
369
- cfg ! ( target_arch = "x86_64" )
370
- }
381
+ Compiler :: Winch => cfg ! ( target_arch = "x86_64" ) || cfg ! ( target_arch = "aarch64" ) ,
371
382
Compiler :: CraneliftPulley => true ,
372
383
}
373
384
}
@@ -392,6 +403,51 @@ impl WastTest {
392
403
spec_proposal_from_path ( & self . path )
393
404
}
394
405
406
+ /// Returns true for tests that should be ignored (not run) for
407
+ /// the given config.
408
+
409
+ /// The infrastructure for `.wast` tests is designed to enable the
410
+ /// execution of tests at all times, however, while compiler
411
+ /// backends are in partial development state, it becomes harder
412
+ /// to guarantee particular tests will run to completion and
413
+ /// return a recoverable error, in some cases tests might segfault
414
+ /// making it challenging to assert a failure status.
415
+ /// It's recommended to avoid ignoring tests as much as possible, instead
416
+ /// it's recommended to add tests to `WastTest::should_fail`.
417
+ pub fn ignore ( & self , config : & WastConfig ) -> bool {
418
+ if config. compiler == Compiler :: Winch {
419
+ if cfg ! ( target_arch = "aarch64" ) {
420
+ let unsupported = [
421
+ // Missing stack checks (#8321)
422
+ "spec_testsuite/call.wast" ,
423
+ "spec_testsuite/fac.wast" ,
424
+ "spec_testsuite/skip-stack-guard-page.wast" ,
425
+ "misc_testsuite/stack_overflow.wast" ,
426
+ // Fails intermittently
427
+ "misc_testsuite/table_copy_on_imported_tables.wast" ,
428
+ // Segfault
429
+ "spec_testsuite/conversions.wast" ,
430
+ "spec_testsuite/func.wast" ,
431
+ "spec_testsuite/float_exprs.wast" ,
432
+ "spec_testsuite/int_exprs.wast" ,
433
+ "spec_testsuite/left-to-right.wast" ,
434
+ "spec_testsuite/i32.wast" ,
435
+ "spec_testsuite/traps.wast" ,
436
+ "spec_testsuite/unreachable.wast" ,
437
+ "spec_testsuite/unreached-valid.wast" ,
438
+ "misc_testsuite/component-model/fused.wast" ,
439
+ "misc_testsuite/component-model/strings.wast" ,
440
+ "misc_testsuite/winch/select.wast" ,
441
+ "misc_testsuite/sink-float-but-dont-trap.wast" ,
442
+ "misc_testsuite/issue4840.wast" ,
443
+ ] ;
444
+
445
+ return unsupported. iter ( ) . any ( |part| self . path . ends_with ( part) ) ;
446
+ }
447
+ }
448
+ false
449
+ }
450
+
395
451
/// Returns whether this test should fail under the specified extra
396
452
/// configuration.
397
453
pub fn should_fail ( & self , config : & WastConfig ) -> bool {
@@ -430,13 +486,13 @@ impl WastTest {
430
486
return true ;
431
487
}
432
488
433
- // Disable spec tests for proposals that Winch does not implement yet.
489
+ // Disable spec tests per target for proposals that Winch does not implement yet.
434
490
if config. compiler == Compiler :: Winch {
491
+ // Common list for tests that fail in all targets supported by Winch.
435
492
let unsupported = [
436
- // externref/reference-types related
437
- "component-model/modules.wast" ,
438
493
"extended-const/elem.wast" ,
439
494
"extended-const/global.wast" ,
495
+ "misc_testsuite/component-model/modules.wast" ,
440
496
"misc_testsuite/externref-id-function.wast" ,
441
497
"misc_testsuite/externref-segment.wast" ,
442
498
"misc_testsuite/externref-segments.wast" ,
@@ -449,10 +505,7 @@ impl WastTest {
449
505
"misc_testsuite/simple_ref_is_null.wast" ,
450
506
"misc_testsuite/table_grow_with_funcref.wast" ,
451
507
"spec_testsuite/br_table.wast" ,
452
- "spec_testsuite/data-invalid.wast" ,
453
- "spec_testsuite/elem.wast" ,
454
508
"spec_testsuite/global.wast" ,
455
- "spec_testsuite/linking.wast" ,
456
509
"spec_testsuite/ref_func.wast" ,
457
510
"spec_testsuite/ref_is_null.wast" ,
458
511
"spec_testsuite/ref_null.wast" ,
@@ -462,93 +515,139 @@ impl WastTest {
462
515
"spec_testsuite/table_grow.wast" ,
463
516
"spec_testsuite/table_set.wast" ,
464
517
"spec_testsuite/table_size.wast" ,
465
- // simd-related failures
466
- "misc_testsuite/simd/canonicalize-nan .wast" ,
518
+ "spec_testsuite/elem.wast" ,
519
+ "spec_testsuite/linking .wast" ,
467
520
] ;
468
521
469
522
if unsupported. iter ( ) . any ( |part| self . path . ends_with ( part) ) {
470
523
return true ;
471
524
}
472
525
473
- // SIMD on Winch requires AVX instructions.
526
+ #[ cfg( target_arch = "aarch64" ) ]
527
+ {
528
+ let unsupported = [
529
+ // Externref / GC related.
530
+ "misc_testsuite/winch/table_get.wast" ,
531
+ "misc_testsuite/winch/table_set.wast" ,
532
+ "misc_testsuite/winch/table_fill.wast" ,
533
+ // Known bugs that don't cause segfaults.
534
+ "spec_testsuite/call_indirect.wast" ,
535
+ "spec_testsuite/f32_cmp.wast" ,
536
+ "spec_testsuite/f64_cmp.wast" ,
537
+ "spec_testsuite/func_ptrs.wast" ,
538
+ "spec_testsuite/i64.wast" ,
539
+ "spec_testsuite/if.wast" ,
540
+ "spec_testsuite/imports.wast" ,
541
+ "spec_testsuite/local_set.wast" ,
542
+ "spec_testsuite/local_tee.wast" ,
543
+ "spec_testsuite/loop.wast" ,
544
+ "spec_testsuite/table_copy.wast" ,
545
+ "spec_testsuite/table_init.wast" ,
546
+ "misc_testsuite/custom-page-sizes/custom-page-sizes.wast" ,
547
+ "misc_testsuite/winch/table_grow.wast" ,
548
+ "spec_testsuite/proposals/custom-page-sizes/custom-page-sizes.wast" ,
549
+ "misc_testsuite/memory64/more-than-4gb.wast" ,
550
+ "misc_testsuite/call_indirect.wast" ,
551
+ ] ;
552
+
553
+ if unsupported. iter ( ) . any ( |part| self . path . ends_with ( part) ) {
554
+ return true ;
555
+ }
556
+ }
557
+
474
558
#[ cfg( target_arch = "x86_64" ) ]
475
- if ! ( std :: is_x86_feature_detected! ( "avx" ) && std :: is_x86_feature_detected! ( "avx2" ) ) {
559
+ {
476
560
let unsupported = [
477
- "annotations/simd_lane.wast" ,
478
- "memory64/simd.wast" ,
479
- "misc_testsuite/int-to-float-splat.wast" ,
480
- "misc_testsuite/issue6562.wast" ,
481
- "misc_testsuite/simd/almost-extmul.wast" ,
482
- "misc_testsuite/simd/cvt-from-uint.wast" ,
483
- "misc_testsuite/simd/issue_3327_bnot_lowering.wast" ,
484
- "misc_testsuite/simd/issue6725-no-egraph-panic.wast" ,
485
- "misc_testsuite/simd/replace-lane-preserve.wast" ,
486
- "misc_testsuite/simd/spillslot-size-fuzzbug.wast" ,
487
- "misc_testsuite/winch/issue-10331.wast" ,
488
- "misc_testsuite/winch/replace_lane.wast" ,
489
- "spec_testsuite/simd_align.wast" ,
490
- "spec_testsuite/simd_boolean.wast" ,
491
- "spec_testsuite/simd_conversions.wast" ,
492
- "spec_testsuite/simd_f32x4.wast" ,
493
- "spec_testsuite/simd_f32x4_arith.wast" ,
494
- "spec_testsuite/simd_f32x4_cmp.wast" ,
495
- "spec_testsuite/simd_f32x4_pmin_pmax.wast" ,
496
- "spec_testsuite/simd_f32x4_rounding.wast" ,
497
- "spec_testsuite/simd_f64x2.wast" ,
498
- "spec_testsuite/simd_f64x2_arith.wast" ,
499
- "spec_testsuite/simd_f64x2_cmp.wast" ,
500
- "spec_testsuite/simd_f64x2_pmin_pmax.wast" ,
501
- "spec_testsuite/simd_f64x2_rounding.wast" ,
502
- "spec_testsuite/simd_i16x8_cmp.wast" ,
503
- "spec_testsuite/simd_i32x4_cmp.wast" ,
504
- "spec_testsuite/simd_i64x2_arith2.wast" ,
505
- "spec_testsuite/simd_i64x2_cmp.wast" ,
506
- "spec_testsuite/simd_i8x16_arith2.wast" ,
507
- "spec_testsuite/simd_i8x16_cmp.wast" ,
508
- "spec_testsuite/simd_int_to_int_extend.wast" ,
509
- "spec_testsuite/simd_load.wast" ,
510
- "spec_testsuite/simd_load_extend.wast" ,
511
- "spec_testsuite/simd_load_splat.wast" ,
512
- "spec_testsuite/simd_load_zero.wast" ,
513
- "spec_testsuite/simd_splat.wast" ,
514
- "spec_testsuite/simd_store16_lane.wast" ,
515
- "spec_testsuite/simd_store32_lane.wast" ,
516
- "spec_testsuite/simd_store64_lane.wast" ,
517
- "spec_testsuite/simd_store8_lane.wast" ,
518
- "spec_testsuite/simd_load16_lane.wast" ,
519
- "spec_testsuite/simd_load32_lane.wast" ,
520
- "spec_testsuite/simd_load64_lane.wast" ,
521
- "spec_testsuite/simd_load8_lane.wast" ,
522
- "spec_testsuite/simd_bitwise.wast" ,
523
- "misc_testsuite/simd/load_splat_out_of_bounds.wast" ,
524
- "misc_testsuite/simd/unaligned-load.wast" ,
525
- "multi-memory/simd_memory-multi.wast" ,
526
- "misc_testsuite/simd/issue4807.wast" ,
527
- "spec_testsuite/simd_const.wast" ,
528
- "spec_testsuite/simd_i8x16_sat_arith.wast" ,
529
- "spec_testsuite/simd_i64x2_arith.wast" ,
530
- "spec_testsuite/simd_i16x8_arith.wast" ,
531
- "spec_testsuite/simd_i16x8_arith2.wast" ,
532
- "spec_testsuite/simd_i16x8_q15mulr_sat_s.wast" ,
533
- "spec_testsuite/simd_i16x8_sat_arith.wast" ,
534
- "spec_testsuite/simd_i32x4_arith.wast" ,
535
- "spec_testsuite/simd_i32x4_dot_i16x8.wast" ,
536
- "spec_testsuite/simd_i32x4_trunc_sat_f32x4.wast" ,
537
- "spec_testsuite/simd_i32x4_trunc_sat_f64x2.wast" ,
538
- "spec_testsuite/simd_i8x16_arith.wast" ,
539
- "spec_testsuite/simd_bit_shift.wast" ,
540
- "spec_testsuite/simd_lane.wast" ,
541
- "spec_testsuite/simd_i16x8_extmul_i8x16.wast" ,
542
- "spec_testsuite/simd_i32x4_extmul_i16x8.wast" ,
543
- "spec_testsuite/simd_i64x2_extmul_i32x4.wast" ,
544
- "spec_testsuite/simd_i16x8_extadd_pairwise_i8x16.wast" ,
545
- "spec_testsuite/simd_i32x4_extadd_pairwise_i16x8.wast" ,
546
- "spec_testsuite/simd_i32x4_arith2.wast" ,
561
+ // externref/reference-types related
562
+ // simd-related failures
563
+ "misc_testsuite/simd/canonicalize-nan.wast" ,
547
564
] ;
548
565
549
566
if unsupported. iter ( ) . any ( |part| self . path . ends_with ( part) ) {
550
567
return true ;
551
568
}
569
+
570
+ // SIMD on Winch requires AVX instructions.
571
+ #[ cfg( target_arch = "x86_64" ) ]
572
+ if !( std:: is_x86_feature_detected!( "avx" ) && std:: is_x86_feature_detected!( "avx2" ) )
573
+ {
574
+ let unsupported = [
575
+ "annotations/simd_lane.wast" ,
576
+ "memory64/simd.wast" ,
577
+ "misc_testsuite/int-to-float-splat.wast" ,
578
+ "misc_testsuite/issue6562.wast" ,
579
+ "misc_testsuite/simd/almost-extmul.wast" ,
580
+ "misc_testsuite/simd/cvt-from-uint.wast" ,
581
+ "misc_testsuite/simd/issue_3327_bnot_lowering.wast" ,
582
+ "misc_testsuite/simd/issue6725-no-egraph-panic.wast" ,
583
+ "misc_testsuite/simd/replace-lane-preserve.wast" ,
584
+ "misc_testsuite/simd/spillslot-size-fuzzbug.wast" ,
585
+ "misc_testsuite/winch/issue-10331.wast" ,
586
+ "misc_testsuite/winch/replace_lane.wast" ,
587
+ "spec_testsuite/simd_align.wast" ,
588
+ "spec_testsuite/simd_boolean.wast" ,
589
+ "spec_testsuite/simd_conversions.wast" ,
590
+ "spec_testsuite/simd_f32x4.wast" ,
591
+ "spec_testsuite/simd_f32x4_arith.wast" ,
592
+ "spec_testsuite/simd_f32x4_cmp.wast" ,
593
+ "spec_testsuite/simd_f32x4_pmin_pmax.wast" ,
594
+ "spec_testsuite/simd_f32x4_rounding.wast" ,
595
+ "spec_testsuite/simd_f64x2.wast" ,
596
+ "spec_testsuite/simd_f64x2_arith.wast" ,
597
+ "spec_testsuite/simd_f64x2_cmp.wast" ,
598
+ "spec_testsuite/simd_f64x2_pmin_pmax.wast" ,
599
+ "spec_testsuite/simd_f64x2_rounding.wast" ,
600
+ "spec_testsuite/simd_i16x8_cmp.wast" ,
601
+ "spec_testsuite/simd_i32x4_cmp.wast" ,
602
+ "spec_testsuite/simd_i64x2_arith2.wast" ,
603
+ "spec_testsuite/simd_i64x2_cmp.wast" ,
604
+ "spec_testsuite/simd_i8x16_arith2.wast" ,
605
+ "spec_testsuite/simd_i8x16_cmp.wast" ,
606
+ "spec_testsuite/simd_int_to_int_extend.wast" ,
607
+ "spec_testsuite/simd_load.wast" ,
608
+ "spec_testsuite/simd_load_extend.wast" ,
609
+ "spec_testsuite/simd_load_splat.wast" ,
610
+ "spec_testsuite/simd_load_zero.wast" ,
611
+ "spec_testsuite/simd_splat.wast" ,
612
+ "spec_testsuite/simd_store16_lane.wast" ,
613
+ "spec_testsuite/simd_store32_lane.wast" ,
614
+ "spec_testsuite/simd_store64_lane.wast" ,
615
+ "spec_testsuite/simd_store8_lane.wast" ,
616
+ "spec_testsuite/simd_load16_lane.wast" ,
617
+ "spec_testsuite/simd_load32_lane.wast" ,
618
+ "spec_testsuite/simd_load64_lane.wast" ,
619
+ "spec_testsuite/simd_load8_lane.wast" ,
620
+ "spec_testsuite/simd_bitwise.wast" ,
621
+ "misc_testsuite/simd/load_splat_out_of_bounds.wast" ,
622
+ "misc_testsuite/simd/unaligned-load.wast" ,
623
+ "multi-memory/simd_memory-multi.wast" ,
624
+ "misc_testsuite/simd/issue4807.wast" ,
625
+ "spec_testsuite/simd_const.wast" ,
626
+ "spec_testsuite/simd_i8x16_sat_arith.wast" ,
627
+ "spec_testsuite/simd_i64x2_arith.wast" ,
628
+ "spec_testsuite/simd_i16x8_arith.wast" ,
629
+ "spec_testsuite/simd_i16x8_arith2.wast" ,
630
+ "spec_testsuite/simd_i16x8_q15mulr_sat_s.wast" ,
631
+ "spec_testsuite/simd_i16x8_sat_arith.wast" ,
632
+ "spec_testsuite/simd_i32x4_arith.wast" ,
633
+ "spec_testsuite/simd_i32x4_dot_i16x8.wast" ,
634
+ "spec_testsuite/simd_i32x4_trunc_sat_f32x4.wast" ,
635
+ "spec_testsuite/simd_i32x4_trunc_sat_f64x2.wast" ,
636
+ "spec_testsuite/simd_i8x16_arith.wast" ,
637
+ "spec_testsuite/simd_bit_shift.wast" ,
638
+ "spec_testsuite/simd_lane.wast" ,
639
+ "spec_testsuite/simd_i16x8_extmul_i8x16.wast" ,
640
+ "spec_testsuite/simd_i32x4_extmul_i16x8.wast" ,
641
+ "spec_testsuite/simd_i64x2_extmul_i32x4.wast" ,
642
+ "spec_testsuite/simd_i16x8_extadd_pairwise_i8x16.wast" ,
643
+ "spec_testsuite/simd_i32x4_extadd_pairwise_i16x8.wast" ,
644
+ "spec_testsuite/simd_i32x4_arith2.wast" ,
645
+ ] ;
646
+
647
+ if unsupported. iter ( ) . any ( |part| self . path . ends_with ( part) ) {
648
+ return true ;
649
+ }
650
+ }
552
651
}
553
652
}
554
653
0 commit comments