Skip to content

Commit

Permalink
BasicCABI.md: add a note about emscripten long double alignment
Browse files Browse the repository at this point in the history
Emscripten uses a bit different ABI from others.

References:
emscripten-core/emscripten#14456
https://reviews.llvm.org/D104808
  • Loading branch information
yamt committed Apr 12, 2024
1 parent 64f67c9 commit 1e49fe9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions BasicCABI.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ General type | C Type | `sizeof` | Alignment (bytes) | Wasm Value Type
Floating point | `float` | 4 | 4 | f32
Floating point | `double` | 8 | 8 | f64
Floating point | `long double` | 16 | 16 | (none)
Floating point | `long double` (Emscripten) | 16 | 8 | (none)

* `long double` values correspond to 128-bit IEEE-754 quad-precision binary128 values.
Operations on these values are currently implemented as calls to
Expand All @@ -54,6 +55,7 @@ General type | C Type | `sizeof` | Alignment (bytes) | Wasm Value Type
by an `unsigned int`.
Otherwise, if a compiler supports such an `enum`, it would use `i64`
for the `enum`.
* Emscripten uses 8 byte alignment for `long double`.

**Aggregates and Unions**

Expand Down

0 comments on commit 1e49fe9

Please sign in to comment.