JM: Detect MUL overflow on ARM.

RESOLVED DUPLICATE of bug 673314

Status

()

enhancement
RESOLVED DUPLICATE of bug 673314
9 years ago
8 years ago

People

(Reporter: jbramley, Assigned: jbramley)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Assignee

Description

9 years ago
From jsop_binary:
----
#if defined(JS_CPU_ARM)
        /* ARM cannot detect integer overflow with multiplication. */
        || op == JSOP_MUL
#endif /* JS_CPU_ARM */
----

It is possible using this sequence:

SMULL   rLo, rHi, rA, rB
CMP     rHi, rLo, ASR #31

The 32-bit result will be in rLo. rHi can be any scratch register. The only caveat is that the sequence sets the Z flag, not the V flag.
Assignee

Updated

8 years ago
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 673314
You need to log in before you can comment on or make changes to this bug.