class Module;
class GlobalValue;
class TargetMachine;
+
+namespace PICStyle {
+enum Style {
+ Stub, GOT, RIPRel, WinPIC, None
+};
+}
class X86Subtarget : public TargetSubtarget {
public:
enum AsmWriterFlavorTy {
- att, intel, unset
+ // Note: This numbering has to match the GCC assembler dialects for inline
+ // asm alternatives to work right.
+ ATT = 0, Intel = 1, Unset
};
-
protected:
enum X86SSEEnum {
- NoMMXSSE, MMX, SSE1, SSE2, SSE3
+ NoMMXSSE, MMX, SSE1, SSE2, SSE3, SSSE3
};
enum X863DNowEnum {
/// AsmFlavor - Which x86 asm dialect to use.
AsmWriterFlavorTy AsmFlavor;
- /// X86SSELevel - MMX, SSE1, SSE2, SSE3, or none supported.
+ /// PICStyle - Which PIC style to use
+ PICStyle::Style PICStyle;
+
+ /// X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, or none supported.
X86SSEEnum X86SSELevel;
/// X863DNowLevel - 3DNow or 3DNow Athlon, or none supported.
bool is64Bit() const { return Is64Bit; }
+ PICStyle::Style getPICStyle() const { return PICStyle; }
+ void setPICStyle(PICStyle::Style Style) { PICStyle = Style; }
+
bool hasMMX() const { return X86SSELevel >= MMX; }
bool hasSSE1() const { return X86SSELevel >= SSE1; }
bool hasSSE2() const { return X86SSELevel >= SSE2; }
bool hasSSE3() const { return X86SSELevel >= SSE3; }
+ bool hasSSSE3() const { return X86SSELevel >= SSSE3; }
bool has3DNow() const { return X863DNowLevel >= ThreeDNow; }
bool has3DNowA() const { return X863DNowLevel >= ThreeDNowA; }
- bool isFlavorAtt() const { return AsmFlavor == att; }
- bool isFlavorIntel() const { return AsmFlavor == intel; }
+ unsigned getAsmFlavor() const {
+ return AsmFlavor != Unset ? unsigned(AsmFlavor) : 0;
+ }
+
+ bool isFlavorAtt() const { return AsmFlavor == ATT; }
+ bool isFlavorIntel() const { return AsmFlavor == Intel; }
bool isTargetDarwin() const { return TargetType == isDarwin; }
bool isTargetELF() const { return TargetType == isELF; }
TargetType == isCygwin); }
bool isTargetCygwin() const { return TargetType == isCygwin; }
+ bool isPICStyleSet() const { return PICStyle != PICStyle::None; }
+ bool isPICStyleGOT() const { return PICStyle == PICStyle::GOT; }
+ bool isPICStyleStub() const { return PICStyle == PICStyle::Stub; }
+ bool isPICStyleRIPRel() const { return PICStyle == PICStyle::RIPRel; }
+ bool isPICStyleWinPIC() const { return PICStyle == PICStyle:: WinPIC; }
+
/// True if accessing the GV requires an extra load. For Windows, dllimported
/// symbols are indirect, loading the value at address GV rather then the
/// value of GV itself. This means that the GlobalAddress must be in the base