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

Unified Diff: test/cctest/compiler/test-run-machops.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, 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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc b/test/cctest/compiler/test-run-machops.cc
index d6b385c52ce7a88ed10b72f167b986882d68e7f2..0c4ab1b06887e41f308b752af5fc03fbc31924cd 100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -5588,6 +5588,19 @@ TEST(RunCallCFunction8) {
}
#endif // USE_SIMULATOR
+TEST(RunCallExternalReferenceF64Trunc) {
+ BufferedRawMachineAssemblerTester<double> m(MachineType::Float64());
+ Node* stack_slot = m.StackSlot(MachineRepresentation::kFloat64);
+ m.Store(MachineRepresentation::kFloat64, stack_slot, m.Parameter(0),
+ WriteBarrierKind::kNoWriteBarrier);
+ Node* function = m.ExternalConstant(
+ ExternalReference::trunc64_wrapper_function(m.isolate()));
+ m.CallCFunction1(MachineType::Pointer(), MachineType::Pointer(), function,
+ stack_slot);
+ m.Return(m.Load(MachineType::Float64(), stack_slot));
+ FOR_FLOAT64_INPUTS(i) { CheckDoubleEq(trunc(*i), m.Call(*i)); }
+}
+
#if V8_TARGET_ARCH_64_BIT
// TODO(titzer): run int64 tests on all platforms when supported.
TEST(RunCheckedLoadInt64) {

Powered by Google App Engine
This is Rietveld 408576698