#define SCHAR_MIN CHAR_MIN
#define UCHAR_MAX 0xff
#define UCHAR_MIN 0
-#define SHRT_MAX CHAR_MAX
-#define SHRT_MIN CHAR_MIN
-#define USHRT_MAX UCHAR_MAX
-#define USHRT_MIN UCHAR_MIN
#define INT_MIN -32768
#define INT_MAX 32767
+#define SHRT_MAX INT_MAX
+#define SHRT_MIN INT_MIN
#define UINT_MAX 0xffff
#define UINT_MIN 0
+#define USHRT_MAX UINT_MAX
+#define USHRT_MIN UINT_MIN
#define LONG_MIN -2147483648
#define LONG_MAX 2147483647
#define ULONG_MAX 0xffffffff
IFFUNC_ISNAKED(OP_SYM_TYPE(IC_LEFT (ic))))
return;
- /* find the registers in use at this time
- and push them away to safety */
- rsave = bitVectCplAnd (bitVectCopy (ic->rMask),
- ic->rUsed);
+ /* safe the registers in use at this time but skip the
+ ones for the result */
+ rsave = bitVectCplAnd (bitVectCopy (ic->rMask),
+ mcs51_rUmaskForOp (IC_RESULT(ic)));
ic->regsSaved = 1;
if (options.useXstack)
{
int i;
bitVect *rsave;
- /* find the registers in use at this time
- and push them away to safety */
- rsave = bitVectCplAnd (bitVectCopy (ic->rMask),
- ic->rUsed);
+
+ /* restore the registers in use at this time but skip the
+ ones for the result */
+ rsave = bitVectCplAnd (bitVectCopy (ic->rMask),
+ mcs51_rUmaskForOp (IC_RESULT(ic)));
if (options.useXstack)
{
sym_link *dtype;
symbol *rlbl = newiTempLabel (NULL);
-
+ D(emitcode(";", "genPCall"));
/* if caller saves & we have not saved then */
if (!ic->regsSaved)
saveRegisters (ic);
/*-----------------------------------------------------------------*/
/* rUmaskForOp :- returns register mask for an operand */
/*-----------------------------------------------------------------*/
-static bitVect *
-rUmaskForOp (operand * op)
+bitVect *
+mcs51_rUmaskForOp (operand * op)
{
bitVect *rumask;
symbol *sym;
if (ic->op == IFX)
{
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_COND (ic)));
+ mcs51_rUmaskForOp (IC_COND (ic)));
goto ret;
}
if (ic->op == JUMPTABLE)
{
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_JTCOND (ic)));
+ mcs51_rUmaskForOp (IC_JTCOND (ic)));
goto ret;
}
/* of all other cases */
if (IC_LEFT (ic))
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_LEFT (ic)));
+ mcs51_rUmaskForOp (IC_LEFT (ic)));
if (IC_RIGHT (ic))
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_RIGHT (ic)));
+ mcs51_rUmaskForOp (IC_RIGHT (ic)));
if (IC_RESULT (ic))
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_RESULT (ic)));
+ mcs51_rUmaskForOp (IC_RESULT (ic)));
ret:
return rmask;
regs *mcs51_regWithIdx (int);
+bitVect *mcs51_rUmaskForOp (operand * op);
+
#endif