Skip to content

Commit ba5a22a

Browse files
committed
---
yaml --- r: 227063 b: refs/heads/master c: 926b835 h: refs/heads/master i: 227061: f97b721 227059: 1bc3303 227055: d0e9261 v: v3
1 parent 31f2c0c commit ba5a22a

File tree

2 files changed

+48
-23
lines changed

2 files changed

+48
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3e500673cc540828f9ec609f83d07f4e1c271de0
2+
refs/heads/master: 926b8351cf1d1489386bbf96355990ae01f6cb11
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustc_trans/trans/intrinsic.rs

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,21 +1359,24 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
13591359

13601360
if let Some(cmp_op) = comparison {
13611361
assert_eq!(arg_tys.len(), 2);
1362-
// we need nominal equality here, not LLVM (structural)
1363-
// equality
1364-
require!(arg_tys[0] == arg_tys[1],
1365-
"SIMD comparison intrinsic monomorphised with different input types");
13661362
require!(arg_tys[0].is_simd(tcx),
1367-
"SIMD comparison intrinsic monomorphised for non-SIMD argument type");
1363+
"SIMD comparison intrinsic monomorphized for non-SIMD argument type `{}`",
1364+
arg_tys[0]);
13681365
require!(ret_ty.is_simd(tcx),
1369-
"SIMD comparison intrinsic monomorphised for non-SIMD return type");
1366+
"SIMD comparison intrinsic monomorphized for non-SIMD return type `{}`",
1367+
ret_ty);
13701368

13711369
let in_len = arg_tys[0].simd_size(tcx);
13721370
let out_len = ret_ty.simd_size(tcx);
13731371
require!(in_len == out_len,
1374-
"SIMD comparison intrinsic monomorphised for non-SIMD argument type");
1372+
"SIMD cast intrinsic monomorphized with input type `{}` and \
1373+
return type `{}` with different lengths: {} vs. {}",
1374+
arg_tys[0],
1375+
ret_ty,
1376+
in_len,
1377+
out_len);
13751378
require!(llret_ty.element_type().kind() == llvm::Integer,
1376-
"SIMD comparison intrinsic monomorphised with non-integer return");
1379+
"SIMD comparison intrinsic monomorphized with non-integer return");
13771380

13781381
return compare_simd_types(bcx,
13791382
llargs[0],
@@ -1391,18 +1394,20 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
13911394
"bad `simd_shuffle` instruction only caught in trans?")
13921395
};
13931396

1394-
require!(arg_tys[0] == arg_tys[1],
1395-
"SIMD shuffle intrinsic monomorphised with different input types");
1397+
require!(arg_tys[0].is_simd(tcx),
1398+
"SIMD shuffle intrinsic monomorphized with non-SIMD input type `{}`",
1399+
arg_tys[0]);
13961400
require!(ret_ty.is_simd(tcx),
1397-
"SIMD shuffle intrinsic monomorphised for non-SIMD return type");
1401+
"SIMD shuffle intrinsic monomorphized for non-SIMD return type `{}`",
1402+
ret_ty);
13981403

13991404
let in_len = arg_tys[0].simd_size(tcx);
14001405
let out_len = ret_ty.simd_size(tcx);
14011406
require!(out_len == n,
1402-
"SIMD shuffle intrinsic monomorphised with return type of length {} (expected {})",
1407+
"SIMD shuffle intrinsic monomorphized with return type of length {} (expected {})",
14031408
out_len, n);
14041409
require!(arg_tys[0].simd_type(tcx) == ret_ty.simd_type(tcx),
1405-
"SIMD shuffle intrinsic monomorphised with different \
1410+
"SIMD shuffle intrinsic monomorphized with different \
14061411
input and return element types");
14071412

14081413
let total_len = in_len as u64 * 2;
@@ -1448,27 +1453,37 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
14481453

14491454
if name == "simd_insert" {
14501455
require!(arg_tys[0].is_simd(tcx),
1451-
"SIMD insert intrinsic monomorphised for non-SIMD input type");
1456+
"SIMD insert intrinsic monomorphized for non-SIMD input type");
14521457

14531458
let elem_ty = arg_tys[0].simd_type(tcx);
14541459
require!(arg_tys[2] == elem_ty,
1455-
"SIMD insert intrinsic monomorphised with inserted type not SIMD element type");
1460+
"SIMD insert intrinsic monomorphized with inserted type not SIMD element type");
14561461
return InsertElement(bcx, llargs[0], llargs[2], llargs[1])
14571462
}
14581463
if name == "simd_extract" {
14591464
require!(arg_tys[0].is_simd(tcx),
1460-
"SIMD insert intrinsic monomorphised for non-SIMD input type");
1465+
"SIMD insert intrinsic monomorphized for non-SIMD input type");
14611466

14621467
let elem_ty = arg_tys[0].simd_type(tcx);
14631468
require!(ret_ty == elem_ty,
1464-
"SIMD insert intrinsic monomorphised with returned type not SIMD element type");
1469+
"SIMD insert intrinsic monomorphized with returned type not SIMD element type");
14651470
return ExtractElement(bcx, llargs[0], llargs[1])
14661471
}
14671472

14681473
if name == "simd_cast" {
1474+
require!(arg_tys[0].is_simd(tcx),
1475+
"SIMD cast intrinsic monomorphized with non-SIMD input type `{}`",
1476+
arg_tys[0]);
1477+
require!(ret_ty.is_simd(tcx),
1478+
"SIMD cast intrinsic monomorphized with non-SIMD return type `{}`",
1479+
ret_ty);
14691480
require!(arg_tys[0].simd_size(tcx) == ret_ty.simd_size(tcx),
1470-
"SIMD cast intrinsic monomorphised with input and \
1471-
return types of different lengths");
1481+
"SIMD cast intrinsic monomorphized with input type `{}` and \
1482+
return type `{}` with different lengths: {} vs. {}",
1483+
arg_tys[0],
1484+
ret_ty,
1485+
arg_tys[0].simd_size(tcx),
1486+
ret_ty.simd_size(tcx));
14721487
// casting cares about nominal type, not just structural type
14731488
let in_ = arg_tys[0].simd_type(tcx);
14741489
let out = ret_ty.simd_type(tcx);
@@ -1590,12 +1605,19 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
15901605
}
15911606
_ => {}
15921607
}
1593-
require!(false, "SIMD cast intrinsic monomorphised with incompatible cast");
1608+
require!(false,
1609+
"SIMD cast intrinsic monomorphized with incompatible cast \
1610+
from `{}` (element `{}`)to `{}` (element `{}`)",
1611+
arg_tys[0], in_,
1612+
ret_ty, out);
15941613
}
15951614
macro_rules! arith {
15961615
($($name: ident: $($($p: ident),* => $call: expr),*;)*) => {
15971616
$(
15981617
if name == stringify!($name) {
1618+
require!(arg_tys[0].is_simd(tcx),
1619+
"`{}` intrinsic monomorphized with non-SIMD type `{}`",
1620+
name, arg_tys[0]);
15991621
let in_ = arg_tys[0].simd_type(tcx);
16001622
match in_.sty {
16011623
$(
@@ -1606,8 +1628,11 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
16061628
_ => {},
16071629
}
16081630
require!(false,
1609-
"{} intrinsic monomorphised with invalid type",
1610-
name)
1631+
"`{}` intrinsic monomorphized with SIMD vector `{}` \
1632+
with unsupported element type `{}`",
1633+
name,
1634+
arg_tys[0],
1635+
in_)
16111636
})*
16121637
}
16131638
}

0 commit comments

Comments
 (0)