emscripten-core / emscripten-core/emscripten

Wasm2JS double heap assignments get split into two i32 assignments.

Open
#13,365 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 6h
Merged PRs (30d)
109

Description

In https://github.com/juj/wasm_webgpu/commit/4c2600b0f6549f95fe9251cba629c935fbc74ba8, I have the following code:

```c
WGpuRenderPassColorAttachment colorAttachment = {};
...
colorAttachment.loadColor[3] = 0.05;
```
here `loadColor` struct member is of type `double loadColor[4]`. When building with WASM2JS, I see

```js
HEAP32[$1 + 88 >> 2] = -1259857073;
HEAP32[$1 + 92 >> 2] = 1063997057;
```
getting generated for the double number heap set operation, instead of a
```js
HEAPF64[$1 + 88 >> 3] = 0.05;
```
I wonder if this is some special case, or if Wasm2JS does not do HEAPF64 assignments?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.