Skip to content

Commit 56abb2f

Browse files
committed
---
yaml --- r: 227038 b: refs/heads/master c: 78eead6 h: refs/heads/master v: v3
1 parent 6244fd9 commit 56abb2f

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
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: 9af385bddb3076637ab299672c90702562644894
2+
refs/heads/master: 78eead63fa91dbe156236b547bb4290f02784712
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: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,5 +1426,24 @@ fn generic_simd_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
14261426

14271427
return ShuffleVector(bcx, llargs[0], llargs[1], C_vector(&indices))
14281428
}
1429-
C_null(llret_ty)
1429+
1430+
if name == "simd_insert" {
1431+
require!(arg_tys[0].is_simd(tcx),
1432+
"SIMD insert intrinsic monomorphised for non-SIMD input type");
1433+
1434+
let elem_ty = arg_tys[0].simd_type(tcx);
1435+
require!(arg_tys[2] == elem_ty,
1436+
"SIMD insert intrinsic monomorphised with inserted type not SIMD element type");
1437+
return InsertElement(bcx, llargs[0], llargs[2], llargs[1])
1438+
}
1439+
if name == "simd_extract" {
1440+
require!(arg_tys[0].is_simd(tcx),
1441+
"SIMD insert intrinsic monomorphised for non-SIMD input type");
1442+
1443+
let elem_ty = arg_tys[0].simd_type(tcx);
1444+
require!(ret_ty == elem_ty,
1445+
"SIMD insert intrinsic monomorphised with returned type not SIMD element type");
1446+
return ExtractElement(bcx, llargs[0], llargs[1])
1447+
}
1448+
bcx.sess().span_bug(call_info.span, "unknown SIMD intrinsic");
14301449
}

trunk/src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5344,6 +5344,8 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &ast::ForeignItem) {
53445344
"simd_eq" | "simd_ne" | "simd_lt" | "simd_le" | "simd_gt" | "simd_ge" => {
53455345
(2, vec![param(ccx, 0), param(ccx, 0)], param(ccx, 1))
53465346
}
5347+
"simd_insert" => (2, vec![param(ccx, 0), tcx.types.u32, param(ccx, 1)], param(ccx, 0)),
5348+
"simd_extract" => (2, vec![param(ccx, 0), tcx.types.u32], param(ccx, 1)),
53475349
name if name.starts_with("simd_shuffle") => {
53485350
match name["simd_shuffle".len()..].parse() {
53495351
Ok(n) => {

0 commit comments

Comments
 (0)