.\" -*- mode: troff; coding: utf-8 -*- .TH "wasmedgec" "1" "2023-03-21" .SH NAME .LP \fBwasmedgec\fR - AOT compiler for WasmEdge .SH SYNOPSIS .LP \fBwasmedgec\fR [\fIOPTIONS\fR] [\fC--\fR] \fCWASM_OR_SO\fR [\fIARG\fR \fC...\fR] .SH DESCRIPTION .LP The \fBwasmedgec\fR program compiles WebAssembly into native machine code, i.e. it is an Ahead-of-Time (AOT) compiler. .PP For pure WebAssembly, the \fBwasmedge\fR(1) program will execute the WebAssembly code in interpreter mode. However, after compiling it with the \fBwasmedgec\fR AOT compiler, the \fBwasmedge\fR tool can execute the WASM in AOT mode, with substantial performance improvements. .SH OPTIONS .SS Generic program information .LP \fC-h\fR, \fC--help\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Show the help messages. Will ignore other arguments below. .LP \fC-v\fR, \fC--version\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Show the version information. Will ignore other arguments below. .SS Basic options .LP \fC--dump\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Dump the LLVM IR to \fCwasm.ll\fR and \fCwasm-opt.ll\fR. .LP \fC--interruptible\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Generate a binary that supports interruptible execution. .LP \fC--generic-binary\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Generate a generic binary of the current host CPU architecture. .LP \fC--optimize\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Use \fC--optimize LEVEL\fR to set the optimization level. The \fCLEVEL\fR should be one of \fC0\fR, \fC1\fR, \fC2\fR, \fC3\fR, \fCs\fR, or \fCz\fR. The default value will be \fC2\fR, which means \fCO2\fR. .SS Statistics information .LP \fC--enable-time-measuring\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable generating code for counting time during execution. .LP \fC--enable-gas-measuring\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable generating code for counting gas burned during execution. .LP \fC--enable-instruction-count\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable generating code for counting WebAssembly instructions executed. .LP \fC--enable-all-statistics\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable generating code for all statistics options include instruction counting, gas measuring, and execution time. .SS WebAssembly proposals .LP \fC--disable-import-export-mut-globals\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable Import/Export of mutable globals proposal. .LP \fC--disable-non-trap-float-to-int\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable Non-trapping float-to-int conversions proposal. .LP \fC--disable-sign-extension-operators\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable Sign-extension operators proposal. .LP \fC--disable-multi-value\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable Multi-value proposal. .LP \fC--disable-bulk-memory\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable Bulk memory operations proposal. .LP \fC--disable-reference-types\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable Reference types proposal. .LP \fC--disable-simd\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Disable SIMD proposal. .LP \fC--enable-multi-memory\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable Multiple memories proposal. .LP \fC--enable-tail-call\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable Tail-call proposal. .LP \fC--enable-extended-const\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable Extended-const proposal. .LP \fC--enable-threads\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable Threads proposal. .LP \fC--enable-all\fR .if n \ .sp -1v .if t \ .sp -0.25v .IP "" \*(PI Enable all features. .SH EXAMPLE .LP Assuming a WebAssembly program placed under the file \fCfibonacci.wasm\fR, set up so to export a \fCfib()\fR function and accepting a single \fCi32\fR integer as the input parameter, one can execute the following: .LP .EX $ wasmedgec fibonacci.wasm fibonacci_aot.wasm $ time wasmedge --reactor fibonacci_aot.wasm fib 30 .EE .PP The execution should be much faster compared to interpreter mode: .LP .EX time wasmedge --reactor fibonacci.wasm fib 30 .EE .SH AUTHOR .LP Copyright \(co 2019-2022 Second State INC. Licensed under the Apache License, Version 2.0. .SH SEE ALSO .SS Regular manual pages .LP \fBwasmedge\fR(1) .SS Full documentation .LP A \fBcomplete manual of WasmEdge\fR <\fIhttps://wasmedge.org/docs/\fR> can be found online.