Changeset 263 in dev for trunk/abdev/BasicCompiler64/stack_frame.cpp
- Timestamp:
- Aug 5, 2007, 3:47:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/stack_frame.cpp
r232 r263 39 39 40 40 //add reg,now_sp 41 compiler.codeGenerator.op_add_RV( reg, now_sp ); 42 43 //スケジュールをセット 44 obp-=sizeof(long); 45 add(); 46 obp+=sizeof(long); 41 pertialSchedules.push_back( 42 compiler.codeGenerator.op_add_RV( reg, now_sp, Schedule::None, true ) 43 ); 47 44 } 48 45 int CStackFrame::push(int reg){ … … 53 50 54 51 //mov qword ptr[rsp+offset],reg 55 compiler.codeGenerator.op_mov_MR(sizeof(_int64),reg,REG_RSP,now_sp,MOD_BASE_DISP32); 56 57 //スケジュールをセット 58 obp-=sizeof(long); 59 add(); 60 obp+=sizeof(long); 52 pertialSchedules.push_back( 53 compiler.codeGenerator.op_mov_MR(sizeof(_int64),reg,REG_RSP,now_sp,MOD_BASE_DISP32, Schedule::None, true) 54 ); 61 55 62 56 return now_sp; … … 68 62 if(varSize==sizeof(double)){ 69 63 //movlpd qword ptr[rsp+offset],xmm_reg 70 compiler.codeGenerator.op_movlpd_MR(xmm_reg,REG_RSP,now_sp,MOD_BASE_DISP32); 64 pertialSchedules.push_back( 65 compiler.codeGenerator.op_movlpd_MR(xmm_reg,REG_RSP,now_sp,MOD_BASE_DISP32, Schedule::None, true ) 66 ); 71 67 } 72 68 if(varSize==sizeof(float)){ 73 69 //movss dword ptr[rsp+offset],xmm_reg 74 compiler.codeGenerator.op_movss_MR( xmm_reg, REG_RSP, now_sp, MOD_BASE_DISP32 ); 70 pertialSchedules.push_back( 71 compiler.codeGenerator.op_movss_MR( xmm_reg, REG_RSP, now_sp, MOD_BASE_DISP32, Schedule::None, true ) 72 ); 75 73 } 76 77 //スケジュールをセット78 obp-=sizeof(long);79 add();80 obp+=sizeof(long);81 74 } 82 75 void CStackFrame::ref_offset_data( int reg, int sp_offset ){ 83 76 //mov reg,qword ptr[rsp+offset] ※スタックフレームを利用 84 compiler.codeGenerator.op_mov_RM(sizeof(_int64),reg,REG_RSP,sp_offset,MOD_BASE_DISP32); 85 86 //スケジュールをセット 87 obp-=sizeof(long); 88 add(); 89 obp+=sizeof(long); 77 pertialSchedules.push_back( 78 compiler.codeGenerator.op_mov_RM(sizeof(_int64),reg,REG_RSP,sp_offset,MOD_BASE_DISP32, Schedule::None, true ) 79 ); 90 80 } 91 81 void CStackFrame::ref(int reg){ … … 95 85 if(varSize==sizeof(double)){ 96 86 //movlpd xmm_reg,qword ptr[rsp+offset] 97 compiler.codeGenerator.op_movlpd_RM(xmm_reg,REG_RSP,now_sp,MOD_BASE_DISP32); 87 pertialSchedules.push_back( 88 compiler.codeGenerator.op_movlpd_RM(xmm_reg,REG_RSP,now_sp,MOD_BASE_DISP32, Schedule::None, true ) 89 ); 98 90 } 99 91 if(varSize==sizeof(float)){ 100 92 //movss xmm_reg,dword ptr[rsp+offset] 101 compiler.codeGenerator.op_movss_MR( xmm_reg, REG_RSP, now_sp, MOD_BASE_DISP32 ); 93 pertialSchedules.push_back( 94 compiler.codeGenerator.op_movss_MR( xmm_reg, REG_RSP, now_sp, MOD_BASE_DISP32, Schedule::None, true ) 95 ); 102 96 } 103 104 //スケジュールをセット105 obp-=sizeof(long);106 add();107 obp+=sizeof(long);108 97 } 109 98 void CStackFrame::pop(int reg){ … … 121 110 } 122 111 void CStackFrame::RunningSchedule( int stackFrameSize ){ 123 for(int i=0;i<num;i++){ 124 *((long *)(OpBuffer+pObpValues[i])) += stackFrameSize; 112 BOOST_FOREACH( const PertialSchedule *pPertialSchedule, pertialSchedules ) 113 { 114 compiler.codeGenerator.opfix_offset( pPertialSchedule, stackFrameSize ); 125 115 } 126 116 }
Note:
See TracChangeset
for help on using the changeset viewer.