[PATCH] D23166: [X86] Improve code size on X86 segment moves

Nirav Davé via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 10:45:39 PDT 2016


The ISA doesn't actually have a 32-bit mov instruction of this form (though
all the processors I've seen accept the bytes pattern associated with the
32-bit variant). I doubt that anyone dealing with explicit segment
twiddling ever wants the effectless prefix added. AFAIK these instructions
are only ever emitted via explicit assembly so they it would be easy enough
to add the byte via an explicit ".byte" directive.

Ideally we'd only have the 16-bit mov instruction which accepts but ignores
the OpSize prefix, but we need to accept the text syntax "mov %eax, %fs" to
handle what objdump dumps, hence this workaround.

-Nirav








On Thu, Aug 4, 2016 at 1:25 PM, Reid Kleckner <rnk at google.com> wrote:

> rnk added a comment.
>
> I dono, if someone really writes `movl %eax, %cs` I would assume they
> really want the prefix, right? Obviously gas does something else, but
> that's surprising to me.
>
>
> https://reviews.llvm.org/D23166
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160804/44357ec5/attachment.html>


More information about the llvm-commits mailing list