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

Side by Side Diff: src/IceTargetLowering.h

Issue 961413002: Subzero: Clean up the runtime implementation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Change static helper strings to be char* instead of IceString Created 5 years, 9 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 | « runtime/szrt_ll.ll ('k') | src/IceTargetLoweringX8632.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 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===// 1 //===- subzero/src/IceTargetLowering.h - Lowering interface -----*- C++ -*-===//
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 declares the TargetLowering, LoweringContext, and 10 // This file declares the TargetLowering, LoweringContext, and
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 Cfg *Func; 245 Cfg *Func;
246 GlobalContext *Ctx; 246 GlobalContext *Ctx;
247 const bool RandomizeRegisterAllocation; 247 const bool RandomizeRegisterAllocation;
248 bool HasComputedFrame; 248 bool HasComputedFrame;
249 bool CallsReturnsTwice; 249 bool CallsReturnsTwice;
250 // StackAdjustment keeps track of the current stack offset from its 250 // StackAdjustment keeps track of the current stack offset from its
251 // natural location, as arguments are pushed for a function call. 251 // natural location, as arguments are pushed for a function call.
252 int32_t StackAdjustment; 252 int32_t StackAdjustment;
253 LoweringContext Context; 253 LoweringContext Context;
254 254
255 // Runtime helper function names
256 const static constexpr char *H_bitcast_16xi1_i16 = "__Sz_bitcast_16xi1_i16";
257 const static constexpr char *H_bitcast_8xi1_i8 = "__Sz_bitcast_8xi1_i8";
258 const static constexpr char *H_bitcast_i16_16xi1 = "__Sz_bitcast_i16_16xi1";
259 const static constexpr char *H_bitcast_i8_8xi1 = "__Sz_bitcast_i8_8xi1";
260 const static constexpr char *H_call_ctpop_i32 = "__popcountsi2";
261 const static constexpr char *H_call_ctpop_i64 = "__popcountdi2";
262 const static constexpr char *H_call_longjmp = "longjmp";
263 const static constexpr char *H_call_memcpy = "memcpy";
264 const static constexpr char *H_call_memmove = "memmove";
265 const static constexpr char *H_call_memset = "memset";
266 const static constexpr char *H_call_read_tp = "__nacl_read_tp";
267 const static constexpr char *H_call_setjmp = "setjmp";
268 const static constexpr char *H_fptosi_f32_i64 = "__Sz_fptosi_f32_i64";
269 const static constexpr char *H_fptosi_f64_i64 = "__Sz_fptosi_f64_i64";
270 const static constexpr char *H_fptoui_4xi32_f32 = "__Sz_fptoui_4xi32_f32";
271 const static constexpr char *H_fptoui_f32_i32 = "__Sz_fptoui_f32_i32";
272 const static constexpr char *H_fptoui_f32_i64 = "__Sz_fptoui_f32_i64";
273 const static constexpr char *H_fptoui_f64_i32 = "__Sz_fptoui_f64_i32";
274 const static constexpr char *H_fptoui_f64_i64 = "__Sz_fptoui_f64_i64";
275 const static constexpr char *H_frem_f32 = "fmodf";
276 const static constexpr char *H_frem_f64 = "fmod";
277 const static constexpr char *H_sdiv_i64 = "__divdi3";
278 const static constexpr char *H_sitofp_i64_f32 = "__Sz_sitofp_i64_f32";
279 const static constexpr char *H_sitofp_i64_f64 = "__Sz_sitofp_i64_f64";
280 const static constexpr char *H_srem_i64 = "__moddi3";
281 const static constexpr char *H_udiv_i64 = "__udivdi3";
282 const static constexpr char *H_uitofp_4xi32_4xf32 = "__Sz_uitofp_4xi32_4xf32";
283 const static constexpr char *H_uitofp_i32_f32 = "__Sz_uitofp_i32_f32";
284 const static constexpr char *H_uitofp_i32_f64 = "__Sz_uitofp_i32_f64";
285 const static constexpr char *H_uitofp_i64_f32 = "__Sz_uitofp_i64_f32";
286 const static constexpr char *H_uitofp_i64_f64 = "__Sz_uitofp_i64_f64";
287 const static constexpr char *H_urem_i64 = "__umoddi3";
288
255 private: 289 private:
256 int32_t SnapshotStackAdjustment; 290 int32_t SnapshotStackAdjustment;
257 }; 291 };
258 292
259 // TargetDataLowering is used for "lowering" data including initializers 293 // TargetDataLowering is used for "lowering" data including initializers
260 // for global variables, and the internal constant pools. It is separated 294 // for global variables, and the internal constant pools. It is separated
261 // out from TargetLowering because it does not require a Cfg. 295 // out from TargetLowering because it does not require a Cfg.
262 class TargetDataLowering { 296 class TargetDataLowering {
263 TargetDataLowering() = delete; 297 TargetDataLowering() = delete;
264 TargetDataLowering(const TargetDataLowering &) = delete; 298 TargetDataLowering(const TargetDataLowering &) = delete;
265 TargetDataLowering &operator=(const TargetDataLowering &) = delete; 299 TargetDataLowering &operator=(const TargetDataLowering &) = delete;
266 300
267 public: 301 public:
268 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx); 302 static std::unique_ptr<TargetDataLowering> createLowering(GlobalContext *Ctx);
269 virtual ~TargetDataLowering(); 303 virtual ~TargetDataLowering();
270 304
271 virtual void 305 virtual void
272 lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const = 0; 306 lowerGlobals(std::unique_ptr<VariableDeclarationList> Vars) const = 0;
273 virtual void lowerConstants() const = 0; 307 virtual void lowerConstants() const = 0;
274 308
275 protected: 309 protected:
276 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {} 310 explicit TargetDataLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
277 GlobalContext *Ctx; 311 GlobalContext *Ctx;
278 }; 312 };
279 313
280 } // end of namespace Ice 314 } // end of namespace Ice
281 315
282 #endif // SUBZERO_SRC_ICETARGETLOWERING_H 316 #endif // SUBZERO_SRC_ICETARGETLOWERING_H
OLDNEW
« no previous file with comments | « runtime/szrt_ll.ll ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698