mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
gen-dev: impl Num.neg for Dec,F32,F64
Dec negation was implemented across gen-dev, gen-llvm, gen-wasm as a call to the compiled zig function `bitcode::DEC_NEGATE`. f32 and f64 negation were implemented already for gen-llvm, gen-wasm. for gen-dev x86_64, float negation is implemented by flipping the sign bit, which means `xorps` for f32, and `xorpd` for f64 for gen-dev aarch64, there is conveniently a `fneg` instruction
This commit is contained in:
parent
6a3db1e59a
commit
a98acff0b9
6 changed files with 156 additions and 2 deletions
|
@ -2215,6 +2215,7 @@ fn build_dec_unary_op<'a, 'ctx>(
|
|||
|
||||
match op {
|
||||
NumAbs => dec_unary_op(env, bitcode::DEC_ABS, arg),
|
||||
NumNeg => dec_unary_op(env, bitcode::DEC_NEGATE, arg),
|
||||
NumAcos => dec_unary_op(env, bitcode::DEC_ACOS, arg),
|
||||
NumAsin => dec_unary_op(env, bitcode::DEC_ASIN, arg),
|
||||
NumAtan => dec_unary_op(env, bitcode::DEC_ATAN, arg),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue