Commit dde93768 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

Add int64_t min and max to value helpers for test

And also fix up a truncate float to int test that was using
int list as input instead of a float list.

Change-Id: I544e38b2d212f8d11dfb5758db4fe6b283acae0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2419654Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70774}
parent 80a75329
......@@ -9,6 +9,7 @@
#include "src/base/bits.h"
#include "src/base/ieee754.h"
#include "src/base/overflowing-math.h"
#include "src/base/safe_conversions.h"
#include "src/base/utils/random-number-generator.h"
#include "src/common/ptr-compr-inl.h"
#include "src/objects/objects-inl.h"
......@@ -6548,9 +6549,11 @@ TEST(RunTryTruncateFloat64ToInt64WithoutCheck) {
BufferedRawMachineAssemblerTester<int64_t> m(MachineType::Float64());
m.Return(m.TryTruncateFloat64ToInt64(m.Parameter(0)));
FOR_INT64_INPUTS(i) {
double input = static_cast<double>(i);
CHECK_EQ(static_cast<int64_t>(input), m.Call(input));
FOR_FLOAT64_INPUTS(i) {
if (base::IsValueInRangeForNumericType<int64_t>(i)) {
double input = static_cast<double>(i);
CHECK_EQ(static_cast<int64_t>(input), m.Call(input));
}
}
}
......
......@@ -273,6 +273,8 @@ class ValueHelper {
0x000007FFFFFFFFFF, 0x000003FFFFFFFFFF, 0x000001FFFFFFFFFF,
0x8000008000000000, 0x8000008000000001, 0x8000000000000400,
0x8000000000000401, 0x0000000000000020,
0x8000000000000000, // int64_t min
0x7FFFFFFFFFFFFFFF, // int64_t max
// Bit pattern of a quiet NaN and signaling NaN, with or without
// additional payload.
0x7FF8000000000000, 0x7FF0000000000000, 0x7FF8123456789ABC,
......
......@@ -250,6 +250,8 @@ WASM_EXEC_TEST(I64RemS) {
FOR_INT64_INPUTS(j) {
if (j == 0) {
CHECK_TRAP64(r.Call(i, j));
} else if (j == -1) {
CHECK_EQ(0, r.Call(i, j));
} else {
CHECK_EQ(i % j, r.Call(i, j));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment