@@ -1457,13 +1457,73 @@ fn generic_simd_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
1457
1457
if in_ == out { return llargs[ 0 ] ; }
1458
1458
1459
1459
match ( & in_. sty , & out. sty ) {
1460
+ ( & ty:: TyInt ( lhs) , & ty:: TyInt ( rhs) ) => {
1461
+ match ( lhs, rhs) {
1462
+ ( ast:: TyI8 , ast:: TyI8 ) |
1463
+ ( ast:: TyI16 , ast:: TyI16 ) |
1464
+ ( ast:: TyI32 , ast:: TyI32 ) |
1465
+ ( ast:: TyI64 , ast:: TyI64 ) => return llargs[ 0 ] ,
1466
+
1467
+ ( ast:: TyI8 , ast:: TyI16 ) |
1468
+ ( ast:: TyI8 , ast:: TyI32 ) |
1469
+ ( ast:: TyI8 , ast:: TyI64 ) |
1470
+ ( ast:: TyI16 , ast:: TyI32 ) |
1471
+ ( ast:: TyI16 , ast:: TyI64 ) |
1472
+ ( ast:: TyI32 , ast:: TyI64 ) => return SExt ( bcx, llargs[ 0 ] , llret_ty) ,
1473
+
1474
+ ( ast:: TyI16 , ast:: TyI8 ) |
1475
+ ( ast:: TyI32 , ast:: TyI8 ) |
1476
+ ( ast:: TyI32 , ast:: TyI16 ) |
1477
+ ( ast:: TyI64 , ast:: TyI8 ) |
1478
+ ( ast:: TyI64 , ast:: TyI16 ) |
1479
+ ( ast:: TyI64 , ast:: TyI32 ) => return Trunc ( bcx, llargs[ 0 ] , llret_ty) ,
1480
+ _ => { }
1481
+ }
1482
+ }
1483
+ ( & ty:: TyUint ( lhs) , & ty:: TyUint ( rhs) ) => {
1484
+ match ( lhs, rhs) {
1485
+ ( ast:: TyU8 , ast:: TyU8 ) |
1486
+ ( ast:: TyU16 , ast:: TyU16 ) |
1487
+ ( ast:: TyU32 , ast:: TyU32 ) |
1488
+ ( ast:: TyU64 , ast:: TyU64 ) => return llargs[ 0 ] ,
1489
+
1490
+ ( ast:: TyU8 , ast:: TyU16 ) |
1491
+ ( ast:: TyU8 , ast:: TyU32 ) |
1492
+ ( ast:: TyU8 , ast:: TyU64 ) |
1493
+ ( ast:: TyU16 , ast:: TyU32 ) |
1494
+ ( ast:: TyU16 , ast:: TyU64 ) |
1495
+ ( ast:: TyU32 , ast:: TyU64 ) => return ZExt ( bcx, llargs[ 0 ] , llret_ty) ,
1496
+
1497
+ ( ast:: TyU16 , ast:: TyU8 ) |
1498
+ ( ast:: TyU32 , ast:: TyU8 ) |
1499
+ ( ast:: TyU32 , ast:: TyU16 ) |
1500
+ ( ast:: TyU64 , ast:: TyU8 ) |
1501
+ ( ast:: TyU64 , ast:: TyU16 ) |
1502
+ ( ast:: TyU64 , ast:: TyU32 ) => return Trunc ( bcx, llargs[ 0 ] , llret_ty) ,
1503
+ _ => { }
1504
+ }
1505
+ }
1460
1506
( & ty:: TyInt ( lhs) , & ty:: TyUint ( rhs) ) => {
1461
1507
match ( lhs, rhs) {
1462
1508
( ast:: TyI8 , ast:: TyU8 ) |
1463
1509
( ast:: TyI16 , ast:: TyU16 ) |
1464
1510
( ast:: TyI32 , ast:: TyU32 ) |
1465
1511
( ast:: TyI64 , ast:: TyU64 ) => return llargs[ 0 ] ,
1466
- _ => { } ,
1512
+
1513
+ ( ast:: TyI8 , ast:: TyU16 ) |
1514
+ ( ast:: TyI8 , ast:: TyU32 ) |
1515
+ ( ast:: TyI8 , ast:: TyU64 ) |
1516
+ ( ast:: TyI16 , ast:: TyU32 ) |
1517
+ ( ast:: TyI16 , ast:: TyU64 ) |
1518
+ ( ast:: TyI32 , ast:: TyU64 ) => return SExt ( bcx, llargs[ 0 ] , llret_ty) ,
1519
+
1520
+ ( ast:: TyI16 , ast:: TyU8 ) |
1521
+ ( ast:: TyI32 , ast:: TyU8 ) |
1522
+ ( ast:: TyI32 , ast:: TyU16 ) |
1523
+ ( ast:: TyI64 , ast:: TyU8 ) |
1524
+ ( ast:: TyI64 , ast:: TyU16 ) |
1525
+ ( ast:: TyI64 , ast:: TyU32 ) => return Trunc ( bcx, llargs[ 0 ] , llret_ty) ,
1526
+ _ => { }
1467
1527
}
1468
1528
}
1469
1529
( & ty:: TyUint ( lhs) , & ty:: TyInt ( rhs) ) => {
@@ -1472,26 +1532,43 @@ fn generic_simd_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
1472
1532
( ast:: TyU16 , ast:: TyI16 ) |
1473
1533
( ast:: TyU32 , ast:: TyI32 ) |
1474
1534
( ast:: TyU64 , ast:: TyI64 ) => return llargs[ 0 ] ,
1475
- _ => { } ,
1535
+
1536
+ ( ast:: TyU8 , ast:: TyI16 ) |
1537
+ ( ast:: TyU8 , ast:: TyI32 ) |
1538
+ ( ast:: TyU8 , ast:: TyI64 ) |
1539
+ ( ast:: TyU16 , ast:: TyI32 ) |
1540
+ ( ast:: TyU16 , ast:: TyI64 ) |
1541
+ ( ast:: TyU32 , ast:: TyI64 ) => return ZExt ( bcx, llargs[ 0 ] , llret_ty) ,
1542
+
1543
+ ( ast:: TyU16 , ast:: TyI8 ) |
1544
+ ( ast:: TyU32 , ast:: TyI8 ) |
1545
+ ( ast:: TyU32 , ast:: TyI16 ) |
1546
+ ( ast:: TyU64 , ast:: TyI8 ) |
1547
+ ( ast:: TyU64 , ast:: TyI16 ) |
1548
+ ( ast:: TyU64 , ast:: TyI32 ) => return Trunc ( bcx, llargs[ 0 ] , llret_ty) ,
1549
+ _ => { }
1476
1550
}
1477
1551
}
1478
- ( & ty :: TyInt ( ast :: TyI32 ) , & ty :: TyFloat ( ast :: TyF32 ) ) |
1479
- ( & ty:: TyInt ( ast :: TyI64 ) , & ty:: TyFloat ( ast :: TyF64 ) ) => {
1552
+
1553
+ ( & ty:: TyInt ( _ ) , & ty:: TyFloat ( _ ) ) => {
1480
1554
return SIToFP ( bcx, llargs[ 0 ] , llret_ty)
1481
1555
}
1482
- ( & ty:: TyUint ( ast:: TyU32 ) , & ty:: TyFloat ( ast:: TyF32 ) ) |
1483
- ( & ty:: TyUint ( ast:: TyU64 ) , & ty:: TyFloat ( ast:: TyF64 ) ) => {
1556
+ ( & ty:: TyUint ( _) , & ty:: TyFloat ( _) ) => {
1484
1557
return UIToFP ( bcx, llargs[ 0 ] , llret_ty)
1485
1558
}
1486
1559
1487
- ( & ty:: TyFloat ( ast:: TyF32 ) , & ty:: TyInt ( ast:: TyI32 ) ) |
1488
- ( & ty:: TyFloat ( ast:: TyF64 ) , & ty:: TyInt ( ast:: TyI64 ) ) => {
1560
+ ( & ty:: TyFloat ( _) , & ty:: TyInt ( _) ) => {
1489
1561
return FPToSI ( bcx, llargs[ 0 ] , llret_ty)
1490
1562
}
1491
- ( & ty:: TyFloat ( ast:: TyF32 ) , & ty:: TyUint ( ast:: TyU32 ) ) |
1492
- ( & ty:: TyFloat ( ast:: TyF64 ) , & ty:: TyUint ( ast:: TyU64 ) ) => {
1563
+ ( & ty:: TyFloat ( _) , & ty:: TyUint ( _) ) => {
1493
1564
return FPToUI ( bcx, llargs[ 0 ] , llret_ty)
1494
1565
}
1566
+ ( & ty:: TyFloat ( ast:: TyF32 ) , & ty:: TyFloat ( ast:: TyF64 ) ) => {
1567
+ return FPExt ( bcx, llargs[ 0 ] , llret_ty)
1568
+ }
1569
+ ( & ty:: TyFloat ( ast:: TyF64 ) , & ty:: TyFloat ( ast:: TyF32 ) ) => {
1570
+ return FPTrunc ( bcx, llargs[ 0 ] , llret_ty)
1571
+ }
1495
1572
_ => { }
1496
1573
}
1497
1574
require ! ( false , "SIMD cast intrinsic monomorphised with incompatible cast" ) ;
0 commit comments