From ae83408c277ed0320c137def8dea9de04abb9bc6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 20 Feb 2023 15:08:00 +0900 Subject: [PATCH 1/2] BasicCABI.md: mention how function pointers look like --- BasicCABI.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BasicCABI.md b/BasicCABI.md index 01c715e..3a02dca 100644 --- a/BasicCABI.md +++ b/BasicCABI.md @@ -96,6 +96,15 @@ Bitfield type | Witdh *w* | Range `signed long long` | 1 to 64 | -2(w-1) to 2(w-1)-1 `long long`, `unsigned long long` | 1 to 64 | 0 to 2w-1 +**Function pointers** + +A pointer to a function is an index into the table 0 of the module. +The type of the table is funcref. +The table needs to be exported with the name `__indirect_function_table` +if the function pointer is possibly used from the outside of the module. +Eg. If the module passes a function pointer to a host function as +a callback. + **SIMD Vector types** The ABI for vector types is not stable and may change as new optimization opportunities are From daf2f3515cbb8be245b733cd5e6c6fb9371a7a85 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 14 Apr 2023 15:55:00 +0900 Subject: [PATCH 2/2] drop a table 0 assumption --- BasicCABI.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BasicCABI.md b/BasicCABI.md index 3a02dca..6bae527 100644 --- a/BasicCABI.md +++ b/BasicCABI.md @@ -98,7 +98,7 @@ Bitfield type | Witdh *w* | Range **Function pointers** -A pointer to a function is an index into the table 0 of the module. +A pointer to a function is an index into a table of the module. The type of the table is funcref. The table needs to be exported with the name `__indirect_function_table` if the function pointer is possibly used from the outside of the module.