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

Side by Side Diff: src/IceAPFloat.h

Issue 1341423002: Reflow comments to use the full width. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix spelling and rebase Created 5 years, 3 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 | « no previous file | src/IceAssembler.h » ('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/IceAPFloat.h - Constant float conversions --*- C++ -*--===// 1 //===-- subzero/src/IceAPFloat.h - Constant float conversions --*- C++ -*--===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
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
11 /// \brief This file implements a class to represent Subzero float and double 11 /// \brief This file implements a class to represent Subzero float and double
12 /// values. 12 /// values.
13 /// 13 ///
14 /// Note: This is a simplified version of 14 /// Note: This is a simplified version of llvm/include/llvm/ADT/APFloat.h for
15 /// llvm/include/llvm/ADT/APFloat.h for use with Subzero. 15 /// use with Subzero.
16 //===----------------------------------------------------------------------===// 16 //===----------------------------------------------------------------------===//
17 17
18 #ifndef SUBZERO_SRC_ICEAPFLOAT_H 18 #ifndef SUBZERO_SRC_ICEAPFLOAT_H
19 #define SUBZERO_SRC_ICEAPFLOAT_H 19 #define SUBZERO_SRC_ICEAPFLOAT_H
20 20
21 #include "IceAPInt.h" 21 #include "IceAPInt.h"
22 22
23 namespace Ice { 23 namespace Ice {
24 24
25 template <typename IntType, typename FpType> 25 template <typename IntType, typename FpType>
26 inline FpType convertAPIntToFp(const APInt &Int) { 26 inline FpType convertAPIntToFp(const APInt &Int) {
27 static_assert(sizeof(IntType) == sizeof(FpType), 27 static_assert(sizeof(IntType) == sizeof(FpType),
28 "IntType and FpType should be the same width"); 28 "IntType and FpType should be the same width");
29 assert(Int.getBitWidth() == sizeof(IntType) * CHAR_BIT); 29 assert(Int.getBitWidth() == sizeof(IntType) * CHAR_BIT);
30 union { 30 union {
31 IntType IntValue; 31 IntType IntValue;
32 FpType FpValue; 32 FpType FpValue;
33 } Converter; 33 } Converter;
34 Converter.IntValue = static_cast<IntType>(Int.getRawData()); 34 Converter.IntValue = static_cast<IntType>(Int.getRawData());
35 return Converter.FpValue; 35 return Converter.FpValue;
36 } 36 }
37 37
38 } // end of namespace Ice 38 } // end of namespace Ice
39 39
40 #endif // SUBZERO_SRC_ICEAPFLOAT_H 40 #endif // SUBZERO_SRC_ICEAPFLOAT_H
OLDNEW
« no previous file with comments | « no previous file | src/IceAssembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698