Skip to content

Conversation

@shravanrn
Copy link
Collaborator

@shravanrn shravanrn commented Jul 30, 2023

This is a clean slate attempt to fix #2266. To fix this i looked into how clang and gcc handle floating point constraints across a host of platforms.

Godbolt link: https://godbolt.org/z/ddeWc6ees
Results are in table below.

Given this, it seems the simplest course of action that maintains functionality as is today, but fix the mips platform is to special case this. We can separately file a bug upstream (but best case scenario is that will likely get fixed only for future clang versions, so I'm not sure we can rely on just that).

Fyi, @glandium

gcc

x86 - both
x86-64 - both
aarch32 - only "r"
aarch64 - only "r"
mips - only "r"
mips64 - both
riscv32 - both
riscv64 - both
sparc - both
sparc64 - both
powerpc - both
powerpc64 - both

clang

x86 - both
x64 - both
aarch32 - only "r"
aarch64 - only "r"
mips - only "f"
mips64 - only "f"
riscv32 - both
riscv64 - both
powerpc64 - both

@shravanrn shravanrn requested review from keithw and sbc100 July 30, 2023 18:37
Copy link
Member

@keithw keithw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % comment. Thank you for doing this whole investigation!

@shravanrn shravanrn force-pushed the wasm2c-force-read-mips branch from db91146 to f482040 Compare July 30, 2023 19:01
@shravanrn
Copy link
Collaborator Author

lgtm % comment. Thank you for doing this whole investigation!

Fixed 👍

@shravanrn shravanrn enabled auto-merge (rebase) July 30, 2023 19:06
@shravanrn shravanrn merged commit 70b1c9d into WebAssembly:main Jul 30, 2023
Copy link
Member

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this could be accompanied by some kind CI test? Can this be verified by simply compiling some wasm2c output with clang --target=mips maybe?

@shravanrn
Copy link
Collaborator Author

shravanrn commented Jul 30, 2023

I wonder if this could be accompanied by some kind CI test? Can this be verified by simply compiling some wasm2c output with clang --target=mips maybe?

Open to it, but my take is that this feels like overkill at the moment. I tested this approach on Godbolt to make sure it works. I think we can push this until/if we see other mips incompatibilities

@keithw keithw mentioned this pull request Oct 24, 2023
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Jan 30, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Feb 7, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Feb 7, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Mar 8, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Mar 12, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Apr 3, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Apr 8, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request May 10, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request May 20, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request May 20, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request May 30, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Jun 1, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Jul 4, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Jul 30, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Jul 30, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Aug 28, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Aug 28, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
raspbian-autopush pushed a commit to raspbian-packages/firefox-esr that referenced this pull request Sep 5, 2025
WebAssembly/wabt#2274

Gbp-Pq: Topic fixes
Gbp-Pq: Name Apply-wasm2c-upstream-fix-for-clang-targetting-mips.patch
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sakura286 pushed a commit to Sakura286/firefox-debian that referenced this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error: couldn't allocate input reg for constraint 'r' on MIPS with clang when compiling wasm2c-generated source

3 participants