OLD | NEW |
---|---|
1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// | 1 //===- subzero/src/IceTargetLowering.cpp - Basic lowering implementation --===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
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 skeleton of the TargetLowering class, | 10 // This file implements the skeleton of the TargetLowering class, |
11 // specifically invoking the appropriate lowering method for a given | 11 // specifically invoking the appropriate lowering method for a given |
12 // instruction kind and driving global register allocation. It also | 12 // instruction kind and driving global register allocation. It also |
13 // implements the non-deleted instruction iteration in | 13 // implements the non-deleted instruction iteration in |
14 // LoweringContext. | 14 // LoweringContext. |
15 // | 15 // |
16 //===----------------------------------------------------------------------===// | 16 //===----------------------------------------------------------------------===// |
17 | 17 |
18 #include "llvm/Support/CommandLine.h" | 18 #include "llvm/Support/CommandLine.h" |
19 | 19 |
20 #include "assembler_ia32.h" | 20 #include "assembler_ia32.h" |
21 #include "IceCfg.h" // setError() | 21 #include "IceCfg.h" // setError() |
22 #include "IceCfgNode.h" | 22 #include "IceCfgNode.h" |
23 #include "IceOperand.h" | 23 #include "IceOperand.h" |
24 #include "IceRegAlloc.h" | 24 #include "IceRegAlloc.h" |
25 #include "IceTargetLowering.h" | 25 #include "IceTargetLowering.h" |
26 #include "IceTargetLoweringX8632.h" | 26 #include "IceTargetLoweringX8632.h" |
27 | 27 |
28 namespace Ice { | 28 namespace Ice { |
29 | 29 |
Mircea Trofin
2015/02/28 03:28:57
(overly-pedantic, but...) if the const values live
Jim Stichnoth
2015/02/28 04:44:28
Thinking about this further - when we add a new ta
| |
30 // Runtime helper function names | |
31 const IceString TargetLowering::H_bitcast_16xi1_i16 = "__Sz_bitcast_16xi1_i16"; | |
32 const IceString TargetLowering::H_bitcast_8xi1_i8 = "__Sz_bitcast_8xi1_i8"; | |
33 const IceString TargetLowering::H_bitcast_i16_16xi1 = "__Sz_bitcast_i16_16xi1"; | |
34 const IceString TargetLowering::H_bitcast_i8_8xi1 = "__Sz_bitcast_i8_8xi1"; | |
35 const IceString TargetLowering::H_call_ctpop_i32 = "__popcountsi2"; | |
36 const IceString TargetLowering::H_call_ctpop_i64 = "__popcountdi2"; | |
37 const IceString TargetLowering::H_call_longjmp = "longjmp"; | |
38 const IceString TargetLowering::H_call_memcpy = "memcpy"; | |
39 const IceString TargetLowering::H_call_memmove = "memmove"; | |
40 const IceString TargetLowering::H_call_memset = "memset"; | |
41 const IceString TargetLowering::H_call_read_tp = "__nacl_read_tp"; | |
42 const IceString TargetLowering::H_call_setjmp = "setjmp"; | |
43 const IceString TargetLowering::H_fptosi_f32_i64 = "__Sz_fptosi_f32_i64"; | |
44 const IceString TargetLowering::H_fptosi_f64_i64 = "__Sz_fptosi_f64_i64"; | |
45 const IceString TargetLowering::H_fptoui_4xi32_f32 = "__Sz_fptoui_4xi32_f32"; | |
46 const IceString TargetLowering::H_fptoui_f32_i32 = "__Sz_fptoui_f32_i32"; | |
47 const IceString TargetLowering::H_fptoui_f32_i64 = "__Sz_fptoui_f32_i64"; | |
48 const IceString TargetLowering::H_fptoui_f64_i32 = "__Sz_fptoui_f64_i32"; | |
49 const IceString TargetLowering::H_fptoui_f64_i64 = "__Sz_fptoui_f64_i64"; | |
50 const IceString TargetLowering::H_frem_f32 = "fmodf"; | |
51 const IceString TargetLowering::H_frem_f64 = "fmod"; | |
52 const IceString TargetLowering::H_sdiv_i64 = "__divdi3"; | |
53 const IceString TargetLowering::H_sitofp_i64_f32 = "__Sz_sitofp_i64_f32"; | |
54 const IceString TargetLowering::H_sitofp_i64_f64 = "__Sz_sitofp_i64_f64"; | |
55 const IceString TargetLowering::H_srem_i64 = "__moddi3"; | |
56 const IceString TargetLowering::H_udiv_i64 = "__udivdi3"; | |
57 const IceString TargetLowering::H_uitofp_4xi32_4xf32 = | |
58 "__Sz_uitofp_4xi32_4xf32"; | |
59 const IceString TargetLowering::H_uitofp_i32_f32 = "__Sz_uitofp_i32_f32"; | |
60 const IceString TargetLowering::H_uitofp_i32_f64 = "__Sz_uitofp_i32_f64"; | |
61 const IceString TargetLowering::H_uitofp_i64_f32 = "__Sz_uitofp_i64_f32"; | |
62 const IceString TargetLowering::H_uitofp_i64_f64 = "__Sz_uitofp_i64_f64"; | |
63 const IceString TargetLowering::H_urem_i64 = "__umoddi3"; | |
64 | |
30 namespace { | 65 namespace { |
31 | 66 |
32 // TODO(stichnot): Move this machinery into main.cpp. | 67 // TODO(stichnot): Move this machinery into main.cpp. |
33 namespace cl = llvm::cl; | 68 namespace cl = llvm::cl; |
34 cl::opt<bool> DoNopInsertion("nop-insertion", cl::desc("Randomly insert NOPs"), | 69 cl::opt<bool> DoNopInsertion("nop-insertion", cl::desc("Randomly insert NOPs"), |
35 cl::init(false)); | 70 cl::init(false)); |
36 | 71 |
37 cl::opt<int> MaxNopsPerInstruction( | 72 cl::opt<int> MaxNopsPerInstruction( |
38 "max-nops-per-instruction", | 73 "max-nops-per-instruction", |
39 cl::desc("Max number of nops to insert per instruction"), cl::init(1)); | 74 cl::desc("Max number of nops to insert per instruction"), cl::init(1)); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 if (Target == Target_ARM64) | 304 if (Target == Target_ARM64) |
270 return std::unique_ptr<TargetDataLowering>(TargetDataARM64::create(Ctx)); | 305 return std::unique_ptr<TargetDataLowering>(TargetDataARM64::create(Ctx)); |
271 #endif | 306 #endif |
272 llvm_unreachable("Unsupported target"); | 307 llvm_unreachable("Unsupported target"); |
273 return nullptr; | 308 return nullptr; |
274 } | 309 } |
275 | 310 |
276 TargetDataLowering::~TargetDataLowering() {} | 311 TargetDataLowering::~TargetDataLowering() {} |
277 | 312 |
278 } // end of namespace Ice | 313 } // end of namespace Ice |
OLD | NEW |