[PATCH] D75357: [X86] Add a private member function determinePaddingPrefix for X86AsmBackend

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 07:07:14 PDT 2023


skan added inline comments.


================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:350
+/// If the instruction has a segment override prefix, use the existing one.
+/// If the target is 64-bit, use the CS.
+/// If the target is 32-bit,
----------------
glider wrote:
> Hi Shengchen,
> 
> Out of curiosity, why does this feature use CS instead of DS for instruction padding?
> 
> Also, is there an easy way to trigger this behavior in Clang? I couldn't find any tests for this functionality.
> 
> Thanks!
Hi @glider. the behavior here is to align with GAS, I don't know if there is a specific reason to use CS here. I doubt it's more like a decision.

You can find the tests here

llvm/test/MC/X86/prefix-padding-64.s
llvm/test/MC/X86/prefix-padding-32.s




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75357/new/

https://reviews.llvm.org/D75357



More information about the llvm-commits mailing list