Commit 53a0cc84 authored by akos.palfi's avatar akos.palfi Committed by Commit bot

MIPS64: Fix trunc_l_[s,d] in simulator.

The trunc_l_[s,d] instructions incorrectly returns success when the input is INT64_MAX.

TEST=test-run-machops/RunTryTruncateFloat32ToInt64WithCheck,test-run-machops/RunTryTruncateFloat64ToInt64WithCheck
BUG=

Review URL: https://codereview.chromium.org/1539763003

Cr-Commit-Position: refs/heads/master@{#32968}
parent d3069388
......@@ -1441,7 +1441,7 @@ bool Simulator::set_fcsr_round_error(double original, double rounded) {
ret = true;
}
if (rounded > max_int32 || rounded < min_int32) {
if (rounded >= max_int32 || rounded < min_int32) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......@@ -1473,7 +1473,7 @@ bool Simulator::set_fcsr_round64_error(double original, double rounded) {
ret = true;
}
if (rounded > max_int64 || rounded < min_int64) {
if (rounded >= max_int64 || rounded < min_int64) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......@@ -1505,7 +1505,7 @@ bool Simulator::set_fcsr_round_error(float original, float rounded) {
ret = true;
}
if (rounded > max_int32 || rounded < min_int32) {
if (rounded >= max_int32 || rounded < min_int32) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......@@ -1537,7 +1537,7 @@ bool Simulator::set_fcsr_round64_error(float original, float rounded) {
ret = true;
}
if (rounded > max_int64 || rounded < min_int64) {
if (rounded >= max_int64 || rounded < min_int64) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......
......@@ -1246,7 +1246,7 @@ bool Simulator::set_fcsr_round_error(double original, double rounded) {
ret = true;
}
if (rounded > max_int32 || rounded < min_int32) {
if (rounded >= max_int32 || rounded < min_int32) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......@@ -1278,7 +1278,7 @@ bool Simulator::set_fcsr_round64_error(double original, double rounded) {
ret = true;
}
if (rounded > max_int64 || rounded < min_int64) {
if (rounded >= max_int64 || rounded < min_int64) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......@@ -1310,7 +1310,7 @@ bool Simulator::set_fcsr_round_error(float original, float rounded) {
ret = true;
}
if (rounded > max_int32 || rounded < min_int32) {
if (rounded >= max_int32 || rounded < min_int32) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......@@ -1460,7 +1460,7 @@ bool Simulator::set_fcsr_round64_error(float original, float rounded) {
ret = true;
}
if (rounded > max_int64 || rounded < min_int64) {
if (rounded >= max_int64 || rounded < min_int64) {
set_fcsr_bit(kFCSROverflowFlagBit, true);
// The reference is not really clear but it seems this is required:
set_fcsr_bit(kFCSRInvalidOpFlagBit, true);
......
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