[PATCH] D51893: [X86] Teach X86SelectionDAGInfo::EmitTargetCodeForMemcpy about GNUX32

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 11 16:55:34 PDT 2018


craig.topper updated this revision to Diff 165000.
craig.topper added a comment.

Use 0x67 address size prefix for x32. Don't disable movsq with x32.

To make the 0x67 work I had to add AdSize32 and AdSize64 to the CodeGenOnly instructions we use here. These control bits in TSFlags. The encoder will emit a 0x67 when the AdSize value is different than the current mode. I had to do it this way because these instructions aren't carrying any operands once they reach the MC layer so there is nothing else for the encoder to key off of.

I've also altered the Predicates to use IsLP64 and NotLP64 to choose the address size instead of just the mode.

Finally I altered the strings printed by the AsmWriter to explicitly mention the register names so that we will still generate a 0x67 prefix if the assembly is written to a text file and then fed to an assembler to generate a binary. I believe gcc would use an "addr32" prefix here, but I'm not sure our assembler supprots that.


https://reviews.llvm.org/D51893

Files:
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86SelectionDAGInfo.cpp
  test/CodeGen/X86/pr38865.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51893.165000.patch
Type: text/x-patch
Size: 7130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180911/c30746d7/attachment.bin>


More information about the llvm-commits mailing list