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

Side by Side Diff: src/base/math.cc

Issue 863633002: Use signaling NaN for holes in fixed double arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix phi? Created 5 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/base/macros.h"
6 #include "src/base/math.h"
7
8 namespace v8 {
9 namespace base {
10
11 bool IsQuietNaN(float x) {
12 uint32_t const v = bit_cast<uint32_t>(x);
13 return (v >= 0x7FC00000u && v <= 0x7FFFFFFFu) || v >= 0xFFC00000u;
14 }
15
16
17 bool IsQuietNaN(double x) {
18 uint32_t const v = bit_cast<uint64_t>(x) >> 32u;
19 return (v >= 0x7FF80000u && v <= 0x7FFFFFFFu) || v >= 0xFFF80000u;
20 }
21
22
23 bool IsSignalingNaN(float x) {
24 uint32_t const v = bit_cast<uint32_t>(x);
25 return (v >= 0x7F800001u && v <= 0x7FBFFFFFu) ||
26 (v >= 0xFF800001u && v <= 0xFFBFFFFFu);
27 }
28
29
30 bool IsSignalingNaN(double x) {
31 uint64_t const v = bit_cast<uint64_t>(x);
32 return (v >= V8_UINT64_C(0x7FF0000000000001) &&
33 v <= V8_UINT64_C(0x7FF7FFFFFFFFFFFF)) ||
34 (v >= V8_UINT64_C(0xFFF0000000000001) &&
35 v <= V8_UINT64_C(0xFFF7FFFFFFFFFFFF));
36 }
37
38 } // namespace base
39 } // namespace v8
OLDNEW
« src/arm64/lithium-codegen-arm64.cc ('K') | « src/base/math.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698