From e91d12158122b23271ff49de8977c92fef7f3908 Mon Sep 17 00:00:00 2001 From: Eyal Sawady Date: Mon, 17 Jan 2022 22:00:48 +0000 Subject: Add a negation instruction Necessary for floating-point negation, because `%result = sub 0, %operand` doesn't give the correct sign for 0/-0. --- arm64/emit.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arm64') diff --git a/arm64/emit.c b/arm64/emit.c index bd0ebdc..de1859b 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -43,6 +43,8 @@ static struct { { Oadd, Ka, "fadd %=, %0, %1" }, { Osub, Ki, "sub %=, %0, %1" }, { Osub, Ka, "fsub %=, %0, %1" }, + { Oneg, Ki, "neg %=, %0" }, + { Oneg, Ka, "fneg %=, %0" }, { Oand, Ki, "and %=, %0, %1" }, { Oor, Ki, "orr %=, %0, %1" }, { Oxor, Ki, "eor %=, %0, %1" }, -- cgit 1.4.1