The MASM Forum

64 bit assembler => UASM Assembler Development => Topic started by: aw27 on May 22, 2019, 08:51:11 PM

Title: movq incorrectly translated
Post by: aw27 on May 22, 2019, 08:51:11 PM
movq r11, xmm1

is translated to:

movq    r11,mm1
Title: Re: movq incorrectly translated
Post by: habran on May 22, 2019, 08:57:42 PM
Thanks AW,
will be fixed

Title: Re: movq incorrectly translated
Post by: habran on May 23, 2019, 08:09:59 AM
fix for MOVQ is in codegen.c on line 489:

    if (CodeInfo->token == T_MOVQ && CodeInfo->basereg != 0x10){
      if (CodeInfo->opnd[OPND1].type == OP_XMM && (CodeInfo->opnd[OPND2].type & OP_MS)){
        CodeInfo->prefix.opsiz = FALSE;
        OutputCodeByte(0xF3);
        }
      else if ((CodeInfo->opnd[OPND1].type & OP_MS) && CodeInfo->opnd[OPND2].type == OP_XMM){
        CodeInfo->prefix.opsiz = TRUE;
        OutputCodeByte(OPSIZ);
        }
      else if ((CodeInfo->opnd[OPND1].type == OP_XMM) && (CodeInfo->opnd[OPND2].type & OP_R64)) {
CodeInfo->prefix.opsiz = TRUE;
         OutputCodeByte(OPSIZ);
}
      else if ((CodeInfo->opnd[OPND2].type == OP_XMM) && (CodeInfo->opnd[OPND1].type & OP_R64)) {
        CodeInfo->prefix.opsiz = TRUE;
        OutputCodeByte(OPSIZ);
      }
    }
    else
    OutputCodeByte(OPSIZ);
  }


it will be fixed in next release
Title: Re: movq incorrectly translated
Post by: aw27 on May 23, 2019, 07:30:13 PM
Thank you, habran.  :Thmbsup: