move an enum from TM -> TargetOptions. This makes TargetOptions.h
[oota-llvm.git] / include / llvm / Target / TargetOptions.h
1 //===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines command line option flags that are shared across various
11 // targets.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_TARGET_TARGETOPTIONS_H
16 #define LLVM_TARGET_TARGETOPTIONS_H
17
18 namespace llvm {
19   // Possible float ABI settings. Used with FloatABIType in TargetOptions.h.
20   namespace FloatABI {
21     enum ABIType {
22       Default, // Target-specific (either soft of hard depending on triple, etc).
23       Soft, // Soft float.
24       Hard  // Hard float.
25     };
26   }
27   
28   /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
29   /// option is specified on the command line, and should enable debugging
30   /// output from the code generator.
31   extern bool PrintMachineCode;
32
33   /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is
34   /// specified on the command line.  If the target supports the frame pointer
35   /// elimination optimization, this option should disable it.
36   extern bool NoFramePointerElim;
37
38   /// LessPreciseFPMAD - This flag is enabled when the
39   /// -enable-fp-mad is specified on the command line.  When this flag is off
40   /// (the default), the code generator is not allowed to generate mad
41   /// (multiply add) if the result is "less precise" than doing those operations
42   /// individually.
43   extern bool LessPreciseFPMADOption;
44   extern bool LessPreciseFPMAD();
45
46   /// NoExcessFPPrecision - This flag is enabled when the
47   /// -disable-excess-fp-precision flag is specified on the command line.  When
48   /// this flag is off (the default), the code generator is allowed to produce
49   /// results that are "more precise" than IEEE allows.  This includes use of
50   /// FMA-like operations and use of the X86 FP registers without rounding all
51   /// over the place.
52   extern bool NoExcessFPPrecision;
53
54   /// UnsafeFPMath - This flag is enabled when the
55   /// -enable-unsafe-fp-math flag is specified on the command line.  When
56   /// this flag is off (the default), the code generator is not allowed to
57   /// produce results that are "less precise" than IEEE allows.  This includes
58   /// use of X86 instructions like FSIN and FCOS instead of libcalls.
59   /// UnsafeFPMath implies FiniteOnlyFPMath and LessPreciseFPMAD.
60   extern bool UnsafeFPMath;
61
62   /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
63   /// option is specified on the command line. If this returns false (default),
64   /// the code generator is not allowed to assume that FP arithmetic arguments
65   /// and results are never NaNs or +-Infs.
66   extern bool FiniteOnlyFPMathOption;
67   extern bool FiniteOnlyFPMath();
68   
69   /// HonorSignDependentRoundingFPMath - This returns true when the
70   /// -enable-sign-dependent-rounding-fp-math is specified.  If this returns
71   /// false (the default), the code generator is allowed to assume that the
72   /// rounding behavior is the default (round-to-zero for all floating point to
73   /// integer conversions, and round-to-nearest for all other arithmetic
74   /// truncations).  If this is enabled (set to true), the code generator must
75   /// assume that the rounding mode may dynamically change.
76   extern bool HonorSignDependentRoundingFPMathOption;
77   extern bool HonorSignDependentRoundingFPMath();
78   
79   /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified
80   /// on the command line.  When this flag is on, the code generator will
81   /// generate libcalls to the software floating point library instead of
82   /// target FP instructions.
83   extern bool UseSoftFloat;
84
85   /// FloatABIType - This setting is set by -float-abi=xxx option is specfied
86   /// on the command line. This setting may either be Default, Soft, or Hard.
87   /// Default selects the target's default behavior. Soft selects the ABI for
88   /// UseSoftFloat, but does not inidcate that FP hardware may not be used.
89   /// Such a combination is unfortunately popular (e.g. arm-apple-darwin).
90   /// Hard presumes that the normal FP ABI is used.
91   extern FloatABI::ABIType FloatABIType;
92
93   /// NoZerosInBSS - By default some codegens place zero-initialized data to
94   /// .bss section. This flag disables such behaviour (necessary, e.g. for
95   /// crt*.o compiling).
96   extern bool NoZerosInBSS;
97   
98   /// ExceptionHandling - This flag indicates that exception information should
99   /// be emitted.
100   extern bool ExceptionHandling;
101
102   /// UnwindTablesMandatory - This flag indicates that unwind tables should
103   /// be emitted for all functions.
104   extern bool UnwindTablesMandatory;
105
106   /// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified
107   /// on the commandline. When the flag is on, the target will perform tail call
108   /// optimization (pop the caller's stack) providing it supports it.
109   extern bool PerformTailCallOpt;
110
111   /// StackAlignment - Override default stack alignment for target.
112   extern unsigned StackAlignment;
113
114   /// RealignStack - This flag indicates, whether stack should be automatically
115   /// realigned, if needed.
116   extern bool RealignStack;
117
118   /// DisableJumpTables - This flag indicates jump tables should not be 
119   /// generated.
120   extern bool DisableJumpTables;
121
122   /// EnableFastISel - This flag enables fast-path instruction selection
123   /// which trades away generated code quality in favor of reducing
124   /// compile time.
125   extern bool EnableFastISel;
126   
127   /// StrongPHIElim - This flag enables more aggressive PHI elimination
128   /// wth earlier copy coalescing.
129   extern bool StrongPHIElim;
130
131 } // End llvm namespace
132
133 #endif