Closed Bug 1799919 Opened 2 years ago Closed 2 years ago

V128::extractLane converts NaN to qNaN on x86 32-bit platforms.

Categories

(Core :: JavaScript: WebAssembly, defect)

x86
Unspecified
defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: yury, Assigned: yury)

References

()

Details

Attachments

(1 file)

We have:

template <typename T>
  T extractLane(unsigned char *bytes, unsigned lane) {
    T result;
    memcpy(&result, bytes + sizeof(T) * lane, sizeof(T));
    return result;
  }

float user( unsigned char *s) { return extractLane<float>(s, 0);}

And on X86 it produces:

  movl 4(%esp), %eax
  flds (%eax)
  retl

vs on X64:

  movss (%rdi), %xmm0
  retq

The flds converts stuff to qNaNs, which we don't expect in wasm world.

Hardware: Unspecified → x86

The same logic, but it avoid generation of FLDS instruction at
low level.

Assignee: nobody → ydelendik
Status: NEW → ASSIGNED
Pushed by ydelendik@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c12c629265d0 Refactor V128::extractLane to avoid FLDS on X86. r=jseward
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: