Mercurial > hg > truffle
comparison src/cpu/x86/vm/assembler_x86.cpp @ 7424:c4bd2eccea46
8004536: replace AbstractAssembler emit_word with emit_int16
Reviewed-by: jrose, kvn, twisti
Contributed-by: Morris Meyer <morris.meyer@oracle.com>
author | twisti |
---|---|
date | Tue, 18 Dec 2012 10:47:23 -0800 |
parents | cd3d6a6b95d9 |
children | 2c7f594145dc |
comparison
equal
deleted
inserted
replaced
7423:620e502e3f47 | 7424:c4bd2eccea46 |
---|---|
1227 InstructionMark im(this); | 1227 InstructionMark im(this); |
1228 assert(!dst.base_needs_rex() && !dst.index_needs_rex(), "no extended registers"); | 1228 assert(!dst.base_needs_rex() && !dst.index_needs_rex(), "no extended registers"); |
1229 emit_byte(0x66); | 1229 emit_byte(0x66); |
1230 emit_byte(0x81); | 1230 emit_byte(0x81); |
1231 emit_operand(rdi, dst, 2); | 1231 emit_operand(rdi, dst, 2); |
1232 emit_word(imm16); | 1232 emit_int16(imm16); |
1233 } | 1233 } |
1234 | 1234 |
1235 // The 32-bit cmpxchg compares the value at adr with the contents of rax, | 1235 // The 32-bit cmpxchg compares the value at adr with the contents of rax, |
1236 // and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. | 1236 // and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. |
1237 // The ZF is set if the compared values were equal, and cleared otherwise. | 1237 // The ZF is set if the compared values were equal, and cleared otherwise. |
1877 | 1877 |
1878 emit_byte(0x66); // switch to 16-bit mode | 1878 emit_byte(0x66); // switch to 16-bit mode |
1879 prefix(dst); | 1879 prefix(dst); |
1880 emit_byte(0xC7); | 1880 emit_byte(0xC7); |
1881 emit_operand(rax, dst, 2); | 1881 emit_operand(rax, dst, 2); |
1882 emit_word(imm16); | 1882 emit_int16(imm16); |
1883 } | 1883 } |
1884 | 1884 |
1885 void Assembler::movw(Register dst, Address src) { | 1885 void Assembler::movw(Register dst, Address src) { |
1886 InstructionMark im(this); | 1886 InstructionMark im(this); |
1887 emit_byte(0x66); | 1887 emit_byte(0x66); |
2569 void Assembler::ret(int imm16) { | 2569 void Assembler::ret(int imm16) { |
2570 if (imm16 == 0) { | 2570 if (imm16 == 0) { |
2571 emit_byte(0xC3); | 2571 emit_byte(0xC3); |
2572 } else { | 2572 } else { |
2573 emit_byte(0xC2); | 2573 emit_byte(0xC2); |
2574 emit_word(imm16); | 2574 emit_int16(imm16); |
2575 } | 2575 } |
2576 } | 2576 } |
2577 | 2577 |
2578 void Assembler::sahf() { | 2578 void Assembler::sahf() { |
2579 #ifdef _LP64 | 2579 #ifdef _LP64 |