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>
This commit is contained in:
Andy Sadler 2023-11-09 19:07:44 -06:00
parent 03e11a214e
commit 3a221320eb
No known key found for this signature in database
GPG Key ID: 7A53357CD58173DD

View File

@ -48,7 +48,7 @@ pub fn gcc_not(&self, a: RValue<'gcc>) -> RValue<'gcc> {
pub fn gcc_neg(&self, a: RValue<'gcc>) -> RValue<'gcc> { pub fn gcc_neg(&self, a: RValue<'gcc>) -> RValue<'gcc> {
let a_type = a.get_type(); let a_type = a.get_type();
if self.is_native_int_type(a_type) { if self.is_native_int_type(a_type) || a_type.is_vector() {
self.cx.context.new_unary_op(None, UnaryOp::Minus, a.get_type(), a) self.cx.context.new_unary_op(None, UnaryOp::Minus, a.get_type(), a)
} }
else { else {