- if(IS_FLOAT(operandType( IC_RIGHT( ic ) ))) {
+ if (IS_SYMOP (left))
+ bitVectUnSetBit (OP_USES (left), ic->key);
+ if (IS_SYMOP (right))
+ bitVectUnSetBit (OP_USES (right), ic->key);
+
+ if (IS_FLOAT (operandType (right))) {
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type)->next);
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type)->next);
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(right));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(right));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(left));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(left));
}
addiCodeToeBBlock (ebp, newic, ip);
}
/* insert the call */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
}
/* insert the call */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
- SPEC_EXTR(func->etype) = 1;
- seg = SPEC_OCLS( func->etype );
- addSet(&seg->syms, func);
+ SPEC_EXTR(func->etype) = 1;
+ seg = SPEC_OCLS( func->etype );
+ addSet(&seg->syms, func);
{
newic = newiCode (SEND, IC_RIGHT (ic), NULL);
newic->argreg = SPEC_ARGREG(FUNC_ARGS(func->type)->etype);
{
newic = newiCode (SEND, IC_RIGHT (ic), NULL);
newic->argreg = SPEC_ARGREG(FUNC_ARGS(func->type)->etype);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
- /* normally these functions aren't marked external, so we can use their
- * _extern field to marked as already added to symbol table */
-
- if(!SPEC_EXTR(func->etype)) {
- memmap *seg = SPEC_OCLS(OP_SYMBOL(IC_LEFT(newic))->etype);
-
- SPEC_EXTR(func->etype) = 1;
- seg = SPEC_OCLS( func->etype );
- addSet(&seg->syms, func);
- }
+ /* normally these functions aren't marked external, so we can use their
+ * _extern field to marked as already added to symbol table */
+
+ if(!SPEC_EXTR(func->etype)) {
+ memmap *seg = SPEC_OCLS(OP_SYMBOL(IC_LEFT(newic))->etype);
+
+ SPEC_EXTR(func->etype) = 1;
+ seg = SPEC_OCLS( func->etype );
+ addSet(&seg->syms, func);
+ }
newic->lineno = linenno;
}
/*----------------------------------------------------------------------*/
/* cnvToFixed16x16Cast - converts casts to fixed16x16 to function calls */
/*----------------------------------------------------------------------*/
newic->lineno = linenno;
}
/*----------------------------------------------------------------------*/
/* cnvToFixed16x16Cast - converts casts to fixed16x16 to function calls */
/*----------------------------------------------------------------------*/
- {
- if (compareType (type, __multypes[bwd][su]) == 1)
- {
- func = __fp16x16conv[0][bwd][su];
- goto found;
- }
- }
+ {
+ if (compareType (type, __multypes[bwd][su]) == 1)
+ {
+ func = __fp16x16conv[0][bwd][su];
+ goto found;
+ }
+ }
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
newic->lineno = lineno;
}
/*--------------------------------------------------------------------------*/
/* cnvFromFixed16x16Cast - converts casts from fixed16x16 to function calls */
/*--------------------------------------------------------------------------*/
newic->lineno = lineno;
}
/*--------------------------------------------------------------------------*/
/* cnvFromFixed16x16Cast - converts casts from fixed16x16 to function calls */
/*--------------------------------------------------------------------------*/
cnvFromFixed16x16Cast (iCode * ic, eBBlock * ebp)
{
iCode *ip, *newic;
symbol *func = NULL;
sym_link *type = operandType (IC_LEFT (ic));
cnvFromFixed16x16Cast (iCode * ic, eBBlock * ebp)
{
iCode *ip, *newic;
symbol *func = NULL;
sym_link *type = operandType (IC_LEFT (ic));
if (compareType (type, floatType) == 1)
{
func = __fp16x16conv[1][3][0];
goto found;
}
if (compareType (type, floatType) == 1)
{
func = __fp16x16conv[1][3][0];
goto found;
}
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
- /* normally these functions aren't marked external, so we can use their
- * _extern field to marked as already added to symbol table */
-
- if(!SPEC_EXTR(func->etype)) {
- memmap *seg = SPEC_OCLS(OP_SYMBOL(IC_LEFT(newic))->etype);
-
- SPEC_EXTR(func->etype) = 1;
- seg = SPEC_OCLS( func->etype );
- addSet(&seg->syms, func);
- }
+ /* normally these functions aren't marked external, so we can use their
+ * _extern field to marked as already added to symbol table */
+
+ if(!SPEC_EXTR(func->etype)) {
+ memmap *seg = SPEC_OCLS(OP_SYMBOL(IC_LEFT(newic))->etype);
+
+ SPEC_EXTR(func->etype) = 1;
+ seg = SPEC_OCLS( func->etype );
+ addSet(&seg->syms, func);
+ }
/* convilong - converts int or long mults or divs to fcalls */
/*-----------------------------------------------------------------*/
static void
/* convilong - converts int or long mults or divs to fcalls */
/*-----------------------------------------------------------------*/
static void
+ if (getSize (leftType) == 1 && getSize (rightType) == 1)
+ {
+ int muldivmod;
+
+ if (op == '*')
+ muldivmod = 0;
+ else if (op == '/')
+ muldivmod = 1;
+ else if (op == '%')
+ muldivmod = 2;
+ else
+ muldivmod = -1;
+
+ for (su = 0; su < 4 && muldivmod >= 0; su++)
+ {
+ if ((compareType (leftType, __multypes[0][su%2]) == 1) &&
+ (compareType (rightType, __multypes[0][su/2]) == 1))
+ {
+ func = __muldiv[muldivmod][0][su];
+ goto found;
+ }
+ }
+ }
+
/* depending on the type */
for (bwd = 0; bwd < 3; bwd++)
{
for (su = 0; su < 2; su++)
{
/* depending on the type */
for (bwd = 0; bwd < 3; bwd++)
{
for (su = 0; su < 2; su++)
{
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type));
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type)->next);
}
addiCodeToeBBlock (ebp, newic, ip);
IC_RESULT (newic) = operandFromValue (FUNC_ARGS(func->type)->next);
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_RIGHT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_LEFT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
bytesPushed += getSize(operandType(IC_LEFT(ic)));
}
addiCodeToeBBlock (ebp, newic, ip);
/* for the result */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
/* for the result */
newic = newiCode (CALL, operandFromSymbol (func), NULL);
IC_RESULT (newic) = IC_RESULT (ic);
converted to function calls */
if ((IS_CONDITIONAL (ic) ||
IS_ARITHMETIC_OP (ic)) &&
converted to function calls */
if ((IS_CONDITIONAL (ic) ||
IS_ARITHMETIC_OP (ic)) &&
cnvFromFloatCast (ic, ebbs[i]);
else if (IS_FLOAT (operandType (IC_LEFT (ic))))
cnvToFloatCast (ic, ebbs[i]);
cnvFromFloatCast (ic, ebbs[i]);
else if (IS_FLOAT (operandType (IC_LEFT (ic))))
cnvToFloatCast (ic, ebbs[i]);
- if (IS_FIXED16X16 (operandType (IC_RIGHT (ic))))
- cnvFromFixed16x16Cast (ic, ebbs[i]);
- else if (IS_FIXED16X16 (operandType (IC_LEFT (ic))))
- cnvToFixed16x16Cast (ic, ebbs[i]);
+ if (IS_FIXED16X16 (operandType (IC_RIGHT (ic))))
+ cnvFromFixed16x16Cast (ic, ebbs[i]);
+ else if (IS_FIXED16X16 (operandType (IC_LEFT (ic))))
+ cnvToFixed16x16Cast (ic, ebbs[i]);
if (bp->ech->op != RETURN) {
werrorfl (bp->ech->filename, bp->ech->lineno,
W_VOID_FUNC, currFunc->name);
if (bp->ech->op != RETURN) {
werrorfl (bp->ech->filename, bp->ech->lineno,
W_VOID_FUNC, currFunc->name);
/* convert operations with support routines
written in C to function calls : I am doing
this at this point since I want all the
/* convert operations with support routines
written in C to function calls : I am doing
this at this point since I want all the
convertToFcall (ebbi->bbOrder, ebbi->count);
/* compute the live ranges */
convertToFcall (ebbi->bbOrder, ebbi->count);
/* compute the live ranges */