Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Side by Side Diff: lib/Target/ARM/ARMSubtarget.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Target/ARM/ARMSubtarget.h ('k') | lib/Target/ARM/ARMTargetMachine.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- ARMSubtarget.cpp - ARM Subtarget Information ----------------------===// 1 //===-- ARMSubtarget.cpp - ARM Subtarget Information ----------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements the ARM specific subclass of TargetSubtargetInfo. 10 // This file implements the ARM specific subclass of TargetSubtargetInfo.
(...skipping 27 matching lines...) Expand all
38 #define GET_SUBTARGETINFO_CTOR 38 #define GET_SUBTARGETINFO_CTOR
39 #include "ARMGenSubtargetInfo.inc" 39 #include "ARMGenSubtargetInfo.inc"
40 40
41 static cl::opt<bool> 41 static cl::opt<bool>
42 ReserveR9("arm-reserve-r9", cl::Hidden, 42 ReserveR9("arm-reserve-r9", cl::Hidden,
43 cl::desc("Reserve R9, making it unavailable as GPR")); 43 cl::desc("Reserve R9, making it unavailable as GPR"));
44 44
45 static cl::opt<bool> 45 static cl::opt<bool>
46 ArmUseMOVT("arm-use-movt", cl::init(true), cl::Hidden); 46 ArmUseMOVT("arm-use-movt", cl::init(true), cl::Hidden);
47 47
48 // @LOCALMOD-START
49 // TODO: * JITing has not been tested at all
50 // * Thumb mode operation is also not clear: it seems jump tables
51 // for thumb are broken independent of this option
52 static cl::opt<bool>
53 NoInlineJumpTables("no-inline-jumptables",
54 cl::desc("Do not place jump tables inline in the code"));
55 // @LOCALMOD-END
56
48 static cl::opt<bool> 57 static cl::opt<bool>
49 UseFusedMulOps("arm-use-mulops", 58 UseFusedMulOps("arm-use-mulops",
50 cl::init(true), cl::Hidden); 59 cl::init(true), cl::Hidden);
51 60
52 namespace { 61 namespace {
53 enum AlignMode { 62 enum AlignMode {
54 DefaultAlign, 63 DefaultAlign,
55 StrictAlign, 64 StrictAlign,
56 NoStrictAlign 65 NoStrictAlign
57 }; 66 };
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 HasV6MOps = false; 181 HasV6MOps = false;
173 HasV6T2Ops = false; 182 HasV6T2Ops = false;
174 HasV7Ops = false; 183 HasV7Ops = false;
175 HasV8Ops = false; 184 HasV8Ops = false;
176 HasVFPv2 = false; 185 HasVFPv2 = false;
177 HasVFPv3 = false; 186 HasVFPv3 = false;
178 HasVFPv4 = false; 187 HasVFPv4 = false;
179 HasFPARMv8 = false; 188 HasFPARMv8 = false;
180 HasNEON = false; 189 HasNEON = false;
181 UseNEONForSinglePrecisionFP = false; 190 UseNEONForSinglePrecisionFP = false;
191 // @LOCALMOD-START
192 UseInlineJumpTables = !NoInlineJumpTables;
193 UseConstIslands = true;
194 // @LOCALMOD-END
182 UseMulOps = UseFusedMulOps; 195 UseMulOps = UseFusedMulOps;
183 SlowFPVMLx = false; 196 SlowFPVMLx = false;
184 HasVMLxForwarding = false; 197 HasVMLxForwarding = false;
185 SlowFPBrcc = false; 198 SlowFPBrcc = false;
186 InThumbMode = false; 199 InThumbMode = false;
187 HasThumb2 = false; 200 HasThumb2 = false;
188 NoARM = false; 201 NoARM = false;
189 IsR9Reserved = ReserveR9; 202 IsR9Reserved = ReserveR9;
190 UseMovt = false; 203 UseMovt = false;
191 SupportsTailCall = false; 204 SupportsTailCall = false;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 UseMovt = hasV6T2Ops() && ArmUseMOVT; 291 UseMovt = hasV6T2Ops() && ArmUseMOVT;
279 292
280 if (isTargetMachO()) { 293 if (isTargetMachO()) {
281 IsR9Reserved = ReserveR9 || !HasV6Ops; 294 IsR9Reserved = ReserveR9 || !HasV6Ops;
282 SupportsTailCall = !isTargetIOS() || !getTargetTriple().isOSVersionLT(5, 0); 295 SupportsTailCall = !isTargetIOS() || !getTargetTriple().isOSVersionLT(5, 0);
283 } else { 296 } else {
284 IsR9Reserved = ReserveR9; 297 IsR9Reserved = ReserveR9;
285 SupportsTailCall = !isThumb1Only(); 298 SupportsTailCall = !isThumb1Only();
286 } 299 }
287 300
301 // @LOCALMOD-BEGIN
302 if (isTargetNaCl()) {
303 // NaCl reserves R9 for TLS.
304 IsR9Reserved = true;
305 // NaCl uses MovT to avoid generating constant islands.
306 UseMovt = true;
307 UseInlineJumpTables = false;
308 UseConstIslands = false;
309 }
310 // @LOCALMOD-END
311
288 if (Align == DefaultAlign) { 312 if (Align == DefaultAlign) {
289 // Assume pre-ARMv6 doesn't support unaligned accesses. 313 // Assume pre-ARMv6 doesn't support unaligned accesses.
290 // 314 //
291 // ARMv6 may or may not support unaligned accesses depending on the 315 // ARMv6 may or may not support unaligned accesses depending on the
292 // SCTLR.U bit, which is architecture-specific. We assume ARMv6 316 // SCTLR.U bit, which is architecture-specific. We assume ARMv6
293 // Darwin and NetBSD targets support unaligned accesses, and others don't. 317 // Darwin and NetBSD targets support unaligned accesses, and others don't.
294 // 318 //
295 // ARMv7 always has SCTLR.U set to 1, but it has a new SCTLR.A bit 319 // ARMv7 always has SCTLR.U set to 1, but it has a new SCTLR.A bit
296 // which raises an alignment fault on unaligned accesses. Linux 320 // which raises an alignment fault on unaligned accesses. Linux
297 // defaults this bit to 0 and handles it as a system-wide (not 321 // defaults this bit to 0 and handles it as a system-wide (not
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 421 }
398 422
399 bool ARMSubtarget::useMovt(const MachineFunction &MF) const { 423 bool ARMSubtarget::useMovt(const MachineFunction &MF) const {
400 // NOTE Windows on ARM needs to use mov.w/mov.t pairs to materialise 32-bit 424 // NOTE Windows on ARM needs to use mov.w/mov.t pairs to materialise 32-bit
401 // immediates as it is inherently position independent, and may be out of 425 // immediates as it is inherently position independent, and may be out of
402 // range otherwise. 426 // range otherwise.
403 return UseMovt && (isTargetWindows() || 427 return UseMovt && (isTargetWindows() ||
404 !MF.getFunction()->getAttributes().hasAttribute( 428 !MF.getFunction()->getAttributes().hasAttribute(
405 AttributeSet::FunctionIndex, Attribute::MinSize)); 429 AttributeSet::FunctionIndex, Attribute::MinSize));
406 } 430 }
OLDNEW
« no previous file with comments | « lib/Target/ARM/ARMSubtarget.h ('k') | lib/Target/ARM/ARMTargetMachine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698