- operand *left, *right, *result;
-
- aopOp((left=IC_LEFT(ic)),ic,FALSE, FALSE);
- aopOp((right=IC_RIGHT(ic)),ic,FALSE, FALSE);
- aopOp((result=IC_RESULT(ic)),ic,TRUE, FALSE);
-
- /* Swap operands if it makes the operation easier. ie if:
- 1. Left is a literal.
- */
- if (AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) {
- operand *t = IC_RIGHT(ic);
- IC_RIGHT(ic) = IC_LEFT(ic);
- IC_LEFT(ic) = t;
- }
-
- if (ifx && !AOP_SIZE(result)){
- symbol *tlbl;
- /* if they are both bit variables */
- if (AOP_TYPE(left) == AOP_CRY &&
- ((AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(right) == AOP_LIT))) {
- wassert(0);
- } else {
- tlbl = newiTempLabel(NULL);
- gencjneshort(left, right, tlbl);
- if ( IC_TRUE(ifx) ) {
- emit2("jp !tlabel", IC_TRUE(ifx)->key+100);
- emitLabel(tlbl->key+100);
- } else {
- /* PENDING: do this better */
- symbol *lbl = newiTempLabel(NULL);
- emit2("!shortjp !tlabel", lbl->key+100);
- emitLabel(tlbl->key+100);
- emit2("jp !tlabel", IC_FALSE(ifx)->key+100);
- emitLabel(lbl->key+100);
- }
- }
- /* mark the icode as generated */
- ifx->generated = 1;
- goto release ;
- }
-
- /* if they are both bit variables */
- if (AOP_TYPE(left) == AOP_CRY &&
- ((AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(right) == AOP_LIT))) {
- wassert(0);
- } else {
- gencjne(left,right,newiTempLabel(NULL));
- if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) {
- wassert(0);
- }
- if (ifx) {
- genIfxJump(ifx,"a");
- goto release;
- }
- /* if the result is used in an arithmetic operation
- then put the result in place */
- if (AOP_TYPE(result) != AOP_CRY) {
- outAcc(result);
+ operand *left, *right, *result;
+
+ aopOp ((left = IC_LEFT (ic)), ic, FALSE, FALSE);
+ aopOp ((right = IC_RIGHT (ic)), ic, FALSE, FALSE);
+ aopOp ((result = IC_RESULT (ic)), ic, TRUE, FALSE);
+
+ emit2("; genCmpEq: left %u, right %u, result %u\n", AOP_SIZE(IC_LEFT(ic)), AOP_SIZE(IC_RIGHT(ic)), AOP_SIZE(IC_RESULT(ic)));
+
+ /* Swap operands if it makes the operation easier. ie if:
+ 1. Left is a literal.
+ */
+ if (AOP_TYPE (IC_LEFT (ic)) == AOP_LIT)
+ {
+ operand *t = IC_RIGHT (ic);
+ IC_RIGHT (ic) = IC_LEFT (ic);
+ IC_LEFT (ic) = t;
+ }
+
+ if (ifx && !AOP_SIZE (result))
+ {
+ symbol *tlbl;
+ /* if they are both bit variables */
+ if (AOP_TYPE (left) == AOP_CRY &&
+ ((AOP_TYPE (right) == AOP_CRY) || (AOP_TYPE (right) == AOP_LIT)))
+ {
+ wassert (0);