Mercurial > hg > graal-compiler
comparison src/cpu/x86/vm/assembler_x86.cpp @ 643:c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
Summary: bitCount() should use POPC on SPARC processors where POPC is implemented directly in hardware.
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Fri, 13 Mar 2009 11:35:17 -0700 |
parents | 660978a2a31a |
children | c517646eef23 |
comparison
equal
deleted
inserted
replaced
642:660978a2a31a | 643:c771b7f43bbf |
---|---|
2191 void Assembler::pop(Register dst) { | 2191 void Assembler::pop(Register dst) { |
2192 int encode = prefix_and_encode(dst->encoding()); | 2192 int encode = prefix_and_encode(dst->encoding()); |
2193 emit_byte(0x58 | encode); | 2193 emit_byte(0x58 | encode); |
2194 } | 2194 } |
2195 | 2195 |
2196 void Assembler::popcntl(Register dst, Address src) { | |
2197 assert(VM_Version::supports_popcnt(), "must support"); | |
2198 InstructionMark im(this); | |
2199 emit_byte(0xF3); | |
2200 prefix(src, dst); | |
2201 emit_byte(0x0F); | |
2202 emit_byte(0xB8); | |
2203 emit_operand(dst, src); | |
2204 } | |
2205 | |
2206 void Assembler::popcntl(Register dst, Register src) { | |
2207 assert(VM_Version::supports_popcnt(), "must support"); | |
2208 emit_byte(0xF3); | |
2209 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
2210 emit_byte(0x0F); | |
2211 emit_byte(0xB8); | |
2212 emit_byte(0xC0 | encode); | |
2213 } | |
2214 | |
2196 void Assembler::popf() { | 2215 void Assembler::popf() { |
2197 emit_byte(0x9D); | 2216 emit_byte(0x9D); |
2198 } | 2217 } |
2199 | 2218 |
2200 void Assembler::popl(Address dst) { | 2219 void Assembler::popl(Address dst) { |
4076 movq(rdx, Address(rsp, 13 * wordSize)); | 4095 movq(rdx, Address(rsp, 13 * wordSize)); |
4077 movq(rcx, Address(rsp, 14 * wordSize)); | 4096 movq(rcx, Address(rsp, 14 * wordSize)); |
4078 movq(rax, Address(rsp, 15 * wordSize)); | 4097 movq(rax, Address(rsp, 15 * wordSize)); |
4079 | 4098 |
4080 addq(rsp, 16 * wordSize); | 4099 addq(rsp, 16 * wordSize); |
4100 } | |
4101 | |
4102 void Assembler::popcntq(Register dst, Address src) { | |
4103 assert(VM_Version::supports_popcnt(), "must support"); | |
4104 InstructionMark im(this); | |
4105 emit_byte(0xF3); | |
4106 prefixq(src, dst); | |
4107 emit_byte(0x0F); | |
4108 emit_byte(0xB8); | |
4109 emit_operand(dst, src); | |
4110 } | |
4111 | |
4112 void Assembler::popcntq(Register dst, Register src) { | |
4113 assert(VM_Version::supports_popcnt(), "must support"); | |
4114 emit_byte(0xF3); | |
4115 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
4116 emit_byte(0x0F); | |
4117 emit_byte(0xB8); | |
4118 emit_byte(0xC0 | encode); | |
4081 } | 4119 } |
4082 | 4120 |
4083 void Assembler::popq(Address dst) { | 4121 void Assembler::popq(Address dst) { |
4084 InstructionMark im(this); | 4122 InstructionMark im(this); |
4085 prefixq(dst); | 4123 prefixq(dst); |