Add shl and shr missing casts
This commit is contained in:
parent
684a69b4e6
commit
30ee7ba862
@ -613,7 +613,7 @@ pub fn generate_local_symbol_name(&self, prefix: &str) -> String {
|
||||
// user defined names
|
||||
let mut name = String::with_capacity(prefix.len() + 6);
|
||||
name.push_str(prefix);
|
||||
name.push_str(".");
|
||||
name.push('.');
|
||||
name.push_str(&(idx as u64).to_base(ALPHANUMERIC_ONLY));
|
||||
name
|
||||
}
|
||||
|
24
src/int.rs
24
src/int.rs
@ -83,7 +83,17 @@ pub fn gcc_lshr(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
|
||||
let b = self.context.new_cast(self.location, b, a_type);
|
||||
a >> b
|
||||
} 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() {
|
||||
a >> b
|
||||
@ -635,7 +645,17 @@ pub fn gcc_shl(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
|
||||
let b = self.context.new_cast(self.location, b, a_type);
|
||||
a << b
|
||||
} 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() {
|
||||
a << b
|
||||
|
Loading…
Reference in New Issue
Block a user