Legalize bnot using xor with -1.

This commit is contained in:
Dan Gohman
2018-05-05 11:01:49 -05:00
parent bb612af37a
commit 5b69930e03
2 changed files with 10 additions and 1 deletions

View File

@@ -252,6 +252,14 @@ for inst_not, inst in [
a << inst(x, a1)
))
# Expand bnot using xor.
expand.legalize(
a << bnot(x),
Rtl(
y << iconst(imm64(-1)),
a << bxor(x, y)
))
# Floating-point sign manipulations.
for ty, minus_zero in [
(types.f32, f32const(ieee32.bits(0x80000000))),