Add shl and shr missing casts
This commit is contained in:
parent
684a69b4e6
commit
30ee7ba862
@ -613,7 +613,7 @@ impl<'b, 'tcx> CodegenCx<'b, 'tcx> {
|
|||||||
// user defined names
|
// user defined names
|
||||||
let mut name = String::with_capacity(prefix.len() + 6);
|
let mut name = String::with_capacity(prefix.len() + 6);
|
||||||
name.push_str(prefix);
|
name.push_str(prefix);
|
||||||
name.push_str(".");
|
name.push('.');
|
||||||
name.push_str(&(idx as u64).to_base(ALPHANUMERIC_ONLY));
|
name.push_str(&(idx as u64).to_base(ALPHANUMERIC_ONLY));
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
|
24
src/int.rs
24
src/int.rs
@ -83,7 +83,17 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
|
|||||||
let b = self.context.new_cast(self.location, b, a_type);
|
let b = self.context.new_cast(self.location, b, a_type);
|
||||||
a >> b
|
a >> b
|
||||||
} else {
|
} else {
|
||||||
a >> b
|
let a_size = a_type.get_size();
|
||||||
|
let b_size = b_type.get_size();
|
||||||
|
if a_size > b_size {
|
||||||
|
let b = self.context.new_cast(self.location, b, a_type);
|
||||||
|
a >> b
|
||||||
|
} else if a_size < b_size {
|
||||||
|
let a = self.context.new_cast(self.location, a, b_type);
|
||||||
|
a >> b
|
||||||
|
} else {
|
||||||
|
a >> b
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if a_type.is_vector() && a_type.is_vector() {
|
} else if a_type.is_vector() && a_type.is_vector() {
|
||||||
a >> b
|
a >> b
|
||||||
@ -635,7 +645,17 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
|
|||||||
let b = self.context.new_cast(self.location, b, a_type);
|
let b = self.context.new_cast(self.location, b, a_type);
|
||||||
a << b
|
a << b
|
||||||
} else {
|
} else {
|
||||||
a << b
|
let a_size = a_type.get_size();
|
||||||
|
let b_size = b_type.get_size();
|
||||||
|
if a_size > b_size {
|
||||||
|
let b = self.context.new_cast(self.location, b, a_type);
|
||||||
|
a << b
|
||||||
|
} else if a_size < b_size {
|
||||||
|
let a = self.context.new_cast(self.location, a, b_type);
|
||||||
|
a << b
|
||||||
|
} else {
|
||||||
|
a << b
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if a_type.is_vector() && a_type.is_vector() {
|
} else if a_type.is_vector() && a_type.is_vector() {
|
||||||
a << b
|
a << b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user