Skip to content

Commit

Permalink
Merge pull request rust-lang#125 from rust-lang/fix/simd-slice
Browse files Browse the repository at this point in the history
Implement simd_neg
  • Loading branch information
antoyo authored Feb 1, 2022
2 parents 41f20fa + 9c3cce6 commit 72d89b0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/intrinsic/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,26 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>,
simd_xor: Uint, Int => xor;
}

macro_rules! arith_unary {
($($name: ident: $($($p: ident),* => $call: ident),*;)*) => {
$(if name == sym::$name {
match in_elem.kind() {
$($(ty::$p(_))|* => {
return Ok(bx.$call(args[0].immediate()))
})*
_ => {},
}
require!(false,
"unsupported operation on `{}` with element `{}`",
in_ty,
in_elem)
})*
}
}

arith_unary! {
simd_neg: Int => neg, Float => fneg;
}

unimplemented!("simd {}", name);
}

0 comments on commit 72d89b0

Please sign in to comment.