Changeset 64 in dev for BasicCompiler64/amd64_main.cpp


Ignore:
Timestamp:
Mar 8, 2007, 2:49:34 AM (18 years ago)
Author:
dai_9181
Message:

すべてのオブジェクトを参照型に切り替えた。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler64/amd64_main.cpp

    r36 r64  
    424424
    425425void op_mov_RR(int reg1,int reg2){
    426     op_mov64_ToReg_FromReg(reg1,reg2);
     426    //mov reg1,reg2
     427    char RexByte=-1;
     428
     429    if(reg1==reg2) return;
     430
     431    if(REG_RAX<=reg1&&reg1<=REG_RDI){
     432        if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
     433        if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
     434    }
     435    if(REG_R8<=reg1&&reg1<=REG_R15){
     436        if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
     437        if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
     438    }
     439
     440    if(RexByte==-1) SetError(300,NULL,cp);
     441
     442    // [8bit rex] 1000 1011 11xx xbbb
     443    OpBuffer[obp++]=RexByte;
     444    OpBuffer[obp++]=(char)0x8B;
     445    OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
    427446}
    428447
     
    475494    }
    476495}
    477 void op_mov64_ToReg_FromReg(int reg1,int reg2){
    478     //mov reg1,reg2
    479     char RexByte=-1;
    480 
    481     if(reg1==reg2) return;
    482 
    483     if(REG_RAX<=reg1&&reg1<=REG_RDI){
    484         if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
    485         if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
    486     }
    487     if(REG_R8<=reg1&&reg1<=REG_R15){
    488         if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
    489         if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
    490     }
    491 
    492     if(RexByte==-1) SetError(300,NULL,cp);
    493 
    494     // [8bit rex] 1000 1011 11xx xbbb
    495     OpBuffer[obp++]=RexByte;
    496     OpBuffer[obp++]=(char)0x8B;
    497     OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
    498 }
    499496void op_movsxd(int reg64,int reg32){
    500497    //movsxd reg64,reg32
     
    686683}
    687684
    688 void op_add64_value(int reg,int offset){
     685void op_add_RV(int reg,int offset){
    689686    //add reg,offset
    690687    char RexByte=-1;
     
    843840////////////////////////
    844841
    845 void op_imul_reg(int op_size,int reg1,int reg2){
     842void op_imul_RR(int op_size,int reg1,int reg2){
    846843    //imul reg1,reg2
    847844    char RexByte=-1;
     
    881878    OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
    882879}
    883 void op_imul_value(int op_size,int reg,int i32data){
     880void op_imul_RV(int op_size,int reg,int i32data){
    884881    //imul reg,i32data
    885882    char RexByte=-1;
Note: See TracChangeset for help on using the changeset viewer.