Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceDefs.h - Common Subzero declarations ------*- C++ -*-===// | 1 //===- subzero/src/IceDefs.h - Common Subzero declarations ------*- 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 /// \file | 10 /// \file |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 IceV_Preds = 1 << 3, | 218 IceV_Preds = 1 << 3, |
| 219 IceV_Succs = 1 << 4, | 219 IceV_Succs = 1 << 4, |
| 220 IceV_Liveness = 1 << 5, | 220 IceV_Liveness = 1 << 5, |
| 221 IceV_RegOrigins = 1 << 6, | 221 IceV_RegOrigins = 1 << 6, |
| 222 IceV_LinearScan = 1 << 7, | 222 IceV_LinearScan = 1 << 7, |
| 223 IceV_Frame = 1 << 8, | 223 IceV_Frame = 1 << 8, |
| 224 IceV_AddrOpt = 1 << 9, | 224 IceV_AddrOpt = 1 << 9, |
| 225 IceV_Random = 1 << 10, | 225 IceV_Random = 1 << 10, |
| 226 IceV_Folding = 1 << 11, | 226 IceV_Folding = 1 << 11, |
| 227 IceV_RMW = 1 << 12, | 227 IceV_RMW = 1 << 12, |
| 228 IceV_Loop = 1 << 13, | |
| 228 IceV_All = ~IceV_None, | 229 IceV_All = ~IceV_None, |
| 229 IceV_Most = IceV_All & ~IceV_LinearScan | 230 IceV_Most = IceV_All & ~IceV_LinearScan |
| 230 }; | 231 }; |
| 231 typedef uint32_t VerboseMask; | 232 typedef uint32_t VerboseMask; |
| 232 | 233 |
| 233 enum FileType { | 234 enum FileType { |
| 234 FT_Elf, /// ELF .o file | 235 FT_Elf, /// ELF .o file |
| 235 FT_Asm, /// Assembly .s file | 236 FT_Asm, /// Assembly .s file |
| 236 FT_Iasm /// "Integrated assembler" .byte-style .s file | 237 FT_Iasm /// "Integrated assembler" .byte-style .s file |
| 237 }; | 238 }; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 RPE_BasicBlockReordering, | 285 RPE_BasicBlockReordering, |
| 285 RPE_ConstantBlinding, | 286 RPE_ConstantBlinding, |
| 286 RPE_FunctionReordering, | 287 RPE_FunctionReordering, |
| 287 RPE_GlobalVariableReordering, | 288 RPE_GlobalVariableReordering, |
| 288 RPE_NopInsertion, | 289 RPE_NopInsertion, |
| 289 RPE_PooledConstantReordering, | 290 RPE_PooledConstantReordering, |
| 290 RPE_RegAllocRandomization, | 291 RPE_RegAllocRandomization, |
| 291 RPE_num | 292 RPE_num |
| 292 }; | 293 }; |
| 293 | 294 |
| 295 inline bool add_overflow(uint32_t x, uint32_t y, uint32_t *sum) { | |
|
Jim Stichnoth
2015/09/03 21:35:09
Maybe this should go in IceUtils.h? Also, documen
ascull
2015/09/03 22:47:12
Done.
| |
| 296 static_assert(std::is_same<uint32_t, unsigned>::value, "Need to match type"); | |
| 297 #if __has_builtin(__builtin_uadd_overflow) | |
| 298 return __builtin_uadd_overflow(x, y, sum); | |
| 299 #else | |
| 300 uint64_t res = static_cast<uint64_t>(x) + y; | |
| 301 *sum = static_cast<uint32_t>(res); | |
| 302 return res > std::numeric_limits<uint32_t>; | |
| 303 #endif | |
| 304 } | |
| 305 | |
| 294 } // end of namespace Ice | 306 } // end of namespace Ice |
| 295 | 307 |
| 296 #endif // SUBZERO_SRC_ICEDEFS_H | 308 #endif // SUBZERO_SRC_ICEDEFS_H |
| OLD | NEW |