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

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

Issue 1584663007: [turbofan] Implement rounding of floats on x64 and ia32 without sse4.1. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: reduced generated code. Created 4 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
« no previous file with comments | « test/cctest/compiler/value-helper.h ('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 2915 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 CHECK_EQ(1, r.Call(1, 0, 2)); 2926 CHECK_EQ(1, r.Call(1, 0, 2));
2927 CHECK_EQ(1, r.Call(1, 0, 9)); 2927 CHECK_EQ(1, r.Call(1, 0, 9));
2928 2928
2929 CHECK_TRAP(r.Call(0, 2, 1)); 2929 CHECK_TRAP(r.Call(0, 2, 1));
2930 CHECK_TRAP(r.Call(1, 2, 0)); 2930 CHECK_TRAP(r.Call(1, 2, 0));
2931 CHECK_TRAP(r.Call(2, 0, 1)); 2931 CHECK_TRAP(r.Call(2, 0, 1));
2932 CHECK_TRAP(r.Call(2, 1, 0)); 2932 CHECK_TRAP(r.Call(2, 1, 0));
2933 } 2933 }
2934 2934
2935 2935
2936 // TODO(titzer): Fix for nosee4 and re-enable.
2937 #if 0
2938
2939 TEST(Run_Wasm_F32Floor) { 2936 TEST(Run_Wasm_F32Floor) {
2940 WasmRunner<float> r(MachineType::Float32()); 2937 WasmRunner<float> r(MachineType::Float32());
2941 BUILD(r, WASM_F32_FLOOR(WASM_GET_LOCAL(0))); 2938 BUILD(r, WASM_F32_FLOOR(WASM_GET_LOCAL(0)));
2942 2939
2943 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floor(*i), r.Call(*i)); } 2940 FOR_FLOAT32_INPUTS(i) { CheckFloatEq(floor(*i), r.Call(*i)); }
2944 } 2941 }
2945 2942
2946 2943
2947 TEST(Run_Wasm_F32Ceil) { 2944 TEST(Run_Wasm_F32Ceil) {
2948 WasmRunner<float> r(MachineType::Float32()); 2945 WasmRunner<float> r(MachineType::Float32());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2992 } 2989 }
2993 2990
2994 2991
2995 TEST(Run_Wasm_F64NearestInt) { 2992 TEST(Run_Wasm_F64NearestInt) {
2996 WasmRunner<double> r(MachineType::Float64()); 2993 WasmRunner<double> r(MachineType::Float64());
2997 BUILD(r, WASM_F64_NEARESTINT(WASM_GET_LOCAL(0))); 2994 BUILD(r, WASM_F64_NEARESTINT(WASM_GET_LOCAL(0)));
2998 2995
2999 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), r.Call(*i)); } 2996 FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(nearbyint(*i), r.Call(*i)); }
3000 } 2997 }
3001 2998
3002 #endif
3003
3004 2999
3005 TEST(Run_Wasm_F32Min) { 3000 TEST(Run_Wasm_F32Min) {
3006 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32()); 3001 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32());
3007 BUILD(r, WASM_F32_MIN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); 3002 BUILD(r, WASM_F32_MIN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
3008 3003
3009 FOR_FLOAT32_INPUTS(i) { 3004 FOR_FLOAT32_INPUTS(i) {
3010 FOR_FLOAT32_INPUTS(j) { 3005 FOR_FLOAT32_INPUTS(j) {
3011 float expected; 3006 float expected;
3012 if (*i < *j) { 3007 if (*i < *j) {
3013 expected = *i; 3008 expected = *i;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3269 TEST(Run_Wasm_F32CopySign) { 3264 TEST(Run_Wasm_F32CopySign) {
3270 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32()); 3265 WasmRunner<float> r(MachineType::Float32(), MachineType::Float32());
3271 BUILD(r, WASM_F32_COPYSIGN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); 3266 BUILD(r, WASM_F32_COPYSIGN(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
3272 3267
3273 FOR_FLOAT32_INPUTS(i) { 3268 FOR_FLOAT32_INPUTS(i) {
3274 FOR_FLOAT32_INPUTS(j) { CheckFloatEq(copysign(*i, *j), r.Call(*i, *j)); } 3269 FOR_FLOAT32_INPUTS(j) { CheckFloatEq(copysign(*i, *j), r.Call(*i, *j)); }
3275 } 3270 }
3276 } 3271 }
3277 3272
3278 #endif 3273 #endif
OLDNEW
« no previous file with comments | « test/cctest/compiler/value-helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698