You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just create a WASM function complex_add(), which accepts the two operands a,b on stack and returns the result on stack (this function is implemented in asr_to_wasm directly using wasm instructions). Each complex number is represented by two floating point numbers on stack.
Using ASR->ASR pass
This pass would work similarly to pass_compare.cpp which inserts new ASR functions (to global scope) to implement a given operation (and only inserts it once and reuses it everywhere).
Surface language
The code for complex operations can also be implemented in the surface language. This approach is almost equivalent to the previous ASR->ASR pass approach, except that the operations are not implemented directly in ASR but rather in the surface language and compiled to ASR. We can for example maintain a precompiled version of such functions in the .mod file format that is just serialized ASR.
Add complex numbers and operations on them.
The text was updated successfully, but these errors were encountered: