<div dir="ltr">Can you change <span style="font-size:12.8000001907349px">printSSEAVXCC, </span><span style="font-size:12.8000001907349px">printXOPCC, and printRoundingControl back? They were much more concise before.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 27, 2015 at 9:25 PM, Akira Hatanaka <span dir="ltr"><<a href="mailto:ahatanaka@apple.com" target="_blank">ahatanaka@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ahatanak<br>
Date: Fri Mar 27 23:25:41 2015<br>
New Revision: 233473<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=233473&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=233473&view=rev</a><br>
Log:<br>
clang-format X86ATTInstPrinter.{h,cpp} before I make changes to these files.<br>
<br>
Modified:<br>
llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp<br>
llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h<br>
<br>
Modified: llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp?rev=233473&r1=233472&r2=233473&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp?rev=233473&r1=233472&r2=233473&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp Fri Mar 27 23:25:41 2015<br>
@@ -33,11 +33,8 @@ using namespace llvm;<br>
#define PRINT_ALIAS_INSTR<br>
#include "X86GenAsmWriter.inc"<br>
<br>
-void X86ATTInstPrinter::printRegName(raw_ostream &OS,<br>
- unsigned RegNo) const {<br>
- OS << markup("<reg:")<br>
- << '%' << getRegisterName(RegNo)<br>
- << markup(">");<br>
+void X86ATTInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {<br>
+ OS << markup("<reg:") << '%' << getRegisterName(RegNo) << markup(">");<br>
}<br>
<br>
void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,<br>
@@ -76,39 +73,104 @@ void X86ATTInstPrinter::printSSEAVXCC(co<br>
raw_ostream &O) {<br>
int64_t Imm = MI->getOperand(Op).getImm();<br>
switch (Imm) {<br>
- default: llvm_unreachable("Invalid ssecc/avxcc argument!");<br>
- case 0: O << "eq"; break;<br>
- case 1: O << "lt"; break;<br>
- case 2: O << "le"; break;<br>
- case 3: O << "unord"; break;<br>
- case 4: O << "neq"; break;<br>
- case 5: O << "nlt"; break;<br>
- case 6: O << "nle"; break;<br>
- case 7: O << "ord"; break;<br>
- case 8: O << "eq_uq"; break;<br>
- case 9: O << "nge"; break;<br>
- case 0xa: O << "ngt"; break;<br>
- case 0xb: O << "false"; break;<br>
- case 0xc: O << "neq_oq"; break;<br>
- case 0xd: O << "ge"; break;<br>
- case 0xe: O << "gt"; break;<br>
- case 0xf: O << "true"; break;<br>
- case 0x10: O << "eq_os"; break;<br>
- case 0x11: O << "lt_oq"; break;<br>
- case 0x12: O << "le_oq"; break;<br>
- case 0x13: O << "unord_s"; break;<br>
- case 0x14: O << "neq_us"; break;<br>
- case 0x15: O << "nlt_uq"; break;<br>
- case 0x16: O << "nle_uq"; break;<br>
- case 0x17: O << "ord_s"; break;<br>
- case 0x18: O << "eq_us"; break;<br>
- case 0x19: O << "nge_uq"; break;<br>
- case 0x1a: O << "ngt_uq"; break;<br>
- case 0x1b: O << "false_os"; break;<br>
- case 0x1c: O << "neq_os"; break;<br>
- case 0x1d: O << "ge_oq"; break;<br>
- case 0x1e: O << "gt_oq"; break;<br>
- case 0x1f: O << "true_us"; break;<br>
+ default:<br>
+ llvm_unreachable("Invalid ssecc/avxcc argument!");<br>
+ case 0:<br>
+ O << "eq";<br>
+ break;<br>
+ case 1:<br>
+ O << "lt";<br>
+ break;<br>
+ case 2:<br>
+ O << "le";<br>
+ break;<br>
+ case 3:<br>
+ O << "unord";<br>
+ break;<br>
+ case 4:<br>
+ O << "neq";<br>
+ break;<br>
+ case 5:<br>
+ O << "nlt";<br>
+ break;<br>
+ case 6:<br>
+ O << "nle";<br>
+ break;<br>
+ case 7:<br>
+ O << "ord";<br>
+ break;<br>
+ case 8:<br>
+ O << "eq_uq";<br>
+ break;<br>
+ case 9:<br>
+ O << "nge";<br>
+ break;<br>
+ case 0xa:<br>
+ O << "ngt";<br>
+ break;<br>
+ case 0xb:<br>
+ O << "false";<br>
+ break;<br>
+ case 0xc:<br>
+ O << "neq_oq";<br>
+ break;<br>
+ case 0xd:<br>
+ O << "ge";<br>
+ break;<br>
+ case 0xe:<br>
+ O << "gt";<br>
+ break;<br>
+ case 0xf:<br>
+ O << "true";<br>
+ break;<br>
+ case 0x10:<br>
+ O << "eq_os";<br>
+ break;<br>
+ case 0x11:<br>
+ O << "lt_oq";<br>
+ break;<br>
+ case 0x12:<br>
+ O << "le_oq";<br>
+ break;<br>
+ case 0x13:<br>
+ O << "unord_s";<br>
+ break;<br>
+ case 0x14:<br>
+ O << "neq_us";<br>
+ break;<br>
+ case 0x15:<br>
+ O << "nlt_uq";<br>
+ break;<br>
+ case 0x16:<br>
+ O << "nle_uq";<br>
+ break;<br>
+ case 0x17:<br>
+ O << "ord_s";<br>
+ break;<br>
+ case 0x18:<br>
+ O << "eq_us";<br>
+ break;<br>
+ case 0x19:<br>
+ O << "nge_uq";<br>
+ break;<br>
+ case 0x1a:<br>
+ O << "ngt_uq";<br>
+ break;<br>
+ case 0x1b:<br>
+ O << "false_os";<br>
+ break;<br>
+ case 0x1c:<br>
+ O << "neq_os";<br>
+ break;<br>
+ case 0x1d:<br>
+ O << "ge_oq";<br>
+ break;<br>
+ case 0x1e:<br>
+ O << "gt_oq";<br>
+ break;<br>
+ case 0x1f:<br>
+ O << "true_us";<br>
+ break;<br>
}<br>
}<br>
<br>
@@ -116,26 +178,51 @@ void X86ATTInstPrinter::printXOPCC(const<br>
raw_ostream &O) {<br>
int64_t Imm = MI->getOperand(Op).getImm();<br>
switch (Imm) {<br>
- default: llvm_unreachable("Invalid xopcc argument!");<br>
- case 0: O << "lt"; break;<br>
- case 1: O << "le"; break;<br>
- case 2: O << "gt"; break;<br>
- case 3: O << "ge"; break;<br>
- case 4: O << "eq"; break;<br>
- case 5: O << "neq"; break;<br>
- case 6: O << "false"; break;<br>
- case 7: O << "true"; break;<br>
+ default:<br>
+ llvm_unreachable("Invalid xopcc argument!");<br>
+ case 0:<br>
+ O << "lt";<br>
+ break;<br>
+ case 1:<br>
+ O << "le";<br>
+ break;<br>
+ case 2:<br>
+ O << "gt";<br>
+ break;<br>
+ case 3:<br>
+ O << "ge";<br>
+ break;<br>
+ case 4:<br>
+ O << "eq";<br>
+ break;<br>
+ case 5:<br>
+ O << "neq";<br>
+ break;<br>
+ case 6:<br>
+ O << "false";<br>
+ break;<br>
+ case 7:<br>
+ O << "true";<br>
+ break;<br>
}<br>
}<br>
<br>
void X86ATTInstPrinter::printRoundingControl(const MCInst *MI, unsigned Op,<br>
- raw_ostream &O) {<br>
+ raw_ostream &O) {<br>
int64_t Imm = MI->getOperand(Op).getImm() & 0x3;<br>
switch (Imm) {<br>
- case 0: O << "{rn-sae}"; break;<br>
- case 1: O << "{rd-sae}"; break;<br>
- case 2: O << "{ru-sae}"; break;<br>
- case 3: O << "{rz-sae}"; break;<br>
+ case 0:<br>
+ O << "{rn-sae}";<br>
+ break;<br>
+ case 1:<br>
+ O << "{rd-sae}";<br>
+ break;<br>
+ case 2:<br>
+ O << "{ru-sae}";<br>
+ break;<br>
+ case 3:<br>
+ O << "{rz-sae}";<br>
+ break;<br>
}<br>
}<br>
/// printPCRelImm - This is used to print an immediate value that ends up<br>
@@ -169,8 +256,7 @@ void X86ATTInstPrinter::printOperand(con<br>
printRegName(O, Op.getReg());<br>
} else if (Op.isImm()) {<br>
// Print X86 immediates as signed values.<br>
- O << markup("<imm:")<br>
- << '$' << formatImm((int64_t)Op.getImm())<br>
+ O << markup("<imm:") << '$' << formatImm((int64_t)Op.getImm())<br>
<< markup(">");<br>
<br>
// If there are no instruction-specific comments, add a comment clarifying<br>
@@ -182,24 +268,22 @@ void X86ATTInstPrinter::printOperand(con<br>
<br>
} else {<br>
assert(Op.isExpr() && "unknown operand kind in printOperand");<br>
- O << markup("<imm:")<br>
- << '$' << *Op.getExpr()<br>
- << markup(">");<br>
+ O << markup("<imm:") << '$' << *Op.getExpr() << markup(">");<br>
}<br>
}<br>
<br>
void X86ATTInstPrinter::printMemReference(const MCInst *MI, unsigned Op,<br>
raw_ostream &O) {<br>
- const MCOperand &BaseReg = MI->getOperand(Op+X86::AddrBaseReg);<br>
- const MCOperand &IndexReg = MI->getOperand(Op+X86::AddrIndexReg);<br>
- const MCOperand &DispSpec = MI->getOperand(Op+X86::AddrDisp);<br>
- const MCOperand &SegReg = MI->getOperand(Op+X86::AddrSegmentReg);<br>
+ const MCOperand &BaseReg = MI->getOperand(Op + X86::AddrBaseReg);<br>
+ const MCOperand &IndexReg = MI->getOperand(Op + X86::AddrIndexReg);<br>
+ const MCOperand &DispSpec = MI->getOperand(Op + X86::AddrDisp);<br>
+ const MCOperand &SegReg = MI->getOperand(Op + X86::AddrSegmentReg);<br>
<br>
O << markup("<mem:");<br>
<br>
// If this has a segment register, print it.<br>
if (SegReg.getReg()) {<br>
- printOperand(MI, Op+X86::AddrSegmentReg, O);<br>
+ printOperand(MI, Op + X86::AddrSegmentReg, O);<br>
O << ':';<br>
}<br>
<br>
@@ -215,16 +299,14 @@ void X86ATTInstPrinter::printMemReferenc<br>
if (IndexReg.getReg() || BaseReg.getReg()) {<br>
O << '(';<br>
if (BaseReg.getReg())<br>
- printOperand(MI, Op+X86::AddrBaseReg, O);<br>
+ printOperand(MI, Op + X86::AddrBaseReg, O);<br>
<br>
if (IndexReg.getReg()) {<br>
O << ',';<br>
- printOperand(MI, Op+X86::AddrIndexReg, O);<br>
- unsigned ScaleVal = MI->getOperand(Op+X86::AddrScaleAmt).getImm();<br>
+ printOperand(MI, Op + X86::AddrIndexReg, O);<br>
+ unsigned ScaleVal = MI->getOperand(Op + X86::AddrScaleAmt).getImm();<br>
if (ScaleVal != 1) {<br>
- O << ','<br>
- << markup("<imm:")<br>
- << ScaleVal // never printed in hex.<br>
+ O << ',' << markup("<imm:") << ScaleVal // never printed in hex.<br>
<< markup(">");<br>
}<br>
}<br>
@@ -236,13 +318,13 @@ void X86ATTInstPrinter::printMemReferenc<br>
<br>
void X86ATTInstPrinter::printSrcIdx(const MCInst *MI, unsigned Op,<br>
raw_ostream &O) {<br>
- const MCOperand &SegReg = MI->getOperand(Op+1);<br>
+ const MCOperand &SegReg = MI->getOperand(Op + 1);<br>
<br>
O << markup("<mem:");<br>
<br>
// If this has a segment register, print it.<br>
if (SegReg.getReg()) {<br>
- printOperand(MI, Op+1, O);<br>
+ printOperand(MI, Op + 1, O);<br>
O << ':';<br>
}<br>
<br>
@@ -267,13 +349,13 @@ void X86ATTInstPrinter::printDstIdx(cons<br>
void X86ATTInstPrinter::printMemOffset(const MCInst *MI, unsigned Op,<br>
raw_ostream &O) {<br>
const MCOperand &DispSpec = MI->getOperand(Op);<br>
- const MCOperand &SegReg = MI->getOperand(Op+1);<br>
+ const MCOperand &SegReg = MI->getOperand(Op + 1);<br>
<br>
O << markup("<mem:");<br>
<br>
// If this has a segment register, print it.<br>
if (SegReg.getReg()) {<br>
- printOperand(MI, Op+1, O);<br>
+ printOperand(MI, Op + 1, O);<br>
O << ':';<br>
}<br>
<br>
@@ -289,7 +371,6 @@ void X86ATTInstPrinter::printMemOffset(c<br>
<br>
void X86ATTInstPrinter::printU8Imm(const MCInst *MI, unsigned Op,<br>
raw_ostream &O) {<br>
- O << markup("<imm:")<br>
- << '$' << formatImm(MI->getOperand(Op).getImm() & 0xff)<br>
+ O << markup("<imm:") << '$' << formatImm(MI->getOperand(Op).getImm() & 0xff)<br>
<< markup(">");<br>
}<br>
<br>
Modified: llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h?rev=233473&r1=233472&r2=233473&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h?rev=233473&r1=233472&r2=233473&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h (original)<br>
+++ llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h Fri Mar 27 23:25:41 2015<br>
@@ -25,7 +25,7 @@ class X86ATTInstPrinter final : public M<br>
public:<br>
X86ATTInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,<br>
const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)<br>
- : MCInstPrinter(MAI, MII, MRI) {<br>
+ : MCInstPrinter(MAI, MII, MRI) {<br>
// Initialize the set of available features.<br>
setAvailableFeatures(STI.getFeatureBits());<br>
}<br>
@@ -143,7 +143,6 @@ public:<br>
private:<br>
bool HasCustomInstComment;<br>
};<br>
-<br>
}<br>
<br>
#endif<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">~Craig</div>
</div>