BUILT_SOURCES = SparcV8GenRegisterInfo.h.inc SparcV8GenRegisterNames.inc \
SparcV8GenRegisterInfo.inc SparcV8GenInstrNames.inc \
SparcV8GenInstrInfo.inc SparcV8GenAsmWriter.inc \
- SparcV8GenDAGISel.inc
+ SparcV8GenDAGISel.inc SparcV8GenSubtarget.inc
include $(LEVEL)/Makefile.common
include "../Target.td"
+//===----------------------------------------------------------------------===//
+// PowerPC Subtarget features.
+//
+
+def Feature64Bit : SubtargetFeature<"64bit", "bool", "Is64Bit",
+ "Enable 64-bit instructions">;
+
+
//===----------------------------------------------------------------------===//
// Register File Description
//===----------------------------------------------------------------------===//
let TSFlagsShifts = [];
}
+//===----------------------------------------------------------------------===//
+// SPARC processors supported.
+//===----------------------------------------------------------------------===//
+
+def : Processor<"generic", NoItineraries, []>;
+def : Processor<"v8", NoItineraries, []>;
+def : Processor<"v9", NoItineraries, [Feature64Bit]>;
+
//===----------------------------------------------------------------------===//
// Declare the target which we are implementing
//===----------------------------------------------------------------------===//
--- /dev/null
+//===- SparcV8Subtarget.cpp - SPARC Subtarget Information -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SPARC specific subclass of TargetSubtarget.
+//
+//===----------------------------------------------------------------------===//
+
+#include "SparcV8Subtarget.h"
+#include "SparcV8GenSubtarget.inc"
+using namespace llvm;
+
+SparcV8Subtarget::SparcV8Subtarget(const Module &M, const std::string &FS) {
+ // Determine default and user specified characteristics
+ std::string CPU = "generic";
+
+ // FIXME: autodetect host here!
+
+ // Parse features string.
+ ParseSubtargetFeatures(FS, CPU);
+
+};
\ No newline at end of file
--- /dev/null
+//=====-- SparcV8Subtarget.h - Define Subtarget for the SPARC -*- C++ -*--====//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the SPARC specific subclass of TargetSubtarget.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SPARC_SUBTARGET_H
+#define SPARC_SUBTARGET_H
+
+#include "llvm/Target/TargetSubtarget.h"
+#include <string>
+
+namespace llvm {
+ class Module;
+
+class SparcV8Subtarget : public TargetSubtarget {
+ bool Is64Bit;
+public:
+ SparcV8Subtarget(const Module &M, const std::string &FS);
+
+ bool is64Bit() const { return Is64Bit; }
+
+ /// ParseSubtargetFeatures - Parses features string setting specified
+ /// subtarget options. Definition of function is auto generated by tblgen.
+ void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
+
+};
+
+} // end namespace llvm
+
+#endif
IntrinsicLowering *IL,
const std::string &FS)
: TargetMachine("SparcV8", IL, false, 4, 4),
+ Subtarget(M, FS),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/PassManager.h"
#include "SparcV8InstrInfo.h"
+#include "SparcV8Subtarget.h"
namespace llvm {
class Module;
class SparcV8TargetMachine : public TargetMachine {
+ SparcV8Subtarget Subtarget;
SparcV8InstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
public:
virtual const SparcV8InstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
+ virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
virtual const MRegisterInfo *getRegisterInfo() const {
return &InstrInfo.getRegisterInfo();
}
BUILT_SOURCES = SparcV8GenRegisterInfo.h.inc SparcV8GenRegisterNames.inc \
SparcV8GenRegisterInfo.inc SparcV8GenInstrNames.inc \
SparcV8GenInstrInfo.inc SparcV8GenAsmWriter.inc \
- SparcV8GenDAGISel.inc
+ SparcV8GenDAGISel.inc SparcV8GenSubtarget.inc
include $(LEVEL)/Makefile.common
include "../Target.td"
+//===----------------------------------------------------------------------===//
+// PowerPC Subtarget features.
+//
+
+def Feature64Bit : SubtargetFeature<"64bit", "bool", "Is64Bit",
+ "Enable 64-bit instructions">;
+
+
//===----------------------------------------------------------------------===//
// Register File Description
//===----------------------------------------------------------------------===//
let TSFlagsShifts = [];
}
+//===----------------------------------------------------------------------===//
+// SPARC processors supported.
+//===----------------------------------------------------------------------===//
+
+def : Processor<"generic", NoItineraries, []>;
+def : Processor<"v8", NoItineraries, []>;
+def : Processor<"v9", NoItineraries, [Feature64Bit]>;
+
//===----------------------------------------------------------------------===//
// Declare the target which we are implementing
//===----------------------------------------------------------------------===//
--- /dev/null
+//===- SparcV8Subtarget.cpp - SPARC Subtarget Information -----------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SPARC specific subclass of TargetSubtarget.
+//
+//===----------------------------------------------------------------------===//
+
+#include "SparcV8Subtarget.h"
+#include "SparcV8GenSubtarget.inc"
+using namespace llvm;
+
+SparcV8Subtarget::SparcV8Subtarget(const Module &M, const std::string &FS) {
+ // Determine default and user specified characteristics
+ std::string CPU = "generic";
+
+ // FIXME: autodetect host here!
+
+ // Parse features string.
+ ParseSubtargetFeatures(FS, CPU);
+
+};
\ No newline at end of file
--- /dev/null
+//=====-- SparcV8Subtarget.h - Define Subtarget for the SPARC -*- C++ -*--====//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Chris Lattner and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the SPARC specific subclass of TargetSubtarget.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SPARC_SUBTARGET_H
+#define SPARC_SUBTARGET_H
+
+#include "llvm/Target/TargetSubtarget.h"
+#include <string>
+
+namespace llvm {
+ class Module;
+
+class SparcV8Subtarget : public TargetSubtarget {
+ bool Is64Bit;
+public:
+ SparcV8Subtarget(const Module &M, const std::string &FS);
+
+ bool is64Bit() const { return Is64Bit; }
+
+ /// ParseSubtargetFeatures - Parses features string setting specified
+ /// subtarget options. Definition of function is auto generated by tblgen.
+ void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
+
+};
+
+} // end namespace llvm
+
+#endif
IntrinsicLowering *IL,
const std::string &FS)
: TargetMachine("SparcV8", IL, false, 4, 4),
+ Subtarget(M, FS),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/PassManager.h"
#include "SparcV8InstrInfo.h"
+#include "SparcV8Subtarget.h"
namespace llvm {
class Module;
class SparcV8TargetMachine : public TargetMachine {
+ SparcV8Subtarget Subtarget;
SparcV8InstrInfo InstrInfo;
TargetFrameInfo FrameInfo;
public:
virtual const SparcV8InstrInfo *getInstrInfo() const { return &InstrInfo; }
virtual const TargetFrameInfo *getFrameInfo() const { return &FrameInfo; }
+ virtual const TargetSubtarget *getSubtargetImpl() const{ return &Subtarget; }
virtual const MRegisterInfo *getRegisterInfo() const {
return &InstrInfo.getRegisterInfo();
}