Changeset 232 in dev for trunk/abdev/BasicCompiler64/Compile_Calc_PushVar.cpp
- Timestamp:
- Jul 25, 2007, 4:04:11 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/Compile_Calc_PushVar.cpp
r228 r232 11 11 if(pRelativeVar->bOffsetOffset){ 12 12 //movlpd xmm_reg,qword ptr[r11+offset] 13 OpBuffer[obp++]=(char)0x66; 14 OpBuffer[obp++]=(char)0x41; 15 OpBuffer[obp++]=(char)0x0F; 16 OpBuffer[obp++]=(char)0x12; 17 OpBuffer[obp++]=(char)(0x83 | REGISTER_OPERAND(xmm_reg)<<3); 18 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 19 pobj_GlobalVarSchedule->add(); 20 obp+=sizeof(long); 13 compiler.codeGenerator.op_movlpd_RM( xmm_reg, REG_R11, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::GlobalVar ); 21 14 } 22 15 else{ 23 16 //movlpd xmm_reg,qword ptr[offset] 24 OpBuffer[obp++]=(char)0x66; 25 OpBuffer[obp++]=(char)0x0F; 26 OpBuffer[obp++]=(char)0x12; 27 OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3); 28 OpBuffer[obp++]=(char)0x25; 29 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 30 pobj_GlobalVarSchedule->add(); 31 obp+=sizeof(long); 17 compiler.codeGenerator.op_movlpd_RM( xmm_reg, 0, (long)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar ); 32 18 } 33 19 } … … 50 36 else{ 51 37 //movlpd xmm_reg,qword ptr[rsp+offset] 52 OpBuffer[obp++]=(char)0x66; 53 OpBuffer[obp++]=(char)0x0F; 54 OpBuffer[obp++]=(char)0x12; 55 OpBuffer[obp++]=(char)(0x84 | REGISTER_OPERAND(xmm_reg)<<3); 56 OpBuffer[obp++]=(char)0x24; 57 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 58 AddLocalVarAddrSchedule(); 59 obp+=sizeof(long); 38 compiler.codeGenerator.op_movlpd_RM( xmm_reg, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 60 39 } 61 40 } … … 63 42 if(pRelativeVar->bOffsetOffset){ 64 43 //add r11,qword ptr[rsp+offset] 65 OpBuffer[obp++]=(char)0x4C; 66 OpBuffer[obp++]=(char)0x03; 67 OpBuffer[obp++]=(char)0x9C; 68 OpBuffer[obp++]=(char)0x24; 69 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 70 AddLocalVarAddrSchedule(); 71 obp+=sizeof(long); 44 compiler.codeGenerator.op_add_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 72 45 } 73 46 else{ 74 47 //mov r11,qword ptr[rsp+offset] 75 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 76 obp-=sizeof(long); 77 AddLocalVarAddrSchedule(); 78 obp+=sizeof(long); 48 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 79 49 } 80 50 … … 84 54 directmem: 85 55 //movlpd xmm_reg,qword ptr[r11] 86 OpBuffer[obp++]=(char)0x66; 87 OpBuffer[obp++]=(char)0x41; 88 OpBuffer[obp++]=(char)0x0F; 89 OpBuffer[obp++]=(char)0x12; 90 OpBuffer[obp++]=(char)(0x03 | REGISTER_OPERAND(xmm_reg)<<3); 56 compiler.codeGenerator.op_movlpd_RM( xmm_reg, REG_R11, 0, MOD_BASE); 91 57 } 92 58 } … … 95 61 if(pRelativeVar->bOffsetOffset){ 96 62 //movss xmm_reg,dword ptr[r11+offset] 97 OpBuffer[obp++]=(char)0xF3; 98 OpBuffer[obp++]=(char)0x41; 99 OpBuffer[obp++]=(char)0x0F; 100 OpBuffer[obp++]=(char)0x10; 101 OpBuffer[obp++]=(char)(0x83 | REGISTER_OPERAND(xmm_reg)<<3); 102 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 103 pobj_GlobalVarSchedule->add(); 104 obp+=sizeof(long); 63 compiler.codeGenerator.op_movss_RM( xmm_reg, REG_R11, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::GlobalVar ); 105 64 } 106 65 else{ 107 66 //movss xmm_reg,dword ptr[offset] 108 OpBuffer[obp++]=(char)0xF3; 109 OpBuffer[obp++]=(char)0x0F; 110 OpBuffer[obp++]=(char)0x10; 111 OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3); 112 OpBuffer[obp++]=(char)0x25; 113 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 114 pobj_GlobalVarSchedule->add(); 115 obp+=sizeof(long); 67 compiler.codeGenerator.op_movss_RM( xmm_reg, 0, (long)pRelativeVar->offset, MOD_BASE, Schedule::GlobalVar ); 116 68 } 117 69 } … … 134 86 else{ 135 87 //movss xmm_reg,dword ptr[rsp+offset] 136 OpBuffer[obp++]=(char)0xF3; 137 OpBuffer[obp++]=(char)0x0F; 138 OpBuffer[obp++]=(char)0x10; 139 OpBuffer[obp++]=(char)(0x84 | REGISTER_OPERAND(xmm_reg)<<3); 140 OpBuffer[obp++]=(char)0x24; 141 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 142 AddLocalVarAddrSchedule(); 143 obp+=sizeof(long); 88 compiler.codeGenerator.op_movss_RM( xmm_reg, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 144 89 } 145 90 } … … 147 92 if(pRelativeVar->bOffsetOffset){ 148 93 //add r11,qword ptr[rsp+offset] 149 OpBuffer[obp++]=(char)0x4C; 150 OpBuffer[obp++]=(char)0x03; 151 OpBuffer[obp++]=(char)0x9C; 152 OpBuffer[obp++]=(char)0x24; 153 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 154 AddLocalVarAddrSchedule(); 155 obp+=sizeof(long); 94 compiler.codeGenerator.op_add_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 156 95 } 157 96 else{ 158 97 //mov r11,qword ptr[rsp+offset] 159 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 160 obp-=sizeof(long); 161 AddLocalVarAddrSchedule(); 162 obp+=sizeof(long); 98 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 163 99 } 164 100 … … 168 104 directmem: 169 105 //movss xmm_reg,dword ptr[r11] 170 OpBuffer[obp++]=(char)0xF3; 171 OpBuffer[obp++]=(char)0x41; 172 OpBuffer[obp++]=(char)0x0F; 173 OpBuffer[obp++]=(char)0x10; 174 OpBuffer[obp++]=(char)(0x03 | REGISTER_OPERAND(xmm_reg)<<3); 106 compiler.codeGenerator.op_movss_RM( xmm_reg, REG_R11, 0, MOD_BASE); 175 107 } 176 108 }
Note:
See TracChangeset
for help on using the changeset viewer.