Changeset 64 in dev for BasicCompiler64/amd64_main.cpp
- Timestamp:
- Mar 8, 2007, 2:49:34 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler64/amd64_main.cpp
r36 r64 424 424 425 425 void 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&®1<=REG_RDI){ 432 if(REG_RAX<=reg2&®2<=REG_RDI) RexByte=(char)0x48; 433 if(REG_R8<=reg2&®2<=REG_R15) RexByte=(char)0x49; 434 } 435 if(REG_R8<=reg1&®1<=REG_R15){ 436 if(REG_RAX<=reg2&®2<=REG_RDI) RexByte=(char)0x4C; 437 if(REG_R8<=reg2&®2<=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)); 427 446 } 428 447 … … 475 494 } 476 495 } 477 void op_mov64_ToReg_FromReg(int reg1,int reg2){478 //mov reg1,reg2479 char RexByte=-1;480 481 if(reg1==reg2) return;482 483 if(REG_RAX<=reg1&®1<=REG_RDI){484 if(REG_RAX<=reg2&®2<=REG_RDI) RexByte=(char)0x48;485 if(REG_R8<=reg2&®2<=REG_R15) RexByte=(char)0x49;486 }487 if(REG_R8<=reg1&®1<=REG_R15){488 if(REG_RAX<=reg2&®2<=REG_RDI) RexByte=(char)0x4C;489 if(REG_R8<=reg2&®2<=REG_R15) RexByte=(char)0x4D;490 }491 492 if(RexByte==-1) SetError(300,NULL,cp);493 494 // [8bit rex] 1000 1011 11xx xbbb495 OpBuffer[obp++]=RexByte;496 OpBuffer[obp++]=(char)0x8B;497 OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));498 }499 496 void op_movsxd(int reg64,int reg32){ 500 497 //movsxd reg64,reg32 … … 686 683 } 687 684 688 void op_add 64_value(int reg,int offset){685 void op_add_RV(int reg,int offset){ 689 686 //add reg,offset 690 687 char RexByte=-1; … … 843 840 //////////////////////// 844 841 845 void op_imul_ reg(int op_size,int reg1,int reg2){842 void op_imul_RR(int op_size,int reg1,int reg2){ 846 843 //imul reg1,reg2 847 844 char RexByte=-1; … … 881 878 OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2)); 882 879 } 883 void op_imul_ value(int op_size,int reg,int i32data){880 void op_imul_RV(int op_size,int reg,int i32data){ 884 881 //imul reg,i32data 885 882 char RexByte=-1;
Note:
See TracChangeset
for help on using the changeset viewer.