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

Side by Side Diff: src/a64/utils-a64.h

Issue 170383003: Merge a few A64 utils into the CompilerIntrinsics. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes and cleaning Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/a64/simulator-a64.cc ('k') | src/a64/utils-a64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 65
66 static inline double rawbits_to_double(uint64_t bits) { 66 static inline double rawbits_to_double(uint64_t bits) {
67 double value = 0.0; 67 double value = 0.0;
68 memcpy(&value, &bits, 8); 68 memcpy(&value, &bits, 8);
69 return value; 69 return value;
70 } 70 }
71 71
72 72
73 // Bits counting. 73 // Bits counting.
74 int CountLeadingZeros(uint64_t value, int width); 74 inline int MaskToBit(uint64_t mask) {
75 int CountLeadingSignBits(int64_t value, int width); 75 ASSERT(CountSetBits(mask, 64) == 1);
76 int CountTrailingZeros(uint64_t value, int width); 76 return CountTrailingZeros(mask, 64);
77 int CountSetBits(uint64_t value, int width); 77 }
78 int MaskToBit(uint64_t mask);
79 78
80 79
81 // NaN tests. 80 // NaN tests.
82 inline bool IsSignallingNaN(double num) { 81 inline bool IsSignallingNaN(double num) {
83 const uint64_t kFP64QuietNaNMask = 0x0008000000000000UL; 82 const uint64_t kFP64QuietNaNMask = 0x0008000000000000UL;
84 uint64_t raw = double_to_rawbits(num); 83 uint64_t raw = double_to_rawbits(num);
85 if (std::isnan(num) && ((raw & kFP64QuietNaNMask) == 0)) { 84 if (std::isnan(num) && ((raw & kFP64QuietNaNMask) == 0)) {
86 return true; 85 return true;
87 } 86 }
88 return false; 87 return false;
(...skipping 11 matching lines...) Expand all
100 99
101 100
102 template <typename T> 101 template <typename T>
103 inline bool IsQuietNaN(T num) { 102 inline bool IsQuietNaN(T num) {
104 return std::isnan(num) && !IsSignallingNaN(num); 103 return std::isnan(num) && !IsSignallingNaN(num);
105 } 104 }
106 105
107 } } // namespace v8::internal 106 } } // namespace v8::internal
108 107
109 #endif // V8_A64_UTILS_A64_H_ 108 #endif // V8_A64_UTILS_A64_H_
OLDNEW
« no previous file with comments | « src/a64/simulator-a64.cc ('k') | src/a64/utils-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698