return FALSE;
}
+/*-----------------------------------------------------------------*/
+/* isOclsExpensive - will return true if accesses to an output */
+/* storage class are expensive */
+/*-----------------------------------------------------------------*/
+bool
+isOclsExpensive (struct memmap *oclass)
+{
+ if (port->oclsExpense)
+ return port->oclsExpense (oclass) > 0;
+
+ /* In the absence of port specific guidance, assume only */
+ /* farspace is expensive. */
+ return IN_FARSPACE (oclass);
+}
+
/*-----------------------------------------------------------------*/
/* operandLitValue - literal value of an operand */
/*-----------------------------------------------------------------*/
register equivalent for a local symbol */
if (sym->level && sym->etype && SPEC_OCLS (sym->etype) &&
(IN_FARSPACE (SPEC_OCLS (sym->etype)) &&
+ !TARGET_IS_HC08 &&
(!(options.model == MODEL_FLAT24)) ) &&
options.stackAuto == 0)
ok = 0;
/* if this is not a temp symbol then */
if (!IS_ITEMP (op) &&
!force &&
- !IN_FARSPACE (SPEC_OCLS (etype)))
+ !(IN_FARSPACE (SPEC_OCLS (etype)) && !TARGET_IS_HC08))
{
op = operandFromOperand (op);
op->isaddr = 0;
if (IS_SPEC (type) &&
IS_TRUE_SYMOP (op) &&
- (!IN_FARSPACE (SPEC_OCLS (etype)) ||
+ (!(IN_FARSPACE (SPEC_OCLS (etype)) && !TARGET_IS_HC08) ||
(options.model == MODEL_FLAT24) ))
{
op = operandFromOperand (op);
if (IS_VOID(ltype->next) || IS_VOID(rtype->next)) {
return result;
}
-
+
// should we really do this? is this ANSI?
return geniCodeDivision (result,
operandFromLit (getSize (ltype->next)));
{
left = geniCodeRValue (left, FALSE);
}
+
return geniCodeDerefPtr (geniCodeAdd (left, right, lvl), lvl);
}
IC_RESULT (ic)->isaddr = (!IS_AGGREGATE (ltype->next));
ADDTOCHAIN (ic);
-
+
return IC_RESULT (ic);
}
sym_link *optype = operandType (op);
sym_link *opetype = getSpec (optype);
+ if (IS_ITEMP (op) && op->isaddr && IS_PTR (optype))
+ {
+ op = operandFromOperand (op);
+ op->isaddr = 0;
+ return op;
+ }
+
/* lvalue check already done in decorateType */
/* this must be a lvalue */
/* if (!op->isaddr && !IS_AGGREGATE(optype)) { */
else if (compareType (ltype, rtype) < 0)
right = geniCodeCast (ltype, right, TRUE);
- /* if left is a true symbol & ! volatile
+ /* If left is a true symbol & ! volatile
create an assignment to temporary for
the right & then assign this temporary
- to the symbol this is SSA . isn't it simple
- and folks have published mountains of paper on it */
+ to the symbol. This is SSA (static single
+ assignment). Isn't it simple and folks have
+ published mountains of paper on it */
if (IS_TRUE_SYMOP (left) &&
!isOperandVolatile (left, FALSE) &&
isOperandGlobal (left))
if (!sym->addrtaken && !IS_VOLATILE (sym->etype))
{
- if (IN_FARSPACE (SPEC_OCLS (sym->etype)) &&
+ if ((IN_FARSPACE (SPEC_OCLS (sym->etype)) && !TARGET_IS_HC08) &&
options.stackAuto == 0 &&
(!(options.model == MODEL_FLAT24)) )
{
return geniCodeDerefPtr (geniCodeRValue (left, FALSE),lvl);
case '-':
- if (right)
+ if (right)
return geniCodeSubtract (geniCodeRValue (left, FALSE),
geniCodeRValue (right, FALSE));
else
case '~':
case RRC:
case RLC:
+ case SWAP:
return geniCodeUnary (geniCodeRValue (left, FALSE), tree->opval.op);
case '!':