@@ -1067,12 +1067,13 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1067
1067
; MIPS32-NEXT: $BB4_1: # %entry
1068
1068
; MIPS32-NEXT: # =>This Inner Loop Header: Depth=1
1069
1069
; MIPS32-NEXT: ll $2, 0($6)
1070
- ; MIPS32-NEXT: srav $2, $2, $10
1071
- ; MIPS32-NEXT: srav $7, $7, $10
1072
- ; MIPS32-NEXT: sll $2, $2, 16
1073
- ; MIPS32-NEXT: sra $2, $2, 16
1074
- ; MIPS32-NEXT: sll $7, $7, 16
1075
- ; MIPS32-NEXT: sra $7, $7, 16
1070
+ ; MIPS32-NEXT: and $2, $2, $8
1071
+ ; MIPS32-NEXT: and $7, $7, $8
1072
+ ; MIPS32-NEXT: clz $5, $8
1073
+ ; MIPS32-NEXT: sllv $2, $2, $5
1074
+ ; MIPS32-NEXT: srav $2, $2, $5
1075
+ ; MIPS32-NEXT: sllv $7, $7, $5
1076
+ ; MIPS32-NEXT: srav $7, $7, $5
1076
1077
; MIPS32-NEXT: slt $5, $2, $7
1077
1078
; MIPS32-NEXT: move $3, $2
1078
1079
; MIPS32-NEXT: movn $3, $7, $5
@@ -1095,7 +1096,6 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1095
1096
; MIPS32-NEXT: addiu $sp, $sp, 8
1096
1097
; MIPS32-NEXT: jr $ra
1097
1098
; MIPS32-NEXT: nop
1098
-
1099
1099
;
1100
1100
; MIPSEL-LABEL: test_max_16:
1101
1101
; MIPSEL: # %bb.0: # %entry
@@ -1118,6 +1118,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1118
1118
; MIPSEL-NEXT: srav $7, $7, $10
1119
1119
; MIPSEL-NEXT: seh $2, $2
1120
1120
; MIPSEL-NEXT: seh $7, $7
1121
+ ; MIPSEL-NEXT: sllv $2, $2, $10
1122
+ ; MIPSEL-NEXT: sllv $7, $7, $10
1121
1123
; MIPSEL-NEXT: slt $5, $2, $7
1122
1124
; MIPSEL-NEXT: move $3, $2
1123
1125
; MIPSEL-NEXT: movn $3, $7, $5
@@ -1161,6 +1163,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1161
1163
; MIPSELR6-NEXT: srav $7, $7, $10
1162
1164
; MIPSELR6-NEXT: seh $2, $2
1163
1165
; MIPSELR6-NEXT: seh $7, $7
1166
+ ; MIPSELR6-NEXT: sllv $2, $2, $10
1167
+ ; MIPSELR6-NEXT: sllv $7, $7, $10
1164
1168
; MIPSELR6-NEXT: slt $5, $2, $7
1165
1169
; MIPSELR6-NEXT: seleqz $3, $2, $5
1166
1170
; MIPSELR6-NEXT: selnez $5, $7, $5
@@ -1203,6 +1207,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1203
1207
; MMEL-NEXT: srav $7, $7, $10
1204
1208
; MMEL-NEXT: seh $2, $2
1205
1209
; MMEL-NEXT: seh $7, $7
1210
+ ; MMEL-NEXT: sllv $2, $2, $10
1211
+ ; MMEL-NEXT: sllv $7, $7, $10
1206
1212
; MMEL-NEXT: slt $5, $2, $7
1207
1213
; MMEL-NEXT: or $3, $2, $zero
1208
1214
; MMEL-NEXT: movn $3, $7, $5
@@ -1244,6 +1250,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1244
1250
; MMELR6-NEXT: srav $7, $7, $10
1245
1251
; MMELR6-NEXT: seh $2, $2
1246
1252
; MMELR6-NEXT: seh $7, $7
1253
+ ; MMELR6-NEXT: sllv $2, $2, $10
1254
+ ; MMELR6-NEXT: sllv $7, $7, $10
1247
1255
; MMELR6-NEXT: slt $5, $2, $7
1248
1256
; MMELR6-NEXT: seleqz $3, $2, $5
1249
1257
; MMELR6-NEXT: selnez $5, $7, $5
@@ -1365,6 +1373,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1365
1373
; MIPS64EL-NEXT: srav $7, $7, $10
1366
1374
; MIPS64EL-NEXT: seh $2, $2
1367
1375
; MIPS64EL-NEXT: seh $7, $7
1376
+ ; MIPS64EL-NEXT: sllv $2, $2, $10
1377
+ ; MIPS64EL-NEXT: sllv $7, $7, $10
1368
1378
; MIPS64EL-NEXT: slt $5, $2, $7
1369
1379
; MIPS64EL-NEXT: move $3, $2
1370
1380
; MIPS64EL-NEXT: movn $3, $7, $5
@@ -1408,6 +1418,8 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1408
1418
; MIPS64ELR6-NEXT: srav $7, $7, $10
1409
1419
; MIPS64ELR6-NEXT: seh $2, $2
1410
1420
; MIPS64ELR6-NEXT: seh $7, $7
1421
+ ; MIPS64ELR6-NEXT: sllv $2, $2, $10
1422
+ ; MIPS64ELR6-NEXT: sllv $7, $7, $10
1411
1423
; MIPS64ELR6-NEXT: slt $5, $2, $7
1412
1424
; MIPS64ELR6-NEXT: seleqz $3, $2, $5
1413
1425
; MIPS64ELR6-NEXT: selnez $5, $7, $5
@@ -1428,6 +1440,7 @@ define i16 @test_max_16(ptr nocapture %ptr, i16 signext %val) {
1428
1440
; MIPS64ELR6-NEXT: sync
1429
1441
; MIPS64ELR6-NEXT: daddiu $sp, $sp, 16
1430
1442
; MIPS64ELR6-NEXT: jrc $ra
1443
+
1431
1444
entry:
1432
1445
%0 = atomicrmw max ptr %ptr , i16 %val seq_cst
1433
1446
ret i16 %0
@@ -1607,12 +1620,13 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1607
1620
; MIPS32-NEXT: $BB5_1: # %entry
1608
1621
; MIPS32-NEXT: # =>This Inner Loop Header: Depth=1
1609
1622
; MIPS32-NEXT: ll $2, 0($6)
1610
- ; MIPS32-NEXT: srav $2, $2, $10
1611
- ; MIPS32-NEXT: srav $7, $7, $10
1612
- ; MIPS32-NEXT: sll $2, $2, 16
1613
- ; MIPS32-NEXT: sra $2, $2, 16
1614
- ; MIPS32-NEXT: sll $7, $7, 16
1615
- ; MIPS32-NEXT: sra $7, $7, 16
1623
+ ; MIPS32-NEXT: and $2, $2, $8
1624
+ ; MIPS32-NEXT: and $7, $7, $8
1625
+ ; MIPS32-NEXT: clz $5, $8
1626
+ ; MIPS32-NEXT: sllv $2, $2, $5
1627
+ ; MIPS32-NEXT: srav $2, $2, $5
1628
+ ; MIPS32-NEXT: sllv $7, $7, $5
1629
+ ; MIPS32-NEXT: srav $7, $7, $5
1616
1630
; MIPS32-NEXT: slt $5, $2, $7
1617
1631
; MIPS32-NEXT: move $3, $2
1618
1632
; MIPS32-NEXT: movz $3, $7, $5
@@ -1657,6 +1671,8 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1657
1671
; MIPSEL-NEXT: srav $7, $7, $10
1658
1672
; MIPSEL-NEXT: seh $2, $2
1659
1673
; MIPSEL-NEXT: seh $7, $7
1674
+ ; MIPSEL-NEXT: sllv $2, $2, $10
1675
+ ; MIPSEL-NEXT: sllv $7, $7, $10
1660
1676
; MIPSEL-NEXT: slt $5, $2, $7
1661
1677
; MIPSEL-NEXT: move $3, $2
1662
1678
; MIPSEL-NEXT: movz $3, $7, $5
@@ -1700,6 +1716,8 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1700
1716
; MIPSELR6-NEXT: srav $7, $7, $10
1701
1717
; MIPSELR6-NEXT: seh $2, $2
1702
1718
; MIPSELR6-NEXT: seh $7, $7
1719
+ ; MIPSELR6-NEXT: sllv $2, $2, $10
1720
+ ; MIPSELR6-NEXT: sllv $7, $7, $10
1703
1721
; MIPSELR6-NEXT: slt $5, $2, $7
1704
1722
; MIPSELR6-NEXT: selnez $3, $2, $5
1705
1723
; MIPSELR6-NEXT: seleqz $5, $7, $5
@@ -1742,6 +1760,8 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1742
1760
; MMEL-NEXT: srav $7, $7, $10
1743
1761
; MMEL-NEXT: seh $2, $2
1744
1762
; MMEL-NEXT: seh $7, $7
1763
+ ; MMEL-NEXT: sllv $2, $2, $10
1764
+ ; MMEL-NEXT: sllv $7, $7, $10
1745
1765
; MMEL-NEXT: slt $5, $2, $7
1746
1766
; MMEL-NEXT: or $3, $2, $zero
1747
1767
; MMEL-NEXT: movz $3, $7, $5
@@ -1783,6 +1803,8 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1783
1803
; MMELR6-NEXT: srav $7, $7, $10
1784
1804
; MMELR6-NEXT: seh $2, $2
1785
1805
; MMELR6-NEXT: seh $7, $7
1806
+ ; MMELR6-NEXT: sllv $2, $2, $10
1807
+ ; MMELR6-NEXT: sllv $7, $7, $10
1786
1808
; MMELR6-NEXT: slt $5, $2, $7
1787
1809
; MMELR6-NEXT: selnez $3, $2, $5
1788
1810
; MMELR6-NEXT: seleqz $5, $7, $5
@@ -1904,6 +1926,8 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1904
1926
; MIPS64EL-NEXT: srav $7, $7, $10
1905
1927
; MIPS64EL-NEXT: seh $2, $2
1906
1928
; MIPS64EL-NEXT: seh $7, $7
1929
+ ; MIPS64EL-NEXT: sllv $2, $2, $10
1930
+ ; MIPS64EL-NEXT: sllv $7, $7, $10
1907
1931
; MIPS64EL-NEXT: slt $5, $2, $7
1908
1932
; MIPS64EL-NEXT: move $3, $2
1909
1933
; MIPS64EL-NEXT: movz $3, $7, $5
@@ -1947,6 +1971,8 @@ define i16 @test_min_16(ptr nocapture %ptr, i16 signext %val) {
1947
1971
; MIPS64ELR6-NEXT: srav $7, $7, $10
1948
1972
; MIPS64ELR6-NEXT: seh $2, $2
1949
1973
; MIPS64ELR6-NEXT: seh $7, $7
1974
+ ; MIPS64ELR6-NEXT: sllv $2, $2, $10
1975
+ ; MIPS64ELR6-NEXT: sllv $7, $7, $10
1950
1976
; MIPS64ELR6-NEXT: slt $5, $2, $7
1951
1977
; MIPS64ELR6-NEXT: selnez $3, $2, $5
1952
1978
; MIPS64ELR6-NEXT: seleqz $5, $7, $5
@@ -2694,7 +2720,6 @@ define i16 @test_umin_16(ptr nocapture %ptr, i16 signext %val) {
2694
2720
; MIPS32-NEXT: jr $ra
2695
2721
; MIPS32-NEXT: nop
2696
2722
;
2697
- ;
2698
2723
; MIPSEL-LABEL: test_umin_16:
2699
2724
; MIPSEL: # %bb.0: # %entry
2700
2725
; MIPSEL-NEXT: addiu $sp, $sp, -8
@@ -3194,12 +3219,13 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3194
3219
; MIPS32-NEXT: $BB8_1: # %entry
3195
3220
; MIPS32-NEXT: # =>This Inner Loop Header: Depth=1
3196
3221
; MIPS32-NEXT: ll $2, 0($6)
3197
- ; MIPS32-NEXT: srav $2, $2, $10
3198
- ; MIPS32-NEXT: srav $7, $7, $10
3199
- ; MIPS32-NEXT: sll $2, $2, 24
3200
- ; MIPS32-NEXT: sra $2, $2, 24
3201
- ; MIPS32-NEXT: sll $7, $7, 24
3202
- ; MIPS32-NEXT: sra $7, $7, 24
3222
+ ; MIPS32-NEXT: and $2, $2, $8
3223
+ ; MIPS32-NEXT: and $7, $7, $8
3224
+ ; MIPS32-NEXT: clz $5, $8
3225
+ ; MIPS32-NEXT: sllv $2, $2, $5
3226
+ ; MIPS32-NEXT: srav $2, $2, $5
3227
+ ; MIPS32-NEXT: sllv $7, $7, $5
3228
+ ; MIPS32-NEXT: srav $7, $7, $5
3203
3229
; MIPS32-NEXT: slt $5, $2, $7
3204
3230
; MIPS32-NEXT: move $3, $2
3205
3231
; MIPS32-NEXT: movn $3, $7, $5
@@ -3244,6 +3270,8 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3244
3270
; MIPSEL-NEXT: srav $7, $7, $10
3245
3271
; MIPSEL-NEXT: seb $2, $2
3246
3272
; MIPSEL-NEXT: seb $7, $7
3273
+ ; MIPSEL-NEXT: sllv $2, $2, $10
3274
+ ; MIPSEL-NEXT: sllv $7, $7, $10
3247
3275
; MIPSEL-NEXT: slt $5, $2, $7
3248
3276
; MIPSEL-NEXT: move $3, $2
3249
3277
; MIPSEL-NEXT: movn $3, $7, $5
@@ -3287,6 +3315,8 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3287
3315
; MIPSELR6-NEXT: srav $7, $7, $10
3288
3316
; MIPSELR6-NEXT: seb $2, $2
3289
3317
; MIPSELR6-NEXT: seb $7, $7
3318
+ ; MIPSELR6-NEXT: sllv $2, $2, $10
3319
+ ; MIPSELR6-NEXT: sllv $7, $7, $10
3290
3320
; MIPSELR6-NEXT: slt $5, $2, $7
3291
3321
; MIPSELR6-NEXT: seleqz $3, $2, $5
3292
3322
; MIPSELR6-NEXT: selnez $5, $7, $5
@@ -3329,6 +3359,8 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3329
3359
; MMEL-NEXT: srav $7, $7, $10
3330
3360
; MMEL-NEXT: seb $2, $2
3331
3361
; MMEL-NEXT: seb $7, $7
3362
+ ; MMEL-NEXT: sllv $2, $2, $10
3363
+ ; MMEL-NEXT: sllv $7, $7, $10
3332
3364
; MMEL-NEXT: slt $5, $2, $7
3333
3365
; MMEL-NEXT: or $3, $2, $zero
3334
3366
; MMEL-NEXT: movn $3, $7, $5
@@ -3370,6 +3402,8 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3370
3402
; MMELR6-NEXT: srav $7, $7, $10
3371
3403
; MMELR6-NEXT: seb $2, $2
3372
3404
; MMELR6-NEXT: seb $7, $7
3405
+ ; MMELR6-NEXT: sllv $2, $2, $10
3406
+ ; MMELR6-NEXT: sllv $7, $7, $10
3373
3407
; MMELR6-NEXT: slt $5, $2, $7
3374
3408
; MMELR6-NEXT: seleqz $3, $2, $5
3375
3409
; MMELR6-NEXT: selnez $5, $7, $5
@@ -3491,6 +3525,8 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3491
3525
; MIPS64EL-NEXT: srav $7, $7, $10
3492
3526
; MIPS64EL-NEXT: seb $2, $2
3493
3527
; MIPS64EL-NEXT: seb $7, $7
3528
+ ; MIPS64EL-NEXT: sllv $2, $2, $10
3529
+ ; MIPS64EL-NEXT: sllv $7, $7, $10
3494
3530
; MIPS64EL-NEXT: slt $5, $2, $7
3495
3531
; MIPS64EL-NEXT: move $3, $2
3496
3532
; MIPS64EL-NEXT: movn $3, $7, $5
@@ -3534,6 +3570,8 @@ define i8 @test_max_8(ptr nocapture %ptr, i8 signext %val) {
3534
3570
; MIPS64ELR6-NEXT: srav $7, $7, $10
3535
3571
; MIPS64ELR6-NEXT: seb $2, $2
3536
3572
; MIPS64ELR6-NEXT: seb $7, $7
3573
+ ; MIPS64ELR6-NEXT: sllv $2, $2, $10
3574
+ ; MIPS64ELR6-NEXT: sllv $7, $7, $10
3537
3575
; MIPS64ELR6-NEXT: slt $5, $2, $7
3538
3576
; MIPS64ELR6-NEXT: seleqz $3, $2, $5
3539
3577
; MIPS64ELR6-NEXT: selnez $5, $7, $5
@@ -3733,12 +3771,13 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
3733
3771
; MIPS32-NEXT: $BB9_1: # %entry
3734
3772
; MIPS32-NEXT: # =>This Inner Loop Header: Depth=1
3735
3773
; MIPS32-NEXT: ll $2, 0($6)
3736
- ; MIPS32-NEXT: srav $2, $2, $10
3737
- ; MIPS32-NEXT: srav $7, $7, $10
3738
- ; MIPS32-NEXT: sll $2, $2, 24
3739
- ; MIPS32-NEXT: sra $2, $2, 24
3740
- ; MIPS32-NEXT: sll $7, $7, 24
3741
- ; MIPS32-NEXT: sra $7, $7, 24
3774
+ ; MIPS32-NEXT: and $2, $2, $8
3775
+ ; MIPS32-NEXT: and $7, $7, $8
3776
+ ; MIPS32-NEXT: clz $5, $8
3777
+ ; MIPS32-NEXT: sllv $2, $2, $5
3778
+ ; MIPS32-NEXT: srav $2, $2, $5
3779
+ ; MIPS32-NEXT: sllv $7, $7, $5
3780
+ ; MIPS32-NEXT: srav $7, $7, $5
3742
3781
; MIPS32-NEXT: slt $5, $2, $7
3743
3782
; MIPS32-NEXT: move $3, $2
3744
3783
; MIPS32-NEXT: movz $3, $7, $5
@@ -3783,6 +3822,8 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
3783
3822
; MIPSEL-NEXT: srav $7, $7, $10
3784
3823
; MIPSEL-NEXT: seb $2, $2
3785
3824
; MIPSEL-NEXT: seb $7, $7
3825
+ ; MIPSEL-NEXT: sllv $2, $2, $10
3826
+ ; MIPSEL-NEXT: sllv $7, $7, $10
3786
3827
; MIPSEL-NEXT: slt $5, $2, $7
3787
3828
; MIPSEL-NEXT: move $3, $2
3788
3829
; MIPSEL-NEXT: movz $3, $7, $5
@@ -3826,6 +3867,8 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
3826
3867
; MIPSELR6-NEXT: srav $7, $7, $10
3827
3868
; MIPSELR6-NEXT: seb $2, $2
3828
3869
; MIPSELR6-NEXT: seb $7, $7
3870
+ ; MIPSELR6-NEXT: sllv $2, $2, $10
3871
+ ; MIPSELR6-NEXT: sllv $7, $7, $10
3829
3872
; MIPSELR6-NEXT: slt $5, $2, $7
3830
3873
; MIPSELR6-NEXT: selnez $3, $2, $5
3831
3874
; MIPSELR6-NEXT: seleqz $5, $7, $5
@@ -3868,6 +3911,8 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
3868
3911
; MMEL-NEXT: srav $7, $7, $10
3869
3912
; MMEL-NEXT: seb $2, $2
3870
3913
; MMEL-NEXT: seb $7, $7
3914
+ ; MMEL-NEXT: sllv $2, $2, $10
3915
+ ; MMEL-NEXT: sllv $7, $7, $10
3871
3916
; MMEL-NEXT: slt $5, $2, $7
3872
3917
; MMEL-NEXT: or $3, $2, $zero
3873
3918
; MMEL-NEXT: movz $3, $7, $5
@@ -3909,6 +3954,8 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
3909
3954
; MMELR6-NEXT: srav $7, $7, $10
3910
3955
; MMELR6-NEXT: seb $2, $2
3911
3956
; MMELR6-NEXT: seb $7, $7
3957
+ ; MMELR6-NEXT: sllv $2, $2, $10
3958
+ ; MMELR6-NEXT: sllv $7, $7, $10
3912
3959
; MMELR6-NEXT: slt $5, $2, $7
3913
3960
; MMELR6-NEXT: selnez $3, $2, $5
3914
3961
; MMELR6-NEXT: seleqz $5, $7, $5
@@ -4030,6 +4077,8 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
4030
4077
; MIPS64EL-NEXT: srav $7, $7, $10
4031
4078
; MIPS64EL-NEXT: seb $2, $2
4032
4079
; MIPS64EL-NEXT: seb $7, $7
4080
+ ; MIPS64EL-NEXT: sllv $2, $2, $10
4081
+ ; MIPS64EL-NEXT: sllv $7, $7, $10
4033
4082
; MIPS64EL-NEXT: slt $5, $2, $7
4034
4083
; MIPS64EL-NEXT: move $3, $2
4035
4084
; MIPS64EL-NEXT: movz $3, $7, $5
@@ -4073,6 +4122,8 @@ define i8 @test_min_8(ptr nocapture %ptr, i8 signext %val) {
4073
4122
; MIPS64ELR6-NEXT: srav $7, $7, $10
4074
4123
; MIPS64ELR6-NEXT: seb $2, $2
4075
4124
; MIPS64ELR6-NEXT: seb $7, $7
4125
+ ; MIPS64ELR6-NEXT: sllv $2, $2, $10
4126
+ ; MIPS64ELR6-NEXT: sllv $7, $7, $10
4076
4127
; MIPS64ELR6-NEXT: slt $5, $2, $7
4077
4128
; MIPS64ELR6-NEXT: selnez $3, $2, $5
4078
4129
; MIPS64ELR6-NEXT: seleqz $5, $7, $5
0 commit comments