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

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

Issue 1638283004: [wasm] Backoff implementation for F64Trunc using std::trunc. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@init-root-register
Patch Set: Use math.h trunc instead of std::trunc. Created 4 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
« src/assembler.cc ('K') | « test/cctest/compiler/test-run-machops.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/wasm/wasm-macro-gen.h" 9 #include "src/wasm/wasm-macro-gen.h"
10 10
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 2999
3000 3000
3001 TEST(Run_Wasm_F64Ceil) { 3001 TEST(Run_Wasm_F64Ceil) {
3002 WasmRunner<double> r(MachineType::Float64()); 3002 WasmRunner<double> r(MachineType::Float64());
3003 BUILD(r, WASM_F64_CEIL(WASM_GET_LOCAL(0))); 3003 BUILD(r, WASM_F64_CEIL(WASM_GET_LOCAL(0)));
3004 3004
3005 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), r.Call(*i)); } 3005 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(ceil(*i), r.Call(*i)); }
3006 } 3006 }
3007 3007
3008 3008
3009 TEST(Run_Wasm_F64Trunc) {
3010 WasmRunner<double> r(MachineType::Float64());
3011 BUILD(r, WASM_F64_TRUNC(WASM_GET_LOCAL(0)));
3012
3013 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(trunc(*i), r.Call(*i)); }
3014 }
3015
3016
3017 TEST(Run_Wasm_F64NearestInt) { 3009 TEST(Run_Wasm_F64NearestInt) {
3018 WasmRunner<double> r(MachineType::Float64()); 3010 WasmRunner<double> r(MachineType::Float64());
3019 BUILD(r, WASM_F64_NEARESTINT(WASM_GET_LOCAL(0))); 3011 BUILD(r, WASM_F64_NEARESTINT(WASM_GET_LOCAL(0)));
3020 3012
3021 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), r.Call(*i)); } 3013 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), r.Call(*i)); }
3022 } 3014 }
3023 3015
3024 #endif 3016 #endif
3025 3017
3018 TEST(Run_Wasm_F64Trunc) {
3019 WasmRunner<double> r(MachineType::Float64());
3020 BUILD(r, WASM_F64_TRUNC(WASM_GET_LOCAL(0)));
3021
3022 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(trunc(*i), r.Call(*i)); }
3023 }
3026 3024
3027 TEST(Run_Wasm_F32Min) { 3025 TEST(Run_Wasm_F32Min) {
3028 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32()); 3026 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32());
3029 BUILD(r, WASM_F32_MIN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); 3027 BUILD(r, WASM_F32_MIN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
3030 3028
3031 FOR_FLOAT32_INPUTS(i) { 3029 FOR_FLOAT32_INPUTS(i) {
3032 FOR_FLOAT32_INPUTS(j) { 3030 FOR_FLOAT32_INPUTS(j) {
3033 float expected; 3031 float expected;
3034 if (*i < *j) { 3032 if (*i < *j) {
3035 expected = *i; 3033 expected = *i;
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3336 3334
3337 #if WASM_64 3335 #if WASM_64
3338 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); } 3336 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); }
3339 #endif 3337 #endif
3340 3338
3341 3339
3342 TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); } 3340 TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); }
3343 3341
3344 3342
3345 TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); } 3343 TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); }
OLDNEW
« src/assembler.cc ('K') | « test/cctest/compiler/test-run-machops.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698