On 7/10/19 8:21 PM, Jan Bobek wrote:
> Doesn't B8 (without REX.W) work for x86_64, too? It zeroes the upper
> part of the destination, so it's effectively zero-extending, and it's
> one byte shorter than C7 (no ModR/M byte needed).

Sorry, I shouldn't have been quite so terse.  What I meant is

  if (!$is_x86_64 || (0 <= $imm && $imm <= 0xffffffff))

so that 32-bit always uses the 5-byte encoding instead of the 6-byte.


> That being said, I moved most of this function to risugen_x86_asm and
> included a bunch of comments regarding different cases, so it should
> be easier to understand.

Great.


r~

Reply via email to