Skip to content

Commit 3a22132

Browse files
committed
fix simd_neg implementation for ints
gcc_not would panic upon encountering a vector type, which is not what we want here. Signed-off-by: Andy Sadler <andrewsadler122@gmail.com>
1 parent 03e11a2 commit 3a22132

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
4848

4949
pub fn gcc_neg(&self, a: RValue<'gcc>) -> RValue<'gcc> {
5050
let a_type = a.get_type();
51-
if self.is_native_int_type(a_type) {
51+
if self.is_native_int_type(a_type) || a_type.is_vector() {
5252
self.cx.context.new_unary_op(None, UnaryOp::Minus, a.get_type(), a)
5353
}
5454
else {

0 commit comments

Comments
 (0)