Changeset 232 in dev
- Timestamp:
- Jul 25, 2007, 4:04:11 AM (17 years ago)
- Location:
- trunk/abdev
- Files:
-
- 1 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/BasicCompiler.vcproj
r225 r232 1308 1308 </File> 1309 1309 <File 1310 RelativePath="..\BasicCompiler_Common\src\NativeCode.cpp" 1311 > 1312 </File> 1313 <File 1310 1314 RelativePath="..\BasicCompiler_Common\src\Procedure.cpp" 1311 1315 > -
trunk/abdev/BasicCompiler64/BasicCompiler.vcproj
r226 r232 1117 1117 </File> 1118 1118 <File 1119 RelativePath="..\BasicCompiler_Common\src\NativeCode.cpp" 1120 > 1121 </File> 1122 <File 1119 1123 RelativePath="..\BasicCompiler_Common\src\Procedure.cpp" 1120 1124 > -
trunk/abdev/BasicCompiler64/CodeGenerator.cpp
r228 r232 160 160 /////////////////// 161 161 162 void CodeGenerator::op_mov_RV(int op_size,int reg,long i32data ){162 void CodeGenerator::op_mov_RV(int op_size,int reg,long i32data, Schedule::Type scheduleType ){ 163 163 //mov reg,i32data 164 164 … … 179 179 180 180 //即値 181 pNativeCode->Put( i32data );181 pNativeCode->Put( i32data, scheduleType ); 182 182 } 183 183 void CodeGenerator::op_mov_RV64(int reg,_int64 i64data){ … … 258 258 } 259 259 } 260 void CodeGenerator::op_mov_MR(int op_size,int reg,int base_reg,long offset,char mod ){260 void CodeGenerator::op_mov_MR(int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType ){ 261 261 //mov qword ptr[base_reg+offset],reg64 262 262 //mov dword ptr[base_reg+offset],reg32 … … 273 273 else opcode=(char)0x89; 274 274 275 __op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod );276 } 277 void CodeGenerator::op_mov_MR_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset ){275 __op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod, scheduleType ); 276 } 277 void CodeGenerator::op_mov_MR_ex(int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType ){ 278 278 //mov qword ptr[base_reg1+base_reg2+offset],reg64 279 279 //mov dword ptr[base_reg1+base_reg2+offset],reg32 … … 309 309 310 310 //オフセット値 311 pNativeCode->Put( offset );311 pNativeCode->Put( offset, scheduleType ); 312 312 } 313 313 else{ … … 389 389 } 390 390 391 392 393 ///////////////////394 // mov64関連395 ///////////////////396 397 void CodeGenerator::op_mov64_ToReg(int reg,_int64 i64data){398 //mov reg,i64data399 400 if(REG_RAX<=reg&®<=REG_RDI){401 /* rax~rdi402 0100 1000 1011 1xxx [64bit data] */403 pNativeCode->Put( (char)0x48 );404 pNativeCode->Put( (char)(0xB8| REGISTER_OPERAND(reg) ) );405 pNativeCode->Put( i64data );406 }407 if(REG_R8<=reg&®<=REG_R15){408 /* r8~r15409 0100 1001 1011 1xxx [64bit data] */410 pNativeCode->Put( (char)0x49 );411 pNativeCode->Put( (char)(0xB8| REGISTER_OPERAND(reg) ) );412 pNativeCode->Put( i64data );413 }414 }415 void CodeGenerator::op_mov64_ToReg(int reg,long i32data){416 //mov reg,i32data417 418 if(REG_RAX<=reg&®<=REG_RDI){419 /* rax~rdi420 0100 1000 1100 0111 1100 0xxx [32bit data] */421 pNativeCode->Put( (char)0x48 );422 pNativeCode->Put( (char)0xC7 );423 pNativeCode->Put( (char)(0xC0| REGISTER_OPERAND(reg) ) );424 pNativeCode->Put( i32data );425 }426 if(REG_R8<=reg&®<=REG_R15){427 /* r8~r15428 0100 1001 1100 0111 1100 0xxx [32bit data] */429 pNativeCode->Put( (char)0x49 );430 pNativeCode->Put( (char)0xC7 );431 pNativeCode->Put( (char)(0xC0| REGISTER_OPERAND(reg) ) );432 pNativeCode->Put( i32data );433 }434 }435 391 void CodeGenerator::op_movsxd(int reg64,int reg32){ 436 392 //movsxd reg64,reg32 … … 641 597 } 642 598 643 void CodeGenerator::op_add_RV(int reg,long offset ){599 void CodeGenerator::op_add_RV(int reg,long offset, Schedule::Type scheduleType ){ 644 600 //add reg,offset 645 601 char RexByte=-1; … … 656 612 pNativeCode->Put( (char)RexByte ); 657 613 pNativeCode->Put( (char)0x05 ); 658 pNativeCode->Put( offset );614 pNativeCode->Put( offset, scheduleType ); 659 615 } 660 616 else{ … … 665 621 pNativeCode->Put( (char)0x81 ); 666 622 pNativeCode->Put( (char)(0xC0| REGISTER_OPERAND(reg)) ); 667 pNativeCode->Put( offset );623 pNativeCode->Put( offset, scheduleType ); 668 624 } 669 625 } … … 1365 1321 //////////////////// 1366 1322 1367 void CodeGenerator::op_movlpd_MR(int xmm_reg,int base_reg,int offset,char mod ){1323 void CodeGenerator::op_movlpd_MR(int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){ 1368 1324 //movlpd qword ptr[base_reg+offset],xmm_reg 1369 __op_format(0,(char)0x66,(char)0x0F,(char)0x13,xmm_reg,base_reg,offset,mod );1370 } 1371 void CodeGenerator::op_movlpd_RM(int xmm_reg,int base_reg,int offset,char mod ){1325 __op_format(0,(char)0x66,(char)0x0F,(char)0x13,xmm_reg,base_reg,offset,mod, scheduleType ); 1326 } 1327 void CodeGenerator::op_movlpd_RM(int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){ 1372 1328 //movlpd xmm_reg,qword ptr[base_reg+offset] 1373 __op_format(0,(char)0x66,(char)0x0F,(char)0x12,xmm_reg,base_reg,offset,mod );1329 __op_format(0,(char)0x66,(char)0x0F,(char)0x12,xmm_reg,base_reg,offset,mod, scheduleType ); 1374 1330 } 1375 1331 void CodeGenerator::op_movsd_RR(int xmm_reg1,int xmm_reg2){ … … 1379 1335 __op_format(0,(char)0xF2,(char)0x0F,(char)0x10,xmm_reg1,xmm_reg2,0,MOD_REG); 1380 1336 } 1381 void CodeGenerator::op_movsd_MR(int xmm_reg,int base_reg,int offset,char mod ){1337 void CodeGenerator::op_movsd_MR(int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){ 1382 1338 //movsd qword ptr[reg+offset],xmm_reg 1383 1339 //movsd qword ptr[reg],xmm_reg 1384 __op_format(0,(char)0xF2,(char)0x0F,(char)0x11,xmm_reg,base_reg,offset,mod );1340 __op_format(0,(char)0xF2,(char)0x0F,(char)0x11,xmm_reg,base_reg,offset,mod, scheduleType ); 1385 1341 } 1386 1342 void CodeGenerator::op_movss_RR(int xmm_reg1,int xmm_reg2){ … … 1390 1346 __op_format(0,(char)0xF3,(char)0x0F,(char)0x10,xmm_reg1,xmm_reg2,0,MOD_REG); 1391 1347 } 1392 void CodeGenerator::op_movss_RM(int xmm_reg,int base_reg,int offset,char mod ){1348 void CodeGenerator::op_movss_RM(int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){ 1393 1349 //movss xmm_reg,dword ptr[base_reg+offset] 1394 __op_format(0,(char)0xF3,(char)0x0F,(char)0x10,xmm_reg,base_reg,offset,mod );1395 } 1396 void CodeGenerator::op_movss_MR(int xmm_reg,int base_reg,int offset,char mod ){1350 __op_format(0,(char)0xF3,(char)0x0F,(char)0x10,xmm_reg,base_reg,offset,mod, scheduleType ); 1351 } 1352 void CodeGenerator::op_movss_MR(int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType ){ 1397 1353 //movss dword ptr[reg+offset],xmm_reg 1398 1354 //movss dword ptr[reg],xmm_reg 1399 __op_format(0,(char)0xF3,(char)0x0F,(char)0x11,xmm_reg,base_reg,offset,mod );1355 __op_format(0,(char)0xF3,(char)0x0F,(char)0x11,xmm_reg,base_reg,offset,mod, scheduleType ); 1400 1356 } 1401 1357 -
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 } -
trunk/abdev/BasicCompiler64/Compile_ProcOp.cpp
r226 r232 740 740 //ローカル変数領域のサイズをスタックフレームに通知 741 741 int localParmSize = AllLocalVarSize - BaseLocalVar; 742 int stackFrameSize = pobj_sf->GetFrameSize( AllLocalVarSize );742 int stackFrameSize = pobj_sf->GetFrameSize( localParmSize ); 743 743 744 744 //ローカル変数アドレススケジュール -
trunk/abdev/BasicCompiler64/Compile_Set_Var.cpp
r228 r232 105 105 if(pRelative->bOffsetOffset){ 106 106 //movsd qword ptr[r11+offset],xmm0 107 OpBuffer[obp++]=(char)0xF2; 108 OpBuffer[obp++]=(char)0x41; 109 OpBuffer[obp++]=(char)0x0F; 110 OpBuffer[obp++]=(char)0x11; 111 OpBuffer[obp++]=(char)0x83; 112 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 113 pobj_GlobalVarSchedule->add(); 114 obp+=sizeof(long); 107 compiler.codeGenerator.op_movsd_MR( REG_XMM0, REG_R11, (long)pRelative->offset, MOD_BASE_DISP32, Schedule::GlobalVar ); 115 108 } 116 109 else{ 117 110 //movsd qword ptr[offset],xmm0 118 OpBuffer[obp++]=(char)0xF2; 119 OpBuffer[obp++]=(char)0x0F; 120 OpBuffer[obp++]=(char)0x11; 121 OpBuffer[obp++]=(char)0x04; 122 OpBuffer[obp++]=(char)0x25; 123 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 124 pobj_GlobalVarSchedule->add(); 125 obp+=sizeof(long); 111 compiler.codeGenerator.op_movsd_MR( REG_XMM0, 0, (long)pRelative->offset, MOD_DISP32, Schedule::GlobalVar ); 126 112 } 127 113 } … … 144 130 else{ 145 131 //movsd qword ptr[rsp+offset],xmm0 146 OpBuffer[obp++]=(char)0xF2; 147 OpBuffer[obp++]=(char)0x0F; 148 OpBuffer[obp++]=(char)0x11; 149 OpBuffer[obp++]=(char)0x84; 150 OpBuffer[obp++]=(char)0x24; 151 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 152 AddLocalVarAddrSchedule(); 153 obp+=sizeof(long); 132 compiler.codeGenerator.op_movsd_MR( REG_XMM0, REG_RSP, (long)pRelative->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 154 133 } 155 134 } … … 157 136 if(pRelative->bOffsetOffset){ 158 137 //add r11,qword ptr[rsp+offset] 159 OpBuffer[obp++]=(char)0x4C; 160 OpBuffer[obp++]=(char)0x03; 161 OpBuffer[obp++]=(char)0x9C; 162 OpBuffer[obp++]=(char)0x24; 163 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 164 AddLocalVarAddrSchedule(); 165 obp+=sizeof(long); 138 compiler.codeGenerator.op_add_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 166 139 } 167 140 else{ 168 141 //mov r11,qword ptr[rsp+offset] 169 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32); 170 obp-=sizeof(long); 171 AddLocalVarAddrSchedule(); 172 obp+=sizeof(long); 142 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 173 143 } 174 144 … … 192 162 if(pRelative->bOffsetOffset){ 193 163 //movss dword ptr[r11+offset],xmm0 194 OpBuffer[obp++]=(char)0xF3; 195 OpBuffer[obp++]=(char)0x41; 196 OpBuffer[obp++]=(char)0x0F; 197 OpBuffer[obp++]=(char)0x11; 198 OpBuffer[obp++]=(char)0x83; 199 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 200 pobj_GlobalVarSchedule->add(); 201 obp+=sizeof(long); 164 compiler.codeGenerator.op_movss_MR( REG_XMM0, REG_R11, (long)pRelative->offset, MOD_BASE_DISP32, Schedule::GlobalVar ); 202 165 } 203 166 else{ 204 167 //movss dword ptr[offset],xmm0 205 OpBuffer[obp++]=(char)0xF3; 206 OpBuffer[obp++]=(char)0x0F; 207 OpBuffer[obp++]=(char)0x11; 208 OpBuffer[obp++]=(char)0x04; 209 OpBuffer[obp++]=(char)0x25; 210 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 211 pobj_GlobalVarSchedule->add(); 212 obp+=sizeof(long); 168 compiler.codeGenerator.op_movss_MR( REG_XMM0, 0, (long)pRelative->offset, MOD_DISP32, Schedule::GlobalVar ); 213 169 } 214 170 } … … 231 187 else{ 232 188 //movss dword ptr[rsp+offset],xmm0 233 OpBuffer[obp++]=(char)0xF3; 234 OpBuffer[obp++]=(char)0x0F; 235 OpBuffer[obp++]=(char)0x11; 236 OpBuffer[obp++]=(char)0x84; 237 OpBuffer[obp++]=(char)0x24; 238 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 239 AddLocalVarAddrSchedule(); 240 obp+=sizeof(long); 189 compiler.codeGenerator.op_movss_MR( REG_XMM0, REG_RSP, (long)pRelative->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 241 190 } 242 191 } … … 244 193 if(pRelative->bOffsetOffset){ 245 194 //add r11,qword ptr[rsp+offset] 246 OpBuffer[obp++]=(char)0x4C; 247 OpBuffer[obp++]=(char)0x03; 248 OpBuffer[obp++]=(char)0x9C; 249 OpBuffer[obp++]=(char)0x24; 250 *((long *)(OpBuffer+obp))=(int)pRelative->offset; 251 AddLocalVarAddrSchedule(); 252 obp+=sizeof(long); 195 compiler.codeGenerator.op_add_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 253 196 } 254 197 else{ 255 198 //mov r11,qword ptr[rsp+offset] 256 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32); 257 obp-=sizeof(long); 258 AddLocalVarAddrSchedule(); 259 obp+=sizeof(long); 199 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 260 200 } 261 201 … … 334 274 if(pRelative->bOffsetOffset){ 335 275 //mov ptr[r11+offset],rax/eax/ax/al 336 compiler.codeGenerator.op_mov_MR(varSize,REG_RAX,REG_R11,(int)pRelative->offset,MOD_BASE_DISP32); 337 obp-=sizeof(long); 338 pobj_GlobalVarSchedule->add(); 339 obp+=sizeof(long); 276 compiler.codeGenerator.op_mov_MR(varSize,REG_RAX,REG_R11,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::GlobalVar ); 340 277 } 341 278 else{ 342 279 //mov ptr[offset],rax/eax/ax/al 343 compiler.codeGenerator.op_mov_MR(varSize,REG_RAX,0,(int)pRelative->offset,MOD_DISP32); 344 obp-=sizeof(long); 345 pobj_GlobalVarSchedule->add(); 346 obp+=sizeof(long); 280 compiler.codeGenerator.op_mov_MR(varSize,REG_RAX,0,(int)pRelative->offset,MOD_DISP32, Schedule::GlobalVar ); 347 281 } 348 282 } … … 350 284 if(pRelative->bOffsetOffset){ 351 285 //add r11,qword ptr[offset] 352 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelative->offset, MOD_DISP32 ); 353 obp-=sizeof(long); 354 pobj_GlobalVarSchedule->add(); 355 obp+=sizeof(long); 286 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelative->offset, MOD_DISP32, Schedule::GlobalVar ); 356 287 } 357 288 else{ 358 289 //mov r11,qword ptr[offset] 359 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelative->offset,MOD_DISP32); 360 obp-=sizeof(long); 361 pobj_GlobalVarSchedule->add(); 362 obp+=sizeof(long); 290 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelative->offset,MOD_DISP32, Schedule::GlobalVar ); 363 291 } 364 292 … … 368 296 if(pRelative->bOffsetOffset){ 369 297 //mov ptr[rsp+r11+offset],rax/eax/ax/al 370 compiler.codeGenerator.op_mov_MR_ex(varSize,REG_RAX,REG_RSP,REG_R11,(int)pRelative->offset,USE_OFFSET); 371 obp-=sizeof(long); 372 AddLocalVarAddrSchedule(); 373 obp+=sizeof(long); 298 compiler.codeGenerator.op_mov_MR_ex(varSize,REG_RAX,REG_RSP,REG_R11,(int)pRelative->offset,USE_OFFSET, Schedule::LocalVar ); 374 299 } 375 300 else{ 376 301 //mov ptr[rsp+offset],rax/eax/ax/al 377 compiler.codeGenerator.op_mov_MR(varSize,REG_RAX,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32); 378 obp-=sizeof(long); 379 AddLocalVarAddrSchedule(); 380 obp+=sizeof(long); 302 compiler.codeGenerator.op_mov_MR(varSize,REG_RAX,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 381 303 } 382 304 } … … 384 306 if(pRelative->bOffsetOffset){ 385 307 //add r11,qword ptr[rsp+offset] 386 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (int)pRelative->offset, MOD_BASE_DISP32 ); 387 obp-=sizeof(long); 388 AddLocalVarAddrSchedule(); 389 obp+=sizeof(long); 308 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (int)pRelative->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 390 309 } 391 310 else{ 392 311 //mov r11,qword ptr[rsp+offset] 393 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32); 394 obp-=sizeof(long); 395 AddLocalVarAddrSchedule(); 396 obp+=sizeof(long); 312 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 397 313 } 398 314 -
trunk/abdev/BasicCompiler64/Compile_Var.cpp
r228 r232 868 868 869 869 //mov qword ptr[offset],rax 870 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32); 871 obp-=sizeof(long); 872 pobj_GlobalVarSchedule->add(); 873 obp+=sizeof(long); 870 compiler.codeGenerator.op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32, Schedule::GlobalVar ); 874 871 } 875 872 else{ … … 992 989 993 990 //mov rax,i64data 994 compiler.codeGenerator.op_mov 64_ToReg(REG_RAX,i64data);991 compiler.codeGenerator.op_mov_RV64(REG_RAX,i64data); 995 992 996 993 //mov qword ptr[rsp+offset],rax … … 1034 1031 if(i64data&0xFFFFFFFF00000000){ 1035 1032 //mov rax,i64data 1036 compiler.codeGenerator.op_mov 64_ToReg(REG_RAX,i64data);1033 compiler.codeGenerator.op_mov_RV64(REG_RAX,i64data); 1037 1034 1038 1035 //mov qword ptr[rsp+offset],rax … … 1116 1113 //アラインメントを考慮 1117 1114 if( pVar->GetType().IsStruct() ){ 1118 int alignment = pVar->GetType().GetClass(). iAlign;1115 int alignment = pVar->GetType().GetClass().GetFixedAlignment(); 1119 1116 1120 1117 if( alignment ){ … … 1222 1219 if(pRelativeVar->bOffsetOffset){ 1223 1220 //add r11,offset 1224 OpBuffer[obp++]=(char)0x49; 1225 OpBuffer[obp++]=(char)0x81; 1226 OpBuffer[obp++]=(char)0xC3; 1227 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 1228 pobj_GlobalVarSchedule->add(); 1229 obp+=sizeof(long); 1221 compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::GlobalVar ); 1230 1222 1231 1223 //mov reg,r11 … … 1234 1226 else{ 1235 1227 //mov reg,offset 1236 compiler.codeGenerator.op_mov64_ToReg(reg,(long)pRelativeVar->offset); 1237 obp-=sizeof(long); 1238 pobj_GlobalVarSchedule->add(); 1239 obp+=sizeof(long); 1228 compiler.codeGenerator.op_mov_RV( sizeof(_int64), reg, (long)pRelativeVar->offset, Schedule::GlobalVar ); 1240 1229 } 1241 1230 } … … 1243 1232 if(pRelativeVar->bOffsetOffset){ 1244 1233 //add r11,qword ptr[offset] 1245 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 ); 1246 obp-=sizeof(long); 1247 pobj_GlobalVarSchedule->add(); 1248 obp+=sizeof(long); 1234 compiler.codeGenerator.op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32, Schedule::GlobalVar ); 1249 1235 } 1250 1236 else{ 1251 1237 //mov r11,qword ptr[offset] 1252 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32); 1253 obp-=sizeof(long); 1254 pobj_GlobalVarSchedule->add(); 1255 obp+=sizeof(long); 1238 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32, Schedule::GlobalVar ); 1256 1239 } 1257 1240 … … 1261 1244 if(pRelativeVar->bOffsetOffset){ 1262 1245 //add r11,offset 1263 OpBuffer[obp++]=(char)0x49; 1264 OpBuffer[obp++]=(char)0x81; 1265 OpBuffer[obp++]=(char)0xC3; 1266 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 1267 AddLocalVarAddrSchedule(); 1268 obp+=sizeof(long); 1246 compiler.codeGenerator.op_add_RV( REG_R11, (long)pRelativeVar->offset, Schedule::LocalVar ); 1269 1247 1270 1248 //add r11,rsp … … 1279 1257 1280 1258 //add reg,offset 1281 compiler.codeGenerator.op_add_RV(reg,(int)pRelativeVar->offset); 1282 obp-=sizeof(long); 1283 AddLocalVarAddrSchedule(); 1284 obp+=sizeof(long); 1259 compiler.codeGenerator.op_add_RV(reg,(long)pRelativeVar->offset, Schedule::LocalVar ); 1285 1260 } 1286 1261 } … … 1288 1263 if(pRelativeVar->bOffsetOffset){ 1289 1264 //add r11,qword ptr[rsp+offset] 1290 OpBuffer[obp++]=(char)0x4C; 1291 OpBuffer[obp++]=(char)0x03; 1292 OpBuffer[obp++]=(char)0x9C; 1293 OpBuffer[obp++]=(char)0x24; 1294 *((long *)(OpBuffer+obp))=(int)pRelativeVar->offset; 1295 AddLocalVarAddrSchedule(); 1296 obp+=sizeof(long); 1265 compiler.codeGenerator.op_add_RM( REG_R11, REG_RSP, (long)pRelativeVar->offset, MOD_BASE_DISP32, Schedule::LocalVar ); 1297 1266 } 1298 1267 else{ 1299 1268 //mov r11,qword ptr[rsp+offset] 1300 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32); 1301 obp-=sizeof(long); 1302 AddLocalVarAddrSchedule(); 1303 obp+=sizeof(long); 1269 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32, Schedule::LocalVar ); 1304 1270 } 1305 1271 … … 1331 1297 // ルートポインタを引き渡す 1332 1298 //mov rdx,offset 1333 compiler.codeGenerator.op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress()); 1334 obp-=sizeof(long); 1335 pobj_GlobalVarSchedule->add(); 1336 obp+=sizeof(long); 1299 compiler.codeGenerator.op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->GetOffsetAddress(), Schedule::GlobalVar ); 1337 1300 1338 1301 // Thisポインタを引き渡す -
trunk/abdev/BasicCompiler64/NumOpe.cpp
r226 r232 971 971 if(XmmReg==REG_XMM4){ 972 972 //mov r14,i64data 973 compiler.codeGenerator.op_mov 64_ToReg(REG_R14,i64data);973 compiler.codeGenerator.op_mov_RV64(REG_R14,i64data); 974 974 975 975 … … 1026 1026 1027 1027 //mov reg,i64data 1028 compiler.codeGenerator.op_mov 64_ToReg(UseReg,i64data);1028 compiler.codeGenerator.op_mov_RV64(UseReg,i64data); 1029 1029 1030 1030 if(UseReg==REG_R14){ … … 1194 1194 1195 1195 //mov reg,i64data 1196 compiler.codeGenerator.op_mov 64_ToReg(UseReg,i64data);1196 compiler.codeGenerator.op_mov_RV64(UseReg,i64data); 1197 1197 } 1198 1198 -
trunk/abdev/BasicCompiler64/stack_frame.cpp
r228 r232 25 25 answer_sp=lowest_sp-max_parm_size; 26 26 27 if((localParamSize%0x10)){ 28 if((answer_sp%0x10)==0){ 29 //関数のエントリポイントで128ビット境界ラインに合わせるため 30 return -(answer_sp-0x08); 31 } 32 return -(answer_sp-0x10); 27 if(((answer_sp-localParamSize)%0x10)==0){ 28 //関数のエントリポイントで128ビット境界ラインに合わせるため 29 return -(answer_sp-0x08); 33 30 } 34 35 if((answer_sp%0x10)==0){ 36 //関数のエントリポイントで128ビット境界ラインに合わせるため 37 return -(answer_sp-0x10); 38 } 39 return -(answer_sp-0x08); 31 return -(answer_sp-0x10); 40 32 } 41 33 int CStackFrame::GetNowSp(){ -
trunk/abdev/BasicCompiler_Common/BasicCompiler.cpp
r212 r232 98 98 99 99 extern int obp; 100 if(obp==1115){ 100 if(obp>=0x988DE){ 101 int test=0; 101 102 } 102 103 } -
trunk/abdev/BasicCompiler_Common/Compile.cpp
r206 r232 684 684 } 685 685 686 #ifdef _DEBUG 686 687 687 epi_check(); 688 #endif 688 689 689 690 690 //コンパイルを中断するとき -
trunk/abdev/BasicCompiler_Common/Debug.cpp
r206 r232 596 596 if(de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_ACCESS_VIOLATION){ 597 597 598 //"スレッド(&H%X)でアクセス違反がありました(E PI=&H%08X)。\r\n"598 //"スレッド(&H%X)でアクセス違反がありました(EIP=&H%08X)。\r\n" 599 599 sprintf(temporary,STRING_DEBUG_THREAD_ACCESSVIOLATION,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress); 600 600 DebugMessage(temporary); … … 621 621 if(de.dwThreadId==_DebugSys_dwThreadID[i4]) break; 622 622 } 623 Context.ContextFlags=CONTEXT_CONTROL ;623 Context.ContextFlags=CONTEXT_CONTROL | CONTEXT_INTEGER; 624 624 GetThreadContext(array_hDebugThread[i4],&Context); 625 625 … … 627 627 i3&&(!(ImageBase+MemPos_CodeSection<=EIP_RIP(Context)&&EIP_RIP(Context)<ImageBase+MemPos_CodeSection+FileSize_CodeSection)) 628 628 ){ 629 //"スレッド(&H%X)のブレーク ポイント(EPI=&H%08X)。\r\n" 630 sprintf(temporary,STRING_DEBUG_BREAKPOINT,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress); 629 //"スレッド(&H%X)のブレーク ポイント(EIP=&H%08X)。\r\n" 630 sprintf(temporary, 631 STRING_DEBUG_BREAKPOINT, 632 de.dwThreadId, 633 (ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress, 634 (ULONG_PTR)Context.Rsp); 631 635 DebugMessage(temporary); 632 636 } … … 726 730 } 727 731 else if(de.u.Exception.ExceptionRecord.ExceptionCode==STATUS_INTEGER_DIVIDE_BY_ZERO){ 728 //"0による除算が行われました。スレッド(&H%X) ブレーク ポイント(E PI=&H%08X)。\r\n"732 //"0による除算が行われました。スレッド(&H%X) ブレーク ポイント(EIP=&H%08X)。\r\n" 729 733 sprintf(temporary,STRING_DEBUG_DIVIDE_BY_ZERO,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress); 730 734 DebugMessage(temporary); … … 734 738 } 735 739 else if(de.u.Exception.ExceptionRecord.ExceptionCode==STATUS_NO_MEMORY){ 736 //"メモリ不足、またはヒープが壊れていることが原因で、メモリの割り当てに失敗しました。スレッド(&H%X) ブレーク ポイント(E PI=&H%08X)。\r\n"740 //"メモリ不足、またはヒープが壊れていることが原因で、メモリの割り当てに失敗しました。スレッド(&H%X) ブレーク ポイント(EIP=&H%08X)。\r\n" 737 741 sprintf(temporary,STRING_DEBUG_DIVIDE_NO_MEMORY,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress); 738 742 DebugMessage(temporary); -
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r206 r232 325 325 326 326 //アラインメント 327 *(long *)(buffer+i2)=pobj_c-> iAlign;327 *(long *)(buffer+i2)=pobj_c->GetFixedAlignment(); 328 328 i2+=sizeof(long); 329 329 … … 705 705 706 706 //アラインメント 707 pobj_c-> iAlign=*(long *)(buffer+i2);707 pobj_c->SetFixedAlignment( *(long *)(buffer+i2) ); 708 708 i2+=sizeof(long); 709 709 -
trunk/abdev/BasicCompiler_Common/VariableOpe.cpp
r206 r232 1002 1002 int alignment = 0; 1003 1003 if( pVar->GetType().IsStruct() ){ 1004 alignment = pVar->GetType().GetClass(). iAlign;1004 alignment = pVar->GetType().GetClass().GetFixedAlignment(); 1005 1005 } 1006 1006 -
trunk/abdev/BasicCompiler_Common/common_msg_eng.h
r4 r232 39 39 #define STRING_DEBUG_THREADFINISH "Thread(&H%X) exited with code &H%X.\r\n" 40 40 #define STRING_DEBUG_PROCESSFINISH "Program exited with code &H%X.\r\n" 41 #define STRING_DEBUG_THREAD_INVALID_HANDLE "Handle violation. Thread=&H%X E PI=&H%08X\r\n"42 #define STRING_DEBUG_THREAD_ACCESSVIOLATION "Access violation. Thread=&H%X E PI=&H%08X\r\n"43 #define STRING_DEBUG_BREAKPOINT "Breakpoint. Thread=&H%X E PI=&H%08X\r\n"44 #define STRING_DEBUG_DIVIDE_BY_ZERO "Divided by zero. Thread=&H%X E PI=&H%08X\r\n"41 #define STRING_DEBUG_THREAD_INVALID_HANDLE "Handle violation. Thread=&H%X EIP=&H%08X\r\n" 42 #define STRING_DEBUG_THREAD_ACCESSVIOLATION "Access violation. Thread=&H%X EIP=&H%08X\r\n" 43 #define STRING_DEBUG_BREAKPOINT "Breakpoint. Thread=&H%X EIP=&H%08X/ESP=&H%08X\r\n" 44 #define STRING_DEBUG_DIVIDE_BY_ZERO "Divided by zero. Thread=&H%X EIP=&H%08X\r\n" 45 45 #define STRING_DEBUG_ERROR "Unknown error.\ncode:%X" 46 46 #define STRING_DEBUG_FAILED "Failed to read the debug information." -
trunk/abdev/BasicCompiler_Common/common_msg_jpn.h
r4 r232 39 39 #define STRING_DEBUG_THREADFINISH "スレッド(&H%X)はコード &H%X で終了しました。\r\n" 40 40 #define STRING_DEBUG_PROCESSFINISH "プログラムはコード &H%X で終了しました。\r\n" 41 #define STRING_DEBUG_THREAD_INVALID_HANDLE "スレッド(&H%X)でハンドル違反がありました(E PI=&H%08X)。\r\n"42 #define STRING_DEBUG_THREAD_ACCESSVIOLATION "スレッド(&H%X)でアクセス違反がありました(E PI=&H%08X)。\r\n"43 #define STRING_DEBUG_BREAKPOINT "スレッド(&H%X)のブレーク ポイント(E PI=&H%08X)。\r\n"44 #define STRING_DEBUG_DIVIDE_BY_ZERO "0による除算が行われました。スレッド(&H%X) ブレーク ポイント(E PI=&H%08X)。\r\n"45 #define STRING_DEBUG_DIVIDE_NO_MEMORY "メモリ不足、またはヒープが壊れていることが原因で、メモリの割り当てに失敗しました。スレッド(&H%X) ブレーク ポイント(E PI=&H%08X)。\r\n"41 #define STRING_DEBUG_THREAD_INVALID_HANDLE "スレッド(&H%X)でハンドル違反がありました(EIP=&H%08X)。\r\n" 42 #define STRING_DEBUG_THREAD_ACCESSVIOLATION "スレッド(&H%X)でアクセス違反がありました(EIP=&H%08X)。\r\n" 43 #define STRING_DEBUG_BREAKPOINT "スレッド(&H%X)のブレーク ポイント(EIP=&H%08X/ESP=&H%08X)。\r\n" 44 #define STRING_DEBUG_DIVIDE_BY_ZERO "0による除算が行われました。スレッド(&H%X) ブレーク ポイント(EIP=&H%08X)。\r\n" 45 #define STRING_DEBUG_DIVIDE_NO_MEMORY "メモリ不足、またはヒープが壊れていることが原因で、メモリの割り当てに失敗しました。スレッド(&H%X) ブレーク ポイント(EIP=&H%08X)。\r\n" 46 46 #define STRING_DEBUG_ERROR "例外処理(code:&H%08X)\r\n" 47 47 #define STRING_DEBUG_FAILED "デバッグ情報の取得に失敗" -
trunk/abdev/BasicCompiler_Common/include/Class.h
r208 r232 71 71 // 静的メソッド 72 72 Methods staticMethods; 73 74 //アラインメント値 75 int fixedAlignment; 73 76 74 77 // XMLシリアライズ用 … … 93 96 ar & BOOST_SERIALIZATION_NVP( vtblNum ); 94 97 ar & BOOST_SERIALIZATION_NVP( staticMethods ); 98 ar & BOOST_SERIALIZATION_NVP( fixedAlignment ); 95 99 } 96 100 97 101 bool isReady; 98 102 public: 99 100 //アラインメント値101 int iAlign;102 103 103 104 CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name ) … … 107 108 , pSuperClass( NULL ) 108 109 , isReady( false ) 109 , iAlign( 0 )110 , fixedAlignment( 0 ) 110 111 , ConstructorMemberSubIndex( -1 ) 111 112 , DestructorMemberSubIndex( -1 ) … … 123 124 , pSuperClass( NULL ) 124 125 , isReady( false ) 125 , iAlign( 0 )126 , fixedAlignment( 0 ) 126 127 , ConstructorMemberSubIndex( -1 ) 127 128 , DestructorMemberSubIndex( -1 ) … … 320 321 } 321 322 323 // ユーザ指定のアラインメント固定値 324 int GetFixedAlignment() const 325 { 326 return fixedAlignment; 327 } 328 void SetFixedAlignment( int fixedAlignment ) 329 { 330 this->fixedAlignment = fixedAlignment; 331 } 332 322 333 // メンバの総合サイズを取得 323 334 int GetSize() const; -
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r230 r232 41 41 void __jmp_op_format( char opcode, long offset, int op_size ); 42 42 public: 43 void op_mov_RV (int op_size,int reg,long i32data );43 void op_mov_RV (int op_size,int reg,long i32data, Schedule::Type scheduleType = Schedule::None ); 44 44 void op_mov_RV64 (int reg,_int64 i64data); 45 45 void op_mov_RM (int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType = Schedule::None ); 46 46 void op_mov_RM_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None ); 47 void op_mov_MR (int op_size,int reg,int base_reg,long offset,char mod );48 void op_mov_MR_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset );47 void op_mov_MR (int op_size,int reg,int base_reg,long offset,char mod, Schedule::Type scheduleType = Schedule::None ); 48 void op_mov_MR_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset, Schedule::Type scheduleType = Schedule::None ); 49 49 void op_mov_MV (int op_size,int base_reg,int offset,BOOL bUseOffset,long i32data); 50 50 void op_mov_RR (int reg1,int reg2); 51 void op_mov64_ToReg (int reg,_int64 i64data);52 void op_mov64_ToReg (int reg,long i32data);53 51 void op_movsxd (int reg64,int reg32); 54 52 void op_movsx64_FromReg16 (int reg64,int reg16); … … 61 59 void op_dec (int reg); 62 60 void op_add_RM (int op_size,int reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None ); 63 void op_add_RV (int reg,long offset );61 void op_add_RV (int reg,long offset, Schedule::Type scheduleType = Schedule::None ); 64 62 void op_add_RR (int reg1,int reg2); 65 63 void op_add32_reg (int reg1,int reg2); … … 86 84 void op_cmp_value (int op_size,int reg,char byte_data); 87 85 void op_setne (int reg); 88 void op_movlpd_MR (int xmm_reg,int base_reg,int offset,char mod );89 void op_movlpd_RM (int xmm_reg,int base_reg,int offset,char mod );86 void op_movlpd_MR (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None ); 87 void op_movlpd_RM (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None ); 90 88 void op_movsd_RR (int xmm_reg1,int xmm_reg2); 91 void op_movsd_MR (int xmm_reg,int base_reg,int offset,char mod );89 void op_movsd_MR (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None ); 92 90 void op_movss_RR (int xmm_reg1,int xmm_reg2); 93 void op_movss_RM (int xmm_reg,int base_reg,int offset,char mod );94 void op_movss_MR (int xmm_reg,int base_reg,int offset,char mod );91 void op_movss_RM (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None ); 92 void op_movss_MR (int xmm_reg,int base_reg,int offset,char mod, Schedule::Type scheduleType = Schedule::None ); 95 93 void op_movd_RX (int reg,int xmm_reg); 96 94 void op_cvtsd2ss (int xmm_reg1,int xmm_reg2); -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r228 r232 8 8 9 9 void AddLocalVarAddrSchedule(); 10 void ObpPlus( int step = 1 ); 10 11 11 12 class Schedule … … 137 138 extern int obp; 138 139 memcpy( OpBuffer + obp, codeBuffer, size ); 139 obp += size;140 ObpPlus( size ); 140 141 } 141 142 void Put( const NativeCode &nativeCode ) … … 180 181 extern int obp; 181 182 *((long *)(OpBuffer+obp))=l; 182 obp+=sizeof(long);183 ObpPlus( sizeof(long) ); 183 184 } 184 185 void Put( short s ) … … 196 197 extern char *OpBuffer; 197 198 extern int obp; 198 OpBuffer[obp++]=c; 199 OpBuffer[obp]=c; 200 ObpPlus(); 199 201 } 200 202 }; -
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r224 r232 581 581 int offset = IsExistVirtualFunctions() ? PTR_SIZE : 0; 582 582 583 int alignment; 584 if(iAlign) alignment=iAlign; 585 else alignment=1; 583 int alignment = 1; 584 if( GetFixedAlignment() ) 585 { 586 alignment = GetFixedAlignment(); 587 } 586 588 587 589 int iMaxAlign=0; … … 605 607 606 608 //アラインメントを考慮 607 if( iAlign&&iAlign<member_size){609 if(GetFixedAlignment()&&GetFixedAlignment()<member_size){ 608 610 if(offset%alignment) offset+=alignment-(offset%alignment); 609 611 } … … 667 669 if(alignment==0) return 0; 668 670 669 if( iAlign) alignment=iAlign;671 if(GetFixedAlignment()) alignment=GetFixedAlignment(); 670 672 671 673 return alignment; … … 1254 1256 } 1255 1257 1256 pobj_c-> iAlign=iAlign;1258 pobj_c->SetFixedAlignment( iAlign ); 1257 1259 1258 1260 pobj_c->Readed();
Note:
See TracChangeset
for help on using the changeset viewer.