Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaikh-Ubaid committed Apr 7, 2023
1 parent e9b6b55 commit cb52e88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/libasr/codegen/asr_to_wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
}

});
wa.emit_return();
});
}

Expand Down Expand Up @@ -366,6 +367,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {

wa.emit_local_get(3);
wa.emit_call(m_rt_func_used_idx[print_i64]);
wa.emit_return();
});
}

Expand All @@ -379,6 +381,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
wa.emit_local_get(1);
wa.emit_local_get(3);
wa.emit_f32_add();
wa.emit_return();
});
}

Expand All @@ -392,6 +395,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
wa.emit_local_get(1);
wa.emit_local_get(3);
wa.emit_f64_add();
wa.emit_return();
});
}

Expand All @@ -405,6 +409,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
wa.emit_local_get(1);
wa.emit_local_get(3);
wa.emit_f32_sub();
wa.emit_return();
});
}

Expand All @@ -418,6 +423,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
wa.emit_local_get(1);
wa.emit_local_get(3);
wa.emit_f64_sub();
wa.emit_return();
});
}

Expand All @@ -443,6 +449,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
wa.emit_f32_mul();

wa.emit_f32_add();
wa.emit_return();
});
}

Expand All @@ -468,6 +475,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
wa.emit_f64_mul();

wa.emit_f64_add();
wa.emit_return();
});
}

Expand All @@ -484,6 +492,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {

wa.emit_f32_add();
wa.emit_f32_sqrt();
wa.emit_return();
});
}

Expand All @@ -500,6 +509,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {

wa.emit_f64_add();
wa.emit_f64_sqrt();
wa.emit_return();
});
}

Expand Down
1 change: 0 additions & 1 deletion src/libasr/codegen/wasm_assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ class WASMAssembler: public WASM_INSTS_VISITOR::WASMInstsAssembler<WASMAssembler

func_body();

wasm::emit_b8(m_code_section, m_al, 0x0F); // wasm return instruction
wasm::emit_expr_end(m_code_section, m_al);
wasm::fixup_len(m_code_section, m_al, len_idx_code_section_func_size);

Expand Down

0 comments on commit cb52e88

Please sign in to comment.