emit_rm in MacroAssembler
Christian Thalinger
Christian.Thalinger at Sun.COM
Mon Feb 23 11:44:43 PST 2009
On Mon, 2009-02-23 at 11:26 -0800, Tom Rodriguez wrote:
> They aren't structured the same at all. I think you want something
> like this for the 64 bit reg/reg:
>
> emit_byte(0xF3);
> int encode = prefixq_and_encode(dst->encoding(), src->encoding());
> emit_byte(0x0f);
> emit_byte(0xb8);
> emit_byte(0xc0 | encode);
>
> The prefix* family of functions take care of emitting the proper REXs
> and masking the registers down to 3 bits. Use the regular
> prefix_and_encode for popcntl.
That's almost exactly what I did:
+void Assembler::popcntl(Register dst, Register src) {
+ //assert(VM_Version::supports_popcnt(), "must support");
+ emit_byte(0xF3);
+ int encode = prefix_and_encode(dst->encoding(), src->encoding());
+ emit_byte(0x0F);
+ emit_byte(0xB8);
+ emit_byte(encode);
+}
But your code emits the correct instruction :-) Shouldn't the 0xC0 part
be in some kind of function?
-- Christian
More information about the hotspot-compiler-dev
mailing list