Closed Bug 1762899 Opened 3 years ago Closed 3 years ago

WASM C standard library atan2(-1,0) is returning pi/2 instead of -pi/2

Categories

(Core :: JavaScript: WebAssembly, defect, P2)

ARM64
All
defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox-esr91 --- fixed
firefox98 --- wontfix
firefox99 --- fixed
firefox100 --- fixed
firefox101 --- fixed

People

(Reporter: rhunt, Assigned: yury)

References

Details

Attachments

(1 file, 1 obsolete file)

Source: https://github.com/mozilla-mobile/fenix/issues/24565

According to RyanVM, this still reproduces on his Pixel 3 with Fenix Nightly.

Yury, can you take a look?

Flags: needinfo?(ydelendik)
Severity: -- → S3
Priority: -- → P2

I can reproduce on arm64 simulator.

Assignee: nobody → ydelendik
Flags: needinfo?(ydelendik)
OS: Android → All

The guess about copysign was the correct one: in case when rhs == output in MacroAssembler::copySignDouble we were overwriting rhs by lhs, so the operation becomes noop. The simple test case to reproduce is:

  (func (param f64 f64) (result f64)
    f64.const 0x1.921fb54442d18p+0 (;=1.5708;)
    local.get 0
    f64.copysign
  )

Using defineReuseInput in LIRGenerator to avoid rhs == output case in copySignDouble().

Attachment #9270785 - Attachment is obsolete: true
Pushed by ydelendik@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/62b1090431b0 Fix {f32,f64}.copysign for Aarch64. r=lth
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch

Comment on attachment 9270975 [details]
Bug 1762899 - Fix {f32,f64}.copysign for Aarch64. r?lth

Beta/Release Uplift Approval Request

  • User impact if declined: Some wasm application may not work properly on Aarch64 or Apple M1 hardware.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The changes only affect the code that produces the error, limited to the affected platform, and tests are provided.
  • String changes made/needed:

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Having the proper implementation of Wasm SIMD is somewhat important -- new application that use this technology are appearing on the market at this moment and could cause issues for ESRs.
  • User impact if declined: Some wasm application may not work properly on Aarch64 or Apple M1 hardware.
  • Fix Landed on Version: 101
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The changes only affect the code that produces the error, limited to the affected platform, and tests are provided.
Attachment #9270975 - Flags: approval-mozilla-release?
Attachment #9270975 - Flags: approval-mozilla-esr91?
Attachment #9270975 - Flags: approval-mozilla-beta?

Comment on attachment 9270975 [details]
Bug 1762899 - Fix {f32,f64}.copysign for Aarch64. r?lth

Approved for 100.0b3

Attachment #9270975 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9270975 [details]
Bug 1762899 - Fix {f32,f64}.copysign for Aarch64. r?lth

Important ARM64 WASM correctness fix with tests. Approved for 91.9esr.

Attachment #9270975 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

Comment on attachment 9270975 [details]
Bug 1762899 - Fix {f32,f64}.copysign for Aarch64. r?lth

Approved for 99.0.1 and Fenix/Focus 99.2.0

Attachment #9270975 - Flags: approval-mozilla-release? → approval-mozilla-release+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: