Commit 7dc7d79b authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Clarify the carry testing magic.

[r27516]
parent 789276c5
......@@ -32,9 +32,12 @@
#include "irnode_t.h"
enum {
ia32_pn_Cmp_unsigned = 0x1000,
ia32_pn_Cmp_float = 0x2000,
ia32_pn_Cmp_parity = 0x4000
ia32_pn_Cmp_unsigned = 0x1000,
ia32_pn_Cmp_float = 0x2000,
ia32_pn_Cmp_parity = 0x4000,
/* The unsigned Lt/Ge comparisons test the carry bit. */
ia32_pn_Cmp_carry = pn_Cmp_Lt | ia32_pn_Cmp_unsigned
ia32_pn_Cmp_not_carry = pn_Cmp_Ge | ia32_pn_Cmp_unsigned,
};
typedef enum {
......
......@@ -265,8 +265,8 @@ static void peephole_ia32_Test(ir_node *node)
int pnc = get_ia32_condcode(user);
switch (pnc) {
case pn_Cmp_Eq: pnc = pn_Cmp_Ge | ia32_pn_Cmp_unsigned; break;
case pn_Cmp_Lg: pnc = pn_Cmp_Lt | ia32_pn_Cmp_unsigned; break;
case pn_Cmp_Eq: pnc = ia32_pn_Cmp_no_carry; break;
case pn_Cmp_Lg: pnc = ia32_pn_Cmp_carry; break;
default: panic("unexpected pn");
}
set_ia32_condcode(user, pnc);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment