return (cond.test == Pct_TRUE) ? "cr7.gt=1" : "cr7.gt=0";
case Pcf_7LT:
return (cond.test == Pct_TRUE) ? "cr7.lt=1" : "cr7.lt=0";
+ case Pcf_NONE:
+ return "no-flag";
default: vpanic("ppPPCCondCode");
}
}
PPCCondCode cc;
cc.flag = flag;
cc.test = test;
+ if (test == Pct_ALWAYS) {
+ vassert(flag == Pcf_NONE);
+ } else {
+ vassert(flag != Pcf_NONE);
+ }
return cc;
}
// Just load 1 to dst => li dst,1
p = mkFormD(p, 14, r_dst, 0, 1);
} else {
+ vassert(cond.flag != Pcf_NONE);
rot_imm = 1 + cond.flag;
r_tmp = 0; // Not set in getAllocable, so no need to declare.
Pcf_7LT = 28, /* neg | lt */
Pcf_7GT = 29, /* pos | gt */
Pcf_7EQ = 30, /* zero | equal */
- Pcf_7SO = 31 /* summary overflow */
+ Pcf_7SO = 31, /* summary overflow */
+ Pcf_NONE = 32 /* no condition; used with Pct_ALWAYS */
}
PPCCondFlag;
typedef
enum { /* Maps bc bitfield BO */
- Pct_FALSE = 0x4,
- Pct_TRUE = 0xC,
- Pct_ALWAYS = 0x14
+ Pct_FALSE = 0x4, /* associated PPCCondFlag must not be Pcf_NONE */
+ Pct_TRUE = 0xC, /* associated PPCCondFlag must not be Pcf_NONE */
+ Pct_ALWAYS = 0x14 /* associated PPCCondFlag must be Pcf_NONE */
}
PPCCondTest;
}
/* Fast scheme only applies for unconditional calls. Hence: */
- cc.test = Pct_ALWAYS;
+ cc = mk_PPCCondCode( Pct_ALWAYS, Pcf_NONE );
} else {
because the argument computations could trash the condition
codes. Be a bit clever to handle the common case where the
guard is 1:Bit. */
- cc.test = Pct_ALWAYS;
+ cc = mk_PPCCondCode( Pct_ALWAYS, Pcf_NONE );
if (guard) {
if (guard->tag == Iex_Const
&& guard->Iex.Const.con->tag == Ico_U1