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

Nirav Dave via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 8 08:39:23 PDT 2016


niravd added a comment.

Adding Joerg's and my comments below because phabricator dropped them on the floor.

> Nirav said:




> 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.




> Joerg Sonnenberger said:




> Sometimes people want explicitly sized assembler for later runtime

>  patching. I'm not sure it matters in this case.




> Joerg



https://reviews.llvm.org/D23166





More information about the llvm-commits mailing list