Changeset 226 in dev for trunk/abdev/BasicCompiler_Common
- Timestamp:
- Jul 22, 2007, 4:58:47 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r225 r226 32 32 33 33 #ifdef _AMD64_ 34 private: 35 void set_rex(int op_size,int reg,int index_reg,int base_reg); 36 void set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,long disp); 37 void __op_format(int op_size,char op_prefix,char opcode1,char opcode2,int reg,int base_reg,long offset,char mod); 38 public: 39 void op_mov_RV (int op_size,int reg,long i32data); 40 void op_mov_RV64 (int reg,_int64 i64data); 41 void op_mov_RM (int op_size,int reg,int base_reg,long offset,char mod); 42 void op_mov_RM_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset); 43 void op_mov_MR (int op_size,int reg,int base_reg,long offset,char mod); 44 void op_mov_MR_ex (int op_size,int reg,int base_reg1,int base_reg2,long offset,BOOL bUseOffset); 45 void op_mov_MV (int op_size,int base_reg,int offset,BOOL bUseOffset,long i32data); 46 void op_mov_RR (int reg1,int reg2); 47 void op_mov64_ToReg (int reg,_int64 i64data); 48 void op_mov64_ToReg (int reg,long i32data); 49 void op_movsxd (int reg64,int reg32); 50 void op_movsx64_FromReg16 (int reg64,int reg16); 51 void op_movsx64_FromReg8 (int reg64,int reg8); 52 void op_movsx32_FromReg16 (int reg32,int reg16); 53 void op_movsx32_FromReg8 (int reg32,int reg8); 54 void op_movsx16_FromReg8 (int reg32,int reg8); 55 void op_inc (int reg); 56 void op_dec (int reg); 57 void op_add_RM (int op_size,int reg,int base_reg,int offset,char mod); 58 void op_add_RV (int reg,long offset); 59 void op_add64_reg (int reg1,int reg2); 60 void op_add32_reg (int reg1,int reg2); 61 void op_sub_RV (int op_size,int reg,long i32data); 62 void op_sub64_reg (int reg1,int reg2); 63 void op_sub32_reg (int reg1,int reg2); 64 void op_sbb_RR ( int op_size, int reg1, int reg2 ); 65 void op_imul_RR (int op_size,int reg1,int reg2); 66 void op_imul_RV (int op_size,int reg,long i32data); 67 void op_div64_reg (int reg); 68 void op_idiv64_reg (int reg); 69 void op_shl_reg (int op_size,int reg); 70 void op_sar_reg (int op_size,int reg); 71 void op_shr_reg (int op_size,int reg); 72 void op_and_reg (int op_size,int reg1,int reg2); 73 void op_and64_value (int reg,long offset); 74 void op_and32_value (int reg,long offset); 75 void op_or_reg (int op_size,int reg1,int reg2); 76 void op_xor_reg (int op_size,int reg1,int reg2); 77 void op_not_reg (int op_size,int reg); 78 void op_neg ( int reg ); 79 void op_test (int reg1,int reg2); 80 void op_cmp_reg (int op_size,int reg1,int reg2); 81 void op_cmp_value (int op_size,int reg,char byte_data); 82 void op_setne (int reg); 83 void op_movlpd_MR (int xmm_reg,int base_reg,int offset,char mod); 84 void op_movlpd_RM (int xmm_reg,int base_reg,int offset,char mod); 85 void op_movsd_RR (int xmm_reg1,int xmm_reg2); 86 void op_movsd_MR (int xmm_reg,int base_reg,int offset,char mod); 87 void op_movss_RR (int xmm_reg1,int xmm_reg2); 88 void op_movss_RM (int xmm_reg,int base_reg,int offset,char mod); 89 void op_movss_MR (int xmm_reg,int base_reg,int offset,char mod); 90 void op_movd_RX (int reg,int xmm_reg); 91 void op_cvtsd2ss (int xmm_reg1,int xmm_reg2); 92 void op_cvtss2sd (int xmm_reg1,int xmm_reg2); 93 void op_cvttsd2si_xmm (int op_size,int reg,int xmm_reg); 94 void op_cvttss2si_xmm (int op_size,int reg,int xmm_reg); 95 void op_cvtsi2sd_reg (int op_size,int xmm_reg,int reg); 96 void op_cvtsi2ss_reg (int op_size,int xmm_reg,int reg); 97 void op_comisd (int xmm_reg1,int xmm_reg2); 98 void op_comiss (int xmm_reg1,int xmm_reg2); 99 void op_rep_movs (int op_size); 100 void op_add_rsp(long num); 101 void op_sub_rsp(long num); 102 void op_add_esp(long num); 103 void op_sub_esp(long num); 104 void op_fld_ptr_esp(int type); 105 void op_zero_reg(int reg); 106 void op_call( const UserProc *pUserProc ); 107 void op_call( const DllProc *pDllProc ); 108 void op_ret(); 109 34 110 #else 35 111 private: -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r225 r226 132 132 extern char *OpBuffer; 133 133 extern int obp; 134 memcpy( OpBuffer , codeBuffer, size );134 memcpy( OpBuffer + obp, codeBuffer, size ); 135 135 obp += size; 136 136 } … … 139 139 Put( nativeCode.codeBuffer, nativeCode.size ); 140 140 } 141 void Put( char c)141 void Put( _int64 i64data ) 142 142 { 143 codeBuffer[size++] = c; 144 Realloc(); 145 146 147 148 // 未完成 149 extern char *OpBuffer; 150 extern int obp; 151 OpBuffer[obp++]=c; 143 Put( (const char *)(&i64data), sizeof(_int64) ); 152 144 } 153 145 void Put( long l, Schedule::Type scheduleType = Schedule::None ) … … 169 161 obp+=sizeof(long); 170 162 } 163 void Put( short s ) 164 { 165 Put( (const char *)(&s), sizeof(short) ); 166 } 167 void Put( char c ) 168 { 169 codeBuffer[size++] = c; 170 Realloc(); 171 172 173 174 // 未完成 175 extern char *OpBuffer; 176 extern int obp; 177 OpBuffer[obp++]=c; 178 } 171 179 }; -
trunk/abdev/BasicCompiler_Common/src/LexicalScopingImpl.cpp
r225 r226 98 98 99 99 //mov rcx,qword ptr[rsp+offset] 100 op_mov_RM(sizeof(_int64),REG_RCX,REG_RSP,100 compiler.codeGenerator.op_mov_RM(sizeof(_int64),REG_RCX,REG_RSP, 101 101 -pVar->GetOffsetAddress(), 102 102 MOD_BASE_DISP32);
Note:
See TracChangeset
for help on using the changeset viewer.