Stream: git-wasmtime

Topic: wasmtime / issue #4803 [cranelift][x64] Folding fneg + fabs


view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2022 at 12:28):

MaxGraey edited issue #4803:

fneg(fabs(x)) could be possible after copysign(x, -C) -> fneg(fabs(x)) peephole optimization on LLVM / Binaryen, so I guess it's make sense to simplify it further on cranelift during lowering stage for x64 it will be just single orps xmm, ptr [0x8000000000000000, 0x8000000000000000] (pseudocode) instruction.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2022 at 12:36):

MaxGraey edited issue #4803:

fneg(fabs(x)) could be possible after copysign(x, -C) -> fneg(fabs(x)) peephole optimization on LLVM / Binaryen, so I guess it's make sense to simplify it further on cranelift during lowering stage.

x64:

orpd xmm0, #0x8000000000000000

armv7:

orr r1, r1, #-2147483648

ppc:

fnabs 1,1
blr

s390x:

lndbr   %f0,%f0
br      %r14

the rest is preserve fneg + fabs

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2022 at 12:36):

MaxGraey edited issue #4803:

fneg(fabs(x)) could be possible after copysign(x, -C) -> fneg(fabs(x)) peephole optimization on LLVM / Binaryen, so I guess it's make sense to simplify it further on cranelift during lowering stage.

x64:

orpd xmm0, #0x8000000000000000

armv7:

orr r1, r1, #-2147483648

ppc:

fnabs 1,1
blr

s390x:

lndbr   %f0,%f0
br      %r14

the rest is preserving fneg + fabs

view this post on Zulip Wasmtime GitHub notifications bot (Aug 29 2022 at 12:36):

MaxGraey edited issue #4803:

fneg(fabs(x)) could be possible after copysign(x, -C) -> fneg(fabs(x)) peephole optimization on LLVM / Binaryen, so I guess it's make sense to simplify it further on cranelift during lowering stage.

x64:

orsd xmm0, #0x8000000000000000

armv7:

orr r1, r1, #-2147483648

ppc:

fnabs 1,1
blr

s390x:

lndbr   %f0,%f0
br      %r14

the rest is preserving fneg + fabs


Last updated: Nov 22 2024 at 16:03 UTC