Skip to content

Commit 304e1a1

Browse files
committed
---
yaml --- r: 60050 b: refs/heads/master c: 8e0c6fa h: refs/heads/master v: v3
1 parent 203faee commit 304e1a1

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
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: 38a6a7a394fa55235ff0b3cab4d0903d7ba5a5a3
2+
refs/heads/master: 8e0c6fa5b693e90498045e582a5f66f6a78d67d0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589

trunk/src/librustc/middle/trans/build.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -963,20 +963,28 @@ pub fn ExtractElement(cx: block, VecVal: ValueRef, Index: ValueRef) ->
963963
}
964964
965965
pub fn InsertElement(cx: block, VecVal: ValueRef, EltVal: ValueRef,
966-
Index: ValueRef) {
966+
Index: ValueRef) -> ValueRef {
967967
unsafe {
968-
if cx.unreachable { return; }
968+
if cx.unreachable { return llvm::LLVMGetUndef(T_nil()); }
969969
count_insn(cx, "insertelement");
970-
llvm::LLVMBuildInsertElement(B(cx), VecVal, EltVal, Index, noname());
970+
llvm::LLVMBuildInsertElement(B(cx), VecVal, EltVal, Index, noname())
971971
}
972972
}
973973
974974
pub fn ShuffleVector(cx: block, V1: ValueRef, V2: ValueRef,
975-
Mask: ValueRef) {
975+
Mask: ValueRef) -> ValueRef {
976976
unsafe {
977-
if cx.unreachable { return; }
977+
if cx.unreachable { return llvm::LLVMGetUndef(T_nil()); }
978978
count_insn(cx, "shufflevector");
979-
llvm::LLVMBuildShuffleVector(B(cx), V1, V2, Mask, noname());
979+
llvm::LLVMBuildShuffleVector(B(cx), V1, V2, Mask, noname())
980+
}
981+
}
982+
983+
pub fn VectorSplat(cx: block, NumElts: uint, EltVal: ValueRef) -> ValueRef {
984+
unsafe {
985+
let Undef = llvm::LLVMGetUndef(T_vector(val_ty(EltVal), NumElts));
986+
let VecVal = InsertElement(cx, Undef, EltVal, C_i32(0));
987+
ShuffleVector(cx, VecVal, Undef, C_null(T_vector(T_i32(), NumElts)))
980988
}
981989
}
982990

trunk/src/librustc/middle/trans/common.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,12 @@ pub fn T_array(t: TypeRef, n: uint) -> TypeRef {
984984
}
985985
}
986986

987+
pub fn T_vector(t: TypeRef, n: uint) -> TypeRef {
988+
unsafe {
989+
return llvm::LLVMVectorType(t, n as c_uint);
990+
}
991+
}
992+
987993
// Interior vector.
988994
pub fn T_vec2(targ_cfg: @session::config, t: TypeRef) -> TypeRef {
989995
return T_struct(~[T_int(targ_cfg), // fill

trunk/src/libstd/ebml.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ pub mod reader {
379379
fn read_int(&mut self) -> int {
380380
let v = doc_as_u64(self.next_doc(EsInt)) as i64;
381381
if v > (int::max_value as i64) || v < (int::min_value as i64) {
382-
debug!("FIXME #6122: Removing this makes this function miscompile");
383382
fail!(fmt!("int %? out of range for this architecture", v));
384383
}
385384
v as int

0 commit comments

Comments
 (0)