Closed Bug 1455019 Opened 2 years ago Closed 2 years ago

[MIPS64] Add error detection for int64 <-> fp conversion in simulator

Categories

(Core :: JavaScript Engine: JIT, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: dragan.mladjenovic, Assigned: dragan.mladjenovic)

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attached patch bug1455019.patch (obsolete) — Splinter Review
Floating point conversion instruction that take/result in an int64 value now correctly set FCSR bit on error conditions. Patch also removes wrong casts for slt and ddiv instructions.
Assignee: nobody → dragan.mladjenovic
Attachment #8968967 - Flags: review?(bbouvier)
Priority: -- → P5
Comment on attachment 8968967 [details] [diff] [review]
bug1455019.patch

Review of attachment 8968967 [details] [diff] [review]:
-----------------------------------------------------------------

Seems legit, thanks.

::: js/src/jit/mips64/Simulator-mips64.cpp
@@ +1586,5 @@
>          ret = true;
>      }
>  
> +    if (rounded > (long double)std::numeric_limits<T>::max() ||
> +        rounded < (long double)std::numeric_limits<T>::min())

nit: can you make the conversion explicit on the LHS too?

@@ +3133,5 @@
>                  i64 = I64(rounded);
>                  setFpuRegister(fd_reg, i64);
> +                if (setFCSRRoundError<int64_t>(fs_value, rounded)) {
> +                    setFpuRegister(fd_reg, kFPUInvalidResult64);
> +                }

nit: here and below, no need for {} for single-line if-bodies
Attachment #8968967 - Flags: review?(bbouvier) → review+
Attachment #8968967 - Attachment is obsolete: true
Attachment #8970827 - Flags: review+
Keywords: checkin-needed
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/04e3c9e62313
[MIPS64] Add error detection for int64 <-> fp conversion in simulator; r=bbouvier
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/1b5f2913b206
[MIPS64] Add error detection for int64 <-> fp conversion in simulator. r=bbouvier
https://hg.mozilla.org/mozilla-central/rev/04e3c9e62313
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.