OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } | 559 } |
560 | 560 |
561 void cmpb(const Operand& dst, Immediate src) { | 561 void cmpb(const Operand& dst, Immediate src) { |
562 immediate_arithmetic_op_8(0x7, dst, src); | 562 immediate_arithmetic_op_8(0x7, dst, src); |
563 } | 563 } |
564 | 564 |
565 void cmpl(Register dst, Register src) { | 565 void cmpl(Register dst, Register src) { |
566 arithmetic_op_32(0x3B, dst, src); | 566 arithmetic_op_32(0x3B, dst, src); |
567 } | 567 } |
568 | 568 |
| 569 void cmpl(Register dst, const Operand& src) { |
| 570 arithmetic_op_32(0x3B, src, dst); |
| 571 } |
| 572 |
| 573 void cmpl(const Operand& dst, Register src) { |
| 574 arithmetic_op_32(0x39, dst, src); |
| 575 } |
| 576 |
569 void cmpl(Register dst, Immediate src) { | 577 void cmpl(Register dst, Immediate src) { |
570 immediate_arithmetic_op_32(0x7, dst, src); | 578 immediate_arithmetic_op_32(0x7, dst, src); |
571 } | 579 } |
572 | 580 |
| 581 void cmpl(const Operand& dst, Immediate src) { |
| 582 immediate_arithmetic_op_32(0x7, dst, src); |
| 583 } |
| 584 |
573 void cmpq(Register dst, Register src) { | 585 void cmpq(Register dst, Register src) { |
574 arithmetic_op(0x3B, dst, src); | 586 arithmetic_op(0x3B, dst, src); |
575 } | 587 } |
576 | 588 |
577 void cmpq(Register dst, const Operand& src) { | 589 void cmpq(Register dst, const Operand& src) { |
578 arithmetic_op(0x3B, dst, src); | 590 arithmetic_op(0x3B, dst, src); |
579 } | 591 } |
580 | 592 |
581 void cmpq(const Operand& dst, Register src) { | 593 void cmpq(const Operand& dst, Register src) { |
582 arithmetic_op(0x39, src, dst); | 594 arithmetic_op(0x39, src, dst); |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 | 1096 |
1085 // Emit the code-object-relative offset of the label's position | 1097 // Emit the code-object-relative offset of the label's position |
1086 inline void emit_code_relative_offset(Label* label); | 1098 inline void emit_code_relative_offset(Label* label); |
1087 | 1099 |
1088 // Emit machine code for one of the operations ADD, ADC, SUB, SBC, | 1100 // Emit machine code for one of the operations ADD, ADC, SUB, SBC, |
1089 // AND, OR, XOR, or CMP. The encodings of these operations are all | 1101 // AND, OR, XOR, or CMP. The encodings of these operations are all |
1090 // similar, differing just in the opcode or in the reg field of the | 1102 // similar, differing just in the opcode or in the reg field of the |
1091 // ModR/M byte. | 1103 // ModR/M byte. |
1092 void arithmetic_op(byte opcode, Register dst, Register src); | 1104 void arithmetic_op(byte opcode, Register dst, Register src); |
1093 void arithmetic_op_32(byte opcode, Register dst, Register src); | 1105 void arithmetic_op_32(byte opcode, Register dst, Register src); |
| 1106 void arithmetic_op_32(byte opcode, const Operand& dst, Register src); |
1094 void arithmetic_op(byte opcode, Register reg, const Operand& op); | 1107 void arithmetic_op(byte opcode, Register reg, const Operand& op); |
1095 void immediate_arithmetic_op(byte subcode, Register dst, Immediate src); | 1108 void immediate_arithmetic_op(byte subcode, Register dst, Immediate src); |
1096 void immediate_arithmetic_op(byte subcode, const Operand& dst, Immediate src); | 1109 void immediate_arithmetic_op(byte subcode, const Operand& dst, Immediate src); |
1097 // Operate on a 32-bit word in memory or register. | 1110 // Operate on a 32-bit word in memory or register. |
1098 void immediate_arithmetic_op_32(byte subcode, | 1111 void immediate_arithmetic_op_32(byte subcode, |
1099 const Operand& dst, | 1112 const Operand& dst, |
1100 Immediate src); | 1113 Immediate src); |
1101 void immediate_arithmetic_op_32(byte subcode, | 1114 void immediate_arithmetic_op_32(byte subcode, |
1102 Register dst, | 1115 Register dst, |
1103 Immediate src); | 1116 Immediate src); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 private: | 1187 private: |
1175 Assembler* assembler_; | 1188 Assembler* assembler_; |
1176 #ifdef DEBUG | 1189 #ifdef DEBUG |
1177 int space_before_; | 1190 int space_before_; |
1178 #endif | 1191 #endif |
1179 }; | 1192 }; |
1180 | 1193 |
1181 } } // namespace v8::internal | 1194 } } // namespace v8::internal |
1182 | 1195 |
1183 #endif // V8_X64_ASSEMBLER_X64_H_ | 1196 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |