x87_fstp_or_pop(cp->func, writemask, 0, dst); /* flr(a) a 2^flr(a) */
- x87_fsubrp(cp->func, st1); /* frac(a) 2^flr(a) */
+ x87_fsubp(cp->func, st1); /* frac(a) 2^flr(a) */
x87_fst_or_nop(cp->func, writemask, 1, dst); /* frac(a) 2^flr(a) */
/* Load all sources first to avoid aliasing
*/
- for (i = 0; i < 4; i++) {
+ for (i = 3; i >= 0; i--) {
if (writemask & (1<<i)) {
- x87_fld_src(cp, &op->FullSrcRegisters[0], i);
+ x87_fld_src(cp, &op->FullSrcRegisters[0], i);
}
}
/* Load all sources first to avoid aliasing
*/
- for (i = 0; i < 4; i++) {
+ for (i = 3; i >= 0; i--) {
if (writemask & (1<<i)) {
- x87_fld_src(cp, &op->FullSrcRegisters[0], i);
+ x87_fld_src(cp, &op->FullSrcRegisters[0], i);
}
}
/* suck all the source values onto the stack before writing out any
* dst, which may alias...
*/
- for (i = 0; i < 4; i++) {
+ for (i = 3; i >= 0; i--) {
if (writemask & (1<<i)) {
x87_fld_src(cp, &op->FullSrcRegisters[0], i);
}
if (writemask & (1<<i)) {
x87_fld(cp->func, st0); /* a a */
x87_fprndint( cp->func ); /* flr(a) a */
- x87_fsubrp(cp->func, st1); /* frc(a) */
+ x87_fsubp(cp->func, st1); /* frc(a) */
x87_fstp(cp->func, x86_make_disp(dst, i*4));
}
}
emit_instruction( struct aos_compilation *cp,
struct tgsi_full_instruction *inst )
{
+ x87_assert_stack_empty(cp->func);
+
switch( inst->Instruction.Opcode ) {
case TGSI_OPCODE_MOV:
return emit_MOV( cp, inst );
break;
}
+ x87_assert_stack_empty(cp.func);
cp.insn_counter++;
debug_printf("\n");
}
x86_pop(cp.func, cp.count_ESI);
x86_pop(cp.func, cp.idx_EBX);
+ x87_assert_stack_empty(cp.func);
x86_ret(cp.func);
tgsi_parse_free( &parse );