Re: [tip: x86/cleanups] x86/segment: Use MOVL when reading segment registers

From: H. Peter Anvin

Date: Thu Mar 12 2026 - 15:11:42 EST


On 2026-03-12 02:30, Uros Bizjak wrote:
>
> We would like to always use MOVL to avoid 0x66 operand size override
> prefix when reading to a register, but MOVL does not support memory
> operands. MOVW is required in this case.
>

Just use "mov" without any suffix.

GAS LISTING movseg.s page 1


1 .text
2
3 0000 8CD8 mov %ds,%eax
4 0002 668CD8 mov %ds,%ax
5 0005 8C1B mov %ds,(%rbx)

-hpa