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

Side by Side Diff: src/IceUtils.h

Issue 1683243003: ARM32 Vector lowering - scalarize select (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Typo fix Created 4 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 | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/assembler/arm32/select-vec.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 /// \file 10 /// \file
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return (value >> shift) | (value << (32 - shift)); 116 return (value >> shift) | (value << (32 - shift));
117 } 117 }
118 118
119 /// Returns true if Val is +0.0. It requires T to be a floating point type. 119 /// Returns true if Val is +0.0. It requires T to be a floating point type.
120 template <typename T> static bool isPositiveZero(T Val) { 120 template <typename T> static bool isPositiveZero(T Val) {
121 static_assert(std::is_floating_point<T>::value, 121 static_assert(std::is_floating_point<T>::value,
122 "Input type must be floating point"); 122 "Input type must be floating point");
123 return Val == 0 && !std::signbit(Val); 123 return Val == 0 && !std::signbit(Val);
124 } 124 }
125 125
126 /// An RAII class to ensure that a boolean flag is restored to its previous
127 /// value upon function exit.
128 ///
129 /// Used in places like RandomizationPoolingPause and generating target helper
130 /// calls.
131 class BoolFlagSaver {
132 BoolFlagSaver() = delete;
133 BoolFlagSaver(const BoolFlagSaver &) = delete;
134 BoolFlagSaver &operator=(const BoolFlagSaver &) = delete;
135
136 public:
137 BoolFlagSaver(bool &F, bool NewValue) : OldValue(F), Flag(F) { F = NewValue; }
138 ~BoolFlagSaver() { Flag = OldValue; }
139
140 private:
141 const bool OldValue;
142 bool &Flag;
143 };
144
126 } // end of namespace Utils 145 } // end of namespace Utils
127 } // end of namespace Ice 146 } // end of namespace Ice
128 147
129 #endif // SUBZERO_SRC_ICEUTILS_H 148 #endif // SUBZERO_SRC_ICEUTILS_H
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/assembler/arm32/select-vec.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698