/* set the type to the spilling symbol */
sloc->type = copyLinkChain (sym->type);
sloc->etype = getSpec (sloc->type);
- SPEC_SCLS (sloc->etype) = options.model ? S_XDATA : S_DATA;
+ if (options.model == MODEL_SMALL) {
+ SPEC_SCLS (sloc->etype) = S_DATA;
+ } else {
+ SPEC_SCLS (sloc->etype) = S_XDATA;
+ }
SPEC_EXTR (sloc->etype) = 0;
/* we don't allow it to be allocated`
LIVE ranges */
if (!ds390_ptrRegReq && isSpiltOnStack (sym))
{
- ds390_ptrRegReq++;
+ ds390_ptrRegReq += !options.stack10bit;
spillLRWithPtrReg (sym);
}
/* if spilt on stack then free up r0 & r1
if they could have been assigned to as gprs */
- if (!ds390_ptrRegReq && isSpiltOnStack (ssym))
+ if (!ds390_ptrRegReq && isSpiltOnStack (ssym) && !options.stack10bit)
{
- ds390_ptrRegReq++;
+ ds390_ptrRegReq++;
spillLRWithPtrReg (ssym);
}
(ic = hTabItemWithKey (iCodehTab,
bitVectFirstBit (sym->defs))) &&
POINTER_GET (ic) &&
+ !sym->noSpilLoc &&
!IS_BITVAR (sym->etype))
{
/* or in stack space in case of + & - */
/* if assigned to a non-symbol then return
- true */
+ FALSE */
if (!IS_SYMOP (IC_RIGHT (dic)))
- break;
+ return NULL;
/* if the symbol is in far space then
we should not */
/* only upto 2 bytes since we cannot predict
the usage of b, & acc */
- if (getSize (operandType (op)) > (fReturnSizeDS390 - 2) &&
- ic->op != RETURN &&
+ if (getSize (operandType (op)) > (fReturnSizeDS390 - 2))
+ return 0;
+
+ if (ic->op != RETURN &&
ic->op != SEND &&
!POINTER_SET (ic) &&
!POINTER_GET (ic))
return NULL;
-
+
/* this routine will mark the a symbol as used in one
instruction use only && if the defintion is local
(ie. within the basic block) && has only one definition &&
/* if we are using a symbol on the stack
then we should say ds390_ptrRegReq */
if (ic->op == IFX && IS_SYMOP (IC_COND (ic)))
- ds390_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack ||
- OP_SYMBOL (IC_COND (ic))->iaccess) ? 1 : 0);
+ ds390_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack ? !options.stack10bit : 0) +
+ OP_SYMBOL (IC_COND (ic))->iaccess);
else if (ic->op == JUMPTABLE && IS_SYMOP (IC_JTCOND (ic)))
- ds390_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack ||
- OP_SYMBOL (IC_JTCOND (ic))->iaccess) ? 1 : 0);
+ ds390_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack ? !options.stack10bit : 0) +
+ OP_SYMBOL (IC_JTCOND (ic))->iaccess);
else
{
if (IS_SYMOP (IC_LEFT (ic)))
- ds390_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack ||
- OP_SYMBOL (IC_LEFT (ic))->iaccess) ? 1 : 0);
+ ds390_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack ? !options.stack10bit : 0) +
+ OP_SYMBOL (IC_LEFT (ic))->iaccess);
if (IS_SYMOP (IC_RIGHT (ic)))
- ds390_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack ||
- OP_SYMBOL (IC_RIGHT (ic))->iaccess) ? 1 : 0);
+ ds390_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack ? !options.stack10bit : 0) +
+ OP_SYMBOL (IC_RIGHT (ic))->iaccess);
if (IS_SYMOP (IC_RESULT (ic)))
- ds390_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack ||
- OP_SYMBOL (IC_RESULT (ic))->iaccess) ? 1 : 0);
+ ds390_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack ? !options.stack10bit : 0) +
+ OP_SYMBOL (IC_RESULT (ic))->iaccess);
}
}
we can leave the result of this operation in acc:b
combination */
if ((IS_ARITHMETIC_OP (ic)
-
+ || IS_CONDITIONAL(ic)
|| IS_BITWISE_OP (ic)
-
|| ic->op == LEFT_OP || ic->op == RIGHT_OP
-
+ || (ic->op == ADDRESS_OF && isOperandOnStack (IC_LEFT (ic)))
) &&
IS_ITEMP (IC_RESULT (ic)) &&
getSize (operandType (IC_RESULT (ic))) <= 2)
setToNull ((void *) &_G.funcrUsed);
ds390_ptrRegReq = _G.stackExtend = _G.dataExtend = 0;
ds390_nRegs = 8;
-
+ if (options.model != MODEL_FLAT24) options.stack10bit = 0;
/* change assignments this will remove some
live ranges reducing some register pressure */
for (i = 0; i < count; i++)