@@ -488,7 +488,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
488
488
} ) ;
489
489
}
490
490
491
- sym:: simd_reduce_add_ordered | sym :: simd_reduce_add_unordered => {
491
+ sym:: simd_reduce_add_ordered => {
492
492
intrinsic_args ! ( fx, args => ( v, acc) ; intrinsic) ;
493
493
let acc = acc. load_scalar ( fx) ;
494
494
@@ -507,7 +507,25 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
507
507
} ) ;
508
508
}
509
509
510
- sym:: simd_reduce_mul_ordered | sym:: simd_reduce_mul_unordered => {
510
+ sym:: simd_reduce_add_unordered => {
511
+ intrinsic_args ! ( fx, args => ( v) ; intrinsic) ;
512
+
513
+ // FIXME there must be no acc param for integer vectors
514
+ if !v. layout ( ) . ty . is_simd ( ) {
515
+ report_simd_type_validation_error ( fx, intrinsic, span, v. layout ( ) . ty ) ;
516
+ return ;
517
+ }
518
+
519
+ simd_reduce ( fx, v, None , ret, & |fx, lane_ty, a, b| {
520
+ if lane_ty. is_floating_point ( ) {
521
+ fx. bcx . ins ( ) . fadd ( a, b)
522
+ } else {
523
+ fx. bcx . ins ( ) . iadd ( a, b)
524
+ }
525
+ } ) ;
526
+ }
527
+
528
+ sym:: simd_reduce_mul_ordered => {
511
529
intrinsic_args ! ( fx, args => ( v, acc) ; intrinsic) ;
512
530
let acc = acc. load_scalar ( fx) ;
513
531
@@ -526,6 +544,24 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
526
544
} ) ;
527
545
}
528
546
547
+ sym:: simd_reduce_mul_unordered => {
548
+ intrinsic_args ! ( fx, args => ( v) ; intrinsic) ;
549
+
550
+ // FIXME there must be no acc param for integer vectors
551
+ if !v. layout ( ) . ty . is_simd ( ) {
552
+ report_simd_type_validation_error ( fx, intrinsic, span, v. layout ( ) . ty ) ;
553
+ return ;
554
+ }
555
+
556
+ simd_reduce ( fx, v, None , ret, & |fx, lane_ty, a, b| {
557
+ if lane_ty. is_floating_point ( ) {
558
+ fx. bcx . ins ( ) . fmul ( a, b)
559
+ } else {
560
+ fx. bcx . ins ( ) . imul ( a, b)
561
+ }
562
+ } ) ;
563
+ }
564
+
529
565
sym:: simd_reduce_all => {
530
566
intrinsic_args ! ( fx, args => ( v) ; intrinsic) ;
531
567
@@ -581,7 +617,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
581
617
simd_reduce ( fx, v, None , ret, & |fx, _ty, a, b| fx. bcx . ins ( ) . bxor ( a, b) ) ;
582
618
}
583
619
584
- sym:: simd_reduce_min => {
620
+ sym:: simd_reduce_min | sym :: simd_reduce_min_nanless => {
585
621
intrinsic_args ! ( fx, args => ( v) ; intrinsic) ;
586
622
587
623
if !v. layout ( ) . ty . is_simd ( ) {
@@ -600,7 +636,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
600
636
} ) ;
601
637
}
602
638
603
- sym:: simd_reduce_max => {
639
+ sym:: simd_reduce_max | sym :: simd_reduce_max_nanless => {
604
640
intrinsic_args ! ( fx, args => ( v) ; intrinsic) ;
605
641
606
642
if !v. layout ( ) . ty . is_simd ( ) {
@@ -878,6 +914,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
878
914
fx. tcx . sess . span_err ( span, format ! ( "Unknown SIMD intrinsic {}" , intrinsic) ) ;
879
915
// Prevent verifier error
880
916
fx. bcx . ins ( ) . trap ( TrapCode :: UnreachableCodeReached ) ;
917
+ return ;
881
918
}
882
919
}
883
920
let ret_block = fx. get_block ( target) ;
0 commit comments