From e2bc0ad3960769ba7a0f1223ac160b0d985fff35 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 27 Apr 2019 18:27:21 -0700 Subject: amd64: Use unordered compare for floating points This prevents an FE_INVALID exception when comparing with NaN. --- amd64/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amd64/emit.c b/amd64/emit.c index 91223bd..d4bd54c 100644 --- a/amd64/emit.c +++ b/amd64/emit.c @@ -110,8 +110,8 @@ static struct { { Osign, Kw, "cltd" }, { Oxdiv, Ki, "div%k %0" }, { Oxidiv, Ki, "idiv%k %0" }, - { Oxcmp, Ks, "comiss %S0, %S1" }, - { Oxcmp, Kd, "comisd %D0, %D1" }, + { Oxcmp, Ks, "ucomiss %S0, %S1" }, + { Oxcmp, Kd, "ucomisd %D0, %D1" }, { Oxcmp, Ki, "cmp%k %0, %1" }, { Oxtest, Ki, "test%k %0, %1" }, #define X(c, s) \ -- cgit 1.4.1