summary refs log tree commit diff
path: root/test/mem2.ssa
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-08-17 13:14:54 -0700
committerQuentin Carbonneaux <quentin@c9x.me>2021-08-27 10:45:13 +0200
commit804921a3ab463848aa0ffbe495ca542b3789c841 (patch)
tree17419e724fe59ab12eb16c3404d211ceb523b89c /test/mem2.ssa
parent3cbad4d9c465d3f298cbe19c46f7c16f6a9b9f0f (diff)
downloadroux-804921a3ab463848aa0ffbe495ca542b3789c841.tar.gz
amd64/isel: fix floating < and <= result with NaN
When the two operands are Unordered (for instance if one of them
is NaN), ucomisd sets ZF=1, PF=1, and CF=1. When the result is
LessThan, it sets ZF=0, PF=0, and CF=1.

However, jb[e]/setb[e] only checks that CF=1 [or ZF=1] which causes
the result to be true for unordered operands.

To fix this, change the operand swap condition for these two floating
point comparison types: always rewrite x < y as y > x, and never
rewrite x > y as y < x.

Add a test to check the result of cltd, cled, cgtd, cged, ceqd, and
cned with arguments that are LessThan, Equal, GreaterThan, and
Unordered. Additionally, check three different implementations for
equality testing: one that uses the result of ceqd directly, one
that uses the result to control a conditional jump, and one that
uses the result both as a value and for a conditional jump. For
now, unordered equality tests are still broken so they are disabled.
Diffstat (limited to 'test/mem2.ssa')
0 files changed, 0 insertions, 0 deletions