summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-27 18:27:21 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2019-04-29 11:03:39 +0200
commite2bc0ad3960769ba7a0f1223ac160b0d985fff35 (patch)
treec654d9ee6c37e95e9eccc34fb803f2ef658a9582
parent3a6cc4d0c0820319fc75cdde463eaf35d1731f4c (diff)
downloadroux-e2bc0ad3960769ba7a0f1223ac160b0d985fff35.tar.gz
amd64: Use unordered compare for floating points
This prevents an FE_INVALID exception when comparing with NaN.
-rw-r--r--amd64/emit.c4
1 files 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) \