David Woodhouse via llvm-dev
2018-Feb-07 23:40 UTC
[llvm-dev] retpoline mitigation and 6.0
On Wed, 2018-02-07 at 23:30 +0000, Chandler Carruth wrote:> This should go to llvm-commits as a proper review. Do you want to do > that David? Want someone on our end to pick it up?I'll attempt to add some test cases... -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5213 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180207/e0581a56/attachment.bin>
I'll save you a review iteration. This is updated to match llvm coding
style. Capital camel case variable names and uses LLVM_FALLTHROUGH instead
of the comment.
static bool printAsmMRegister(X86AsmPrinter &P, const MachineOperand
&MO,
char Mode, raw_ostream &O) {
unsigned Reg = MO.getReg();
+ bool EmitPercent = true;
+
switch (Mode) {
default: return true; // Unknown mode.
case 'b': // Print QImode register
@@ -384,6 +386,9 @@ static bool printAsmMRegister(X86AsmPrinter &P, const
MachineOperand &MO,
case 'k': // Print SImode register
Reg = getX86SubSuperRegister(Reg, 32);
break;
+ case 'V':
+ EmitPercent = false;
+ LLVM_FALLTHROUGH;
case 'q':
// Print 64-bit register names if 64-bit integer registers are
available.
// Otherwise, print 32-bit register names.
@@ -391,7 +396,10 @@ static bool printAsmMRegister(X86AsmPrinter &P, const
MachineOperand &MO,
break;
}
- O << '%' << X86ATTInstPrinter::getRegisterName(Reg);
+ if (EmitPercent)
+ O << '%';
+
+ O << X86ATTInstPrinter::getRegisterName(Reg);
return false;
}
~Craig
On Wed, Feb 7, 2018 at 3:40 PM, David Woodhouse via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On Wed, 2018-02-07 at 23:30 +0000, Chandler Carruth wrote:
> > This should go to llvm-commits as a proper review. Do you want to do
> > that David? Want someone on our end to pick it up?
>
> I'll attempt to add some test cases...
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20180207/cbe675cb/attachment-0001.html>
David Woodhouse via llvm-dev
2018-Feb-08 00:07 UTC
[llvm-dev] retpoline mitigation and 6.0
On Wed, 2018-02-07 at 15:47 -0800, Craig Topper wrote:> I'll save you a review iteration. This is updated to match llvm > coding style. Capital camel case variable names and uses > LLVM_FALLTHROUGH instead of the comment.Thanks. How's this for a test? ; RUN: llc < %s -mtriple=i686-- -no-integrated-as | FileCheck -check-prefix=X86 %s ; RUN: llc < %s -mtriple=x86_64-- -no-integrated-as | FileCheck -check-prefix=X64 %s ; If the target does not have 64-bit integer registers, emit 32-bit register ; names. ; X86: calll __x86_indirect_thunk_e{{[abcd]}}x ; X64: callq __x86_indirect_thunk_r define void @q_modifier(i32* %p) { entry: tail call void asm sideeffect "call __x86_indirect_thunk_${0:V}", "r,~{dirflag},~{fpsr},~{flags}"(i32* %p) ret void } -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 5213 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180208/0f3de7de/attachment.bin>