diff options
author | Keith Winstein <keithw@cs.stanford.edu> | 2022-07-11 17:12:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 17:12:49 -0700 |
commit | a7d484ef3d1f64649dd9f48cb1d5434f0fda561b (patch) | |
tree | 817862cfd2bbf1ac5290b9d0a55087ad6ccf8ebc /wasm2c/wasm-rt.h | |
parent | 4132e35b51849678ac9e5592089e00057f260ccf (diff) | |
download | wabt-a7d484ef3d1f64649dd9f48cb1d5434f0fda561b.tar.gz wabt-a7d484ef3d1f64649dd9f48cb1d5434f0fda561b.tar.bz2 wabt-a7d484ef3d1f64649dd9f48cb1d5434f0fda561b.zip |
wasm2c: run tests with -O2 on non-Windows (#1939)
Enable optimization when compiling the wasm2c output on non-Windows platforms (effectively GCC and clang). This required:
- Preventing load instructions from being optimized away if their value is unused (using inline assembly with an input operand and empty code). This is necessary to force an OOB trap on platforms that use mprotect and the signal handler to detect OOB.
- Disabling tail-call optimization in the compiler, to make sure that infinite recursion traps. (This required bumping the version of macOS in GitHub Actions to get a new-enough AppleClang. We should revert this back to 'macos-latest' as soon as that becomes the default.)
- Using NaN-quieting versions of a bunch of FP ops that were previously only used on Windows, and adding floor/ceil and promotion/demotion.
- Using the '-frounding-math' and '-fsignaling-nans' compiler flags to tell GCC and clang not to fold certain FP ops (e.g. subtracting zero, multiplying by 1).
Fixes #1925.
Diffstat (limited to 'wasm2c/wasm-rt.h')
-rw-r--r-- | wasm2c/wasm-rt.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/wasm2c/wasm-rt.h b/wasm2c/wasm-rt.h index 167c4c40..fed82a27 100644 --- a/wasm2c/wasm-rt.h +++ b/wasm2c/wasm-rt.h @@ -264,22 +264,6 @@ void wasm_rt_allocate_table(wasm_rt_table_t*, */ void wasm_rt_free_table(wasm_rt_table_t*); -#ifdef _WIN32 -float wasm_rt_truncf(float x); -double wasm_rt_trunc(double x); -float wasm_rt_nearbyintf(float x); -double wasm_rt_nearbyint(double x); -float wasm_rt_fabsf(float x); -double wasm_rt_fabs(double x); -#else -#define wasm_rt_truncf(x) truncf(x) -#define wasm_rt_trunc(x) trunc(x) -#define wasm_rt_nearbyintf(x) nearbyintf(x) -#define wasm_rt_nearbyint(x) nearbyint(x) -#define wasm_rt_fabsf(x) fabsf(x) -#define wasm_rt_fabs(x) fabs(x) -#endif - #ifdef __cplusplus } #endif |