idiv bug

17 views
Skip to first unread message

Palo Marton

unread,
Jan 16, 2014, 5:04:22 AM1/16/14
to asmji...@googlegroups.com
void EInstruction::prepare(CompilerContext& cc) ASMJIT_NOTHROW
{
...
          case INST_IMUL:
          case INST_MUL:
          case INST_IDIV:
          case INST_DIV:
            switch (i)
            {
              case 0:
                vdata->registerWriteCount++;
                var->vflags |= VARIABLE_ALLOC_WRITE | VARIABLE_ALLOC_SPECIAL; <-- Should be VARIABLE_ALLOC_READWRITE 
                var->regMask = Util::maskFromIndex(REG_INDEX_EDX);
                gpRestrictMask &= ~var->regMask;
                break;
              case 1:
                vdata->registerRWCount++;
                var->vflags |= VARIABLE_ALLOC_READWRITE | VARIABLE_ALLOC_SPECIAL;
                var->regMask = Util::maskFromIndex(REG_INDEX_EAX);
                gpRestrictMask &= ~var->regMask;
                break;
              case 2:
                vdata->registerReadCount++;
                var->vflags |= VARIABLE_ALLOC_READ;
                break;



For those interested here is patched version of compiler:


(includes also patches for other register allocator bugs I have found).

Palo

Petr Kobalíček

unread,
Jan 24, 2014, 8:52:37 PM1/24/14
to asmjit-dev
Thanks!

I just fixed it in trunk (future v1.1).

Cheers
Petr

--
 
---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages