Skip to content

Commit

Permalink
Fix vector compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Nov 2, 2023
1 parent 09ce29d commit 9dacc8f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
a >> b
}
}
else if a_type.is_vector() && a_type.is_vector() {
a << b
}
else if a_native && !b_native {
self.gcc_lshr(a, self.gcc_int_cast(b, a_type))
}
Expand Down Expand Up @@ -496,7 +499,11 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
pub fn gcc_xor(&self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
let a_type = a.get_type();
let b_type = b.get_type();
if self.is_native_int_type_or_bool(a_type) && self.is_native_int_type_or_bool(b_type) {
if a_type.is_vector() && b_type.is_vector() {
let b = self.bitcast_if_needed(b, a_type);
a ^ b
}
else if self.is_native_int_type_or_bool(a_type) && self.is_native_int_type_or_bool(b_type) {
a ^ b
}
else {
Expand Down Expand Up @@ -527,6 +534,9 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
a << b
}
}
else if a_type.is_vector() && a_type.is_vector() {
a << b
}
else if a_native && !b_native {
self.gcc_shl(a, self.gcc_int_cast(b, a_type))
}
Expand Down Expand Up @@ -690,6 +700,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
let a_native = self.is_native_int_type_or_bool(a_type);
let b_native = self.is_native_int_type_or_bool(b_type);
if a_type.is_vector() && b_type.is_vector() {
let b = self.bitcast_if_needed(b, a_type);
self.context.new_binary_op(None, operation, a_type, a, b)
}
else if a_native && b_native {
Expand Down

0 comments on commit 9dacc8f

Please sign in to comment.