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

Side by Side Diff: src/IceUtils.h

Issue 1127963004: Subzero ARM: lowerArguments (GPR), basic legalize(), and lowerRet(i32, i64). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix warnings, etc Created 5 years, 7 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 | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/llvm2ice_tests/int-arg.ll » ('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/IceUtils.h - Utility functions ---------------*- C++ -*-===// 1 //===- subzero/src/IceUtils.h - Utility functions ---------------*- 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 some utility functions. 10 // This file declares some utility functions.
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return (X & (N - 1)) == 0; 71 return (X & (N - 1)) == 0;
72 } 72 }
73 73
74 static inline uint64_t OffsetToAlignment(uint64_t Pos, uint64_t Align) { 74 static inline uint64_t OffsetToAlignment(uint64_t Pos, uint64_t Align) {
75 assert(llvm::isPowerOf2_64(Align)); 75 assert(llvm::isPowerOf2_64(Align));
76 uint64_t Mod = Pos & (Align - 1); 76 uint64_t Mod = Pos & (Align - 1);
77 if (Mod == 0) 77 if (Mod == 0)
78 return 0; 78 return 0;
79 return Align - Mod; 79 return Align - Mod;
80 } 80 }
81
82 // Precondition: 0 <= shift < 32
83 static inline uint32_t rotateLeft32(uint32_t value, uint32_t shift) {
84 if (shift == 0)
85 return value;
86 return (value << shift) | (value >> (32 - shift));
87 }
88
89 static inline uint32_t rotateRight32(uint32_t value, uint32_t shift) {
90 if (shift == 0)
91 return value;
92 return (value >> shift) | (value << (32 - shift));
93 }
81 }; 94 };
82 95
83 } // end of namespace Ice 96 } // end of namespace Ice
84 97
85 #endif // SUBZERO_SRC_ICEUTILS_H 98 #endif // SUBZERO_SRC_ICEUTILS_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/llvm2ice_tests/int-arg.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698