}
func ginsnop(pp *gc.Progs) *obj.Prog {
- // This is actually not the x86 NOP anymore,
- // but at the point where it gets used, AX is dead
- // so it's okay if we lose the high bits.
+ // This is a hardware nop (1-byte 0x90) instruction,
+ // even though we describe it as an explicit XCHGL here.
+ // Particularly, this does not zero the high 32 bits
+ // like typical *L opcodes.
+ // (gas assembles "xchg %eax,%eax" to 0x87 0xc0, which
+ // does zero the high 32 bits.)
p := pp.Prog(x86.AXCHGL)
p.From.Type = obj.TYPE_REG
p.From.Reg = x86.REG_AX