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

Side by Side Diff: test/cctest/wasm/test-run-wasm.cc

Issue 1973493003: [turbofan] Introduce new operators Float32SubPreserveNan and Float64SubPreserveNan for wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/compiler/x87/instruction-selector-x87.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 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 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 <stdint.h> 5 #include <stdint.h>
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "src/base/platform/elapsed-timer.h" 9 #include "src/base/platform/elapsed-timer.h"
10 10
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 TEST(Run_WasmFloat32Neg) { 574 TEST(Run_WasmFloat32Neg) {
575 WasmRunner<float> r(MachineType::Float32()); 575 WasmRunner<float> r(MachineType::Float32());
576 BUILD(r, WASM_F32_NEG(WASM_GET_LOCAL(0))); 576 BUILD(r, WASM_F32_NEG(WASM_GET_LOCAL(0)));
577 577
578 FOR_FLOAT32_INPUTS(i) { 578 FOR_FLOAT32_INPUTS(i) {
579 CHECK_EQ(0x80000000, 579 CHECK_EQ(0x80000000,
580 bit_cast<uint32_t>(*i) ^ bit_cast<uint32_t>(r.Call(*i))); 580 bit_cast<uint32_t>(*i) ^ bit_cast<uint32_t>(r.Call(*i)));
581 } 581 }
582 } 582 }
583 583
584 TEST(Run_WasmFloat32SubMinusZero) {
585 WasmRunner<float> r(MachineType::Float32());
586 BUILD(r, WASM_F32_SUB(WASM_F32(-0.0), WASM_GET_LOCAL(0)));
587
588 CHECK_EQ(0x7fe00000, bit_cast<uint32_t>(r.Call(bit_cast<float>(0x7fa00000))));
589 }
590
591 TEST(Run_WasmFloat64SubMinusZero) {
592 WasmRunner<double> r(MachineType::Float64());
593 BUILD(r, WASM_F64_SUB(WASM_F64(-0.0), WASM_GET_LOCAL(0)));
594
595 CHECK_EQ(0x7ff8123456789abc,
596 bit_cast<uint64_t>(r.Call(bit_cast<double>(0x7ff0123456789abc))));
597 }
598
584 TEST(Run_WasmFloat64Neg) { 599 TEST(Run_WasmFloat64Neg) {
585 WasmRunner<double> r(MachineType::Float64()); 600 WasmRunner<double> r(MachineType::Float64());
586 BUILD(r, WASM_F64_NEG(WASM_GET_LOCAL(0))); 601 BUILD(r, WASM_F64_NEG(WASM_GET_LOCAL(0)));
587 602
588 FOR_FLOAT64_INPUTS(i) { 603 FOR_FLOAT64_INPUTS(i) {
589 CHECK_EQ(0x8000000000000000, 604 CHECK_EQ(0x8000000000000000,
590 bit_cast<uint64_t>(*i) ^ bit_cast<uint64_t>(r.Call(*i))); 605 bit_cast<uint64_t>(*i) ^ bit_cast<uint64_t>(r.Call(*i)));
591 } 606 }
592 } 607 }
593 608
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after
2740 WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32()); 2755 WasmRunner<int32_t> r(MachineType::Int32(), MachineType::Int32());
2741 BUILD(r, WASM_I32_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)), WASM_ZERO); 2756 BUILD(r, WASM_I32_REMS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)), WASM_ZERO);
2742 const int32_t kMin = std::numeric_limits<int32_t>::min(); 2757 const int32_t kMin = std::numeric_limits<int32_t>::min();
2743 CHECK_EQ(0, r.Call(133, 100)); 2758 CHECK_EQ(0, r.Call(133, 100));
2744 CHECK_EQ(0, r.Call(kMin, -1)); 2759 CHECK_EQ(0, r.Call(kMin, -1));
2745 CHECK_EQ(0, r.Call(0, 1)); 2760 CHECK_EQ(0, r.Call(0, 1));
2746 CHECK_TRAP(r.Call(100, 0)); 2761 CHECK_TRAP(r.Call(100, 0));
2747 CHECK_TRAP(r.Call(-1001, 0)); 2762 CHECK_TRAP(r.Call(-1001, 0));
2748 CHECK_TRAP(r.Call(kMin, 0)); 2763 CHECK_TRAP(r.Call(kMin, 0));
2749 } 2764 }
OLDNEW
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698