Changeset 228 in dev for trunk/abdev/BasicCompiler64/NumOpe_Arithmetic.cpp
- Timestamp:
- Jul 23, 2007, 3:24:20 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler64/NumOpe_Arithmetic.cpp
r226 r228 37 37 if(idCalc==CALC_ADDITION){ 38 38 //addsd xmm_reg1,xmm_reg2 39 OpBuffer[obp++]=(char)0xF2; 40 OpBuffer[obp++]=(char)0x0F; 41 OpBuffer[obp++]=(char)0x58; 42 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 39 compiler.codeGenerator.PutOld( 40 (char)0xF2, 41 (char)0x0F, 42 (char)0x58, 43 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 44 ); 43 45 } 44 46 else if(idCalc==CALC_SUBTRACTION){ 45 47 //subsd xmm_reg1,xmm_reg2 46 OpBuffer[obp++]=(char)0xF2; 47 OpBuffer[obp++]=(char)0x0F; 48 OpBuffer[obp++]=(char)0x5C; 49 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 48 compiler.codeGenerator.PutOld( 49 (char)0xF2, 50 (char)0x0F, 51 (char)0x5C, 52 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 53 ); 50 54 } 51 55 else if(idCalc==CALC_PRODUCT){ 52 56 //mulsd xmm_reg1,xmm_reg2 53 OpBuffer[obp++]=(char)0xF2; 54 OpBuffer[obp++]=(char)0x0F; 55 OpBuffer[obp++]=(char)0x59; 56 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 57 compiler.codeGenerator.PutOld( 58 (char)0xF2, 59 (char)0x0F, 60 (char)0x59, 61 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 62 ); 57 63 } 58 64 … … 69 75 if(idCalc==CALC_ADDITION){ 70 76 //addss xmm_reg1,xmm_reg2 71 OpBuffer[obp++]=(char)0xF3; 72 OpBuffer[obp++]=(char)0x0F; 73 OpBuffer[obp++]=(char)0x58; 74 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 77 compiler.codeGenerator.PutOld( 78 (char)0xF3, 79 (char)0x0F, 80 (char)0x58, 81 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 82 ); 75 83 } 76 84 else if(idCalc==CALC_SUBTRACTION){ 77 85 //subss xmm_reg1,xmm_reg2 78 OpBuffer[obp++]=(char)0xF3; 79 OpBuffer[obp++]=(char)0x0F; 80 OpBuffer[obp++]=(char)0x5C; 81 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 86 compiler.codeGenerator.PutOld( 87 (char)0xF3, 88 (char)0x0F, 89 (char)0x5C, 90 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 91 ); 82 92 } 83 93 else if(idCalc==CALC_PRODUCT){ 84 94 //mulss xmm_reg1,xmm_reg2 85 OpBuffer[obp++]=(char)0xF3; 86 OpBuffer[obp++]=(char)0x0F; 87 OpBuffer[obp++]=(char)0x59; 88 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 95 compiler.codeGenerator.PutOld( 96 (char)0xF3, 97 (char)0x0F, 98 (char)0x59, 99 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 100 ); 89 101 } 90 102 … … 104 116 if(idCalc==CALC_ADDITION){ 105 117 //add reg1,reg2 106 compiler.codeGenerator.op_add 64_reg(reg1,reg2);118 compiler.codeGenerator.op_add_RR(reg1,reg2); 107 119 } 108 120 else if(idCalc==CALC_SUBTRACTION){ … … 214 226 215 227 //cqo 216 OpBuffer[obp++]=(char)0x48; 217 OpBuffer[obp++]=(char)0x99; 228 compiler.codeGenerator.op_cqo(); 218 229 } 219 230 else{ … … 294 305 295 306 //divsd xmm_reg1,xmm_reg2 296 OpBuffer[obp++]=(char)0xF2; 297 OpBuffer[obp++]=(char)0x0F; 298 OpBuffer[obp++]=(char)0x5E; 299 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 307 compiler.codeGenerator.PutOld( 308 (char)0xF2, 309 (char)0x0F, 310 (char)0x5E, 311 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 312 ); 300 313 301 314 if(xmm_reg1==REG_XMM4){ … … 310 323 311 324 //divss xmm_reg1,xmm_reg2 312 OpBuffer[obp++]=(char)0xF3; 313 OpBuffer[obp++]=(char)0x0F; 314 OpBuffer[obp++]=(char)0x5E; 315 OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)); 325 compiler.codeGenerator.PutOld( 326 (char)0xF3, 327 (char)0x0F, 328 (char)0x5E, 329 (char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2)) 330 ); 316 331 317 332 if(xmm_reg1==REG_XMM4){ … … 390 405 391 406 //cqo 392 OpBuffer[obp++]=(char)0x48; 393 OpBuffer[obp++]=(char)0x99; 407 compiler.codeGenerator.op_cqo(); 394 408 } 395 409 else{
Note:
See TracChangeset
for help on using the changeset viewer.