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/compiler/ppc/code-generator-ppc.cc

Issue 2660873003: PPC: Work-around to preserve sNan bit (Closed)
Patch Set: addressed comments Created 3 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 | « no previous file | src/ppc/macro-assembler-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compilation-info.h" 7 #include "src/compilation-info.h"
8 #include "src/compiler/code-generator-impl.h" 8 #include "src/compiler/code-generator-impl.h"
9 #include "src/compiler/gap-resolver.h" 9 #include "src/compiler/gap-resolver.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC. 2339 UNREACHABLE(); // TODO(dcarney): loading RPO constants on PPC.
2340 break; 2340 break;
2341 } 2341 }
2342 if (destination->IsStackSlot()) { 2342 if (destination->IsStackSlot()) {
2343 __ StoreP(dst, g.ToMemOperand(destination), r0); 2343 __ StoreP(dst, g.ToMemOperand(destination), r0);
2344 } 2344 }
2345 } else { 2345 } else {
2346 DoubleRegister dst = destination->IsFPRegister() 2346 DoubleRegister dst = destination->IsFPRegister()
2347 ? g.ToDoubleRegister(destination) 2347 ? g.ToDoubleRegister(destination)
2348 : kScratchDoubleReg; 2348 : kScratchDoubleReg;
2349 double value = (src.type() == Constant::kFloat32) ? src.ToFloat32() 2349 double value;
2350 : src.ToFloat64(); 2350 // bit_cast of snan is converted to qnan on ia32/x64
2351 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
2352 intptr_t valueInt = (src.type() == Constant::kFloat32)
2353 ? src.ToFloat32AsInt()
2354 : src.ToFloat64AsInt();
2355 if (valueInt == ((src.type() == Constant::kFloat32)
2356 ? 0x7fa00000
2357 : 0x7fa0000000000000)) {
2358 value = bit_cast<double, int64_t>(0x7ff4000000000000L);
2359 } else {
2360 #endif
2361 value = (src.type() == Constant::kFloat32) ? src.ToFloat32()
2362 : src.ToFloat64();
2363 #if V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64
2364 }
2365 #endif
2351 __ LoadDoubleLiteral(dst, value, kScratchReg); 2366 __ LoadDoubleLiteral(dst, value, kScratchReg);
2352 if (destination->IsFPStackSlot()) { 2367 if (destination->IsFPStackSlot()) {
2353 __ StoreDouble(dst, g.ToMemOperand(destination), r0); 2368 __ StoreDouble(dst, g.ToMemOperand(destination), r0);
2354 } 2369 }
2355 } 2370 }
2356 } else if (source->IsFPRegister()) { 2371 } else if (source->IsFPRegister()) {
2357 DoubleRegister src = g.ToDoubleRegister(source); 2372 DoubleRegister src = g.ToDoubleRegister(source);
2358 if (destination->IsFPRegister()) { 2373 if (destination->IsFPRegister()) {
2359 DoubleRegister dst = g.ToDoubleRegister(destination); 2374 DoubleRegister dst = g.ToDoubleRegister(destination);
2360 __ Move(dst, src); 2375 __ Move(dst, src);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 padding_size -= v8::internal::Assembler::kInstrSize; 2505 padding_size -= v8::internal::Assembler::kInstrSize;
2491 } 2506 }
2492 } 2507 }
2493 } 2508 }
2494 2509
2495 #undef __ 2510 #undef __
2496 2511
2497 } // namespace compiler 2512 } // namespace compiler
2498 } // namespace internal 2513 } // namespace internal
2499 } // namespace v8 2514 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/ppc/macro-assembler-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698