[llvm-commits] CVS: llvm/lib/Target/PowerPC/PowerPC.td Makefile PowerPCAsmPrinter.cpp
Misha Brukman
brukman at cs.uiuc.edu
Sat Sep 4 19:42:54 PDT 2004
Changes in directory llvm/lib/Target/PowerPC:
PowerPC.td updated: 1.8 -> 1.9
Makefile updated: 1.11 -> 1.12
PowerPCAsmPrinter.cpp updated: 1.60 -> 1.61
---
Log message:
* Change PPC32AsmPrinter => PowerPCAsmPrinter since it is now shared between
Darwin and AIX and is not 32- or 64-bit specific
* Bring back PowerPC.td as a result, to make it use the `PowerPC' class name
* Adjust Makefile accordingly
---
Diffs of the changes: (+59 -13)
Index: llvm/lib/Target/PowerPC/PowerPC.td
diff -u /dev/null llvm/lib/Target/PowerPC/PowerPC.td:1.9
--- /dev/null Sat Sep 4 21:42:54 2004
+++ llvm/lib/Target/PowerPC/PowerPC.td Sat Sep 4 21:42:44 2004
@@ -0,0 +1,45 @@
+//===- PowerPC.td - Describe the PowerPC Target Machine ----*- tablegen -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//
+//===----------------------------------------------------------------------===//
+
+// Get the target-independent interfaces which we are implementing...
+//
+include "../Target.td"
+
+//===----------------------------------------------------------------------===//
+// Register File Description
+//===----------------------------------------------------------------------===//
+
+include "PPC64RegisterInfo.td"
+include "PowerPCInstrInfo.td"
+
+def PowerPCInstrInfo : InstrInfo {
+ let PHIInst = PHI;
+
+ let TSFlagsFields = ["ArgCount", "Arg0Type", "Arg1Type", "Arg2Type",
+ "Arg3Type", "Arg4Type", "VMX", "PPC64"];
+ let TSFlagsShifts = [ 0, 3, 8, 13, 18, 23, 28, 29 ];
+}
+
+def PowerPC : Target {
+ // Pointers on PowerPC are 64-bits in size.
+ let PointerType = i64;
+
+ // According to the Mach-O Runtime ABI, these regs are nonvolatile across
+ // calls
+ let CalleeSavedRegisters = [R1, R13, R14, R15, R16, R17, R18, R19,
+ R20, R21, R22, R23, R24, R25, R26, R27, R28, R29, R30, R31, F14, F15,
+ F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29,
+ F30, F31, CR2, CR3, CR4, LR];
+
+ // Pull in Instruction Info:
+ let InstructionSet = PowerPCInstrInfo;
+}
Index: llvm/lib/Target/PowerPC/Makefile
diff -u llvm/lib/Target/PowerPC/Makefile:1.11 llvm/lib/Target/PowerPC/Makefile:1.12
--- llvm/lib/Target/PowerPC/Makefile:1.11 Tue Aug 17 00:11:54 2004
+++ llvm/lib/Target/PowerPC/Makefile Sat Sep 4 21:42:44 2004
@@ -44,7 +44,7 @@
@echo "Building $(TARGET) code emitter"
$(VERB) $(TBLGEN) -I $(SourceDir) $< -gen-emitter -o $@
-$(TARGET)GenAsmWriter.inc:: PPC32.td $(TDFILES) $(TBLGEN)
+$(TARGET)GenAsmWriter.inc:: PowerPC.td $(TDFILES) $(TBLGEN)
@echo "Building $(TARGET).td assembly writer with tblgen"
$(VERB) $(TBLGEN) -I $(SourceDir) $< -gen-asm-writer -o $@
Index: llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.60 llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.61
--- llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp:1.60 Sat Sep 4 09:51:26 2004
+++ llvm/lib/Target/PowerPC/PowerPCAsmPrinter.cpp Sat Sep 4 21:42:44 2004
@@ -40,11 +40,11 @@
namespace {
Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
- struct PPC32AsmPrinter : public AsmPrinter {
+ struct PowerPCAsmPrinter : public AsmPrinter {
std::set<std::string> FnStubs, GVStubs, LinkOnceStubs;
std::set<std::string> Strings;
- PPC32AsmPrinter(std::ostream &O, TargetMachine &TM)
+ PowerPCAsmPrinter(std::ostream &O, TargetMachine &TM)
: AsmPrinter(O, TM), LabelNumber(0) {}
/// Unique incrementer for label values for referencing Global values.
@@ -142,12 +142,13 @@
virtual bool doFinalization(Module &M) = 0;
};
- //
- //
- struct DarwinAsmPrinter : public PPC32AsmPrinter {
+ /// DarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac OS
+ /// X
+ ///
+ struct DarwinAsmPrinter : public PowerPCAsmPrinter {
DarwinAsmPrinter(std::ostream &O, TargetMachine &TM)
- : PPC32AsmPrinter(O, TM) {
+ : PowerPCAsmPrinter(O, TM) {
CommentString = ";";
GlobalPrefix = "_";
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
@@ -164,15 +165,15 @@
bool doFinalization(Module &M);
};
- //
- //
- struct AIXAsmPrinter : public PPC32AsmPrinter {
+ /// AIXAsmPrinter - PowerPC assembly printer, customized for AIX
+ ///
+ struct AIXAsmPrinter : public PowerPCAsmPrinter {
/// Map for labels corresponding to global variables
///
std::map<const GlobalVariable*,std::string> GVToLabelMap;
AIXAsmPrinter(std::ostream &O, TargetMachine &TM)
- : PPC32AsmPrinter(O, TM) {
+ : PowerPCAsmPrinter(O, TM) {
CommentString = "#";
GlobalPrefix = "_";
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
@@ -306,7 +307,7 @@
// Include the auto-generated portion of the assembly writer
#include "PowerPCGenAsmWriter.inc"
-void PPC32AsmPrinter::printOp(const MachineOperand &MO,
+void PowerPCAsmPrinter::printOp(const MachineOperand &MO,
bool LoadAddrOp /* = false */) {
const MRegisterInfo &RI = *TM.getRegisterInfo();
int new_symbol;
@@ -391,7 +392,7 @@
/// printMachineInstruction -- Print out a single PowerPC MI in Darwin syntax to
/// the current output stream.
///
-void PPC32AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
+void PowerPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
++EmittedInsts;
if (printInstruction(MI))
return; // Printer was automatically generated
More information about the llvm-commits
mailing list