1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:17:44 +00:00

LibWasm: Implement checked truncation instructions

This implements the 8 i<n>.truncate.f<n>_<s> instructions.
This commit is contained in:
Ali Mohammad Pur 2021-05-18 01:19:40 +04:30 committed by Ali Mohammad Pur
parent 59e01e2813
commit a21ebae652
3 changed files with 86 additions and 10 deletions

View file

@ -20,6 +20,13 @@ private:
ReadonlyBytes load_from_memory(Configuration&, const Instruction&, size_t);
void store_to_memory(Configuration&, const Instruction&, ReadonlyBytes data);
void call_address(Configuration&, FunctionAddress);
template<typename V, typename T>
MakeUnsigned<T> checked_unsigned_truncate(V);
template<typename V, typename T>
MakeSigned<T> checked_signed_truncate(V);
Vector<NonnullOwnPtr<Value>> pop_values(Configuration& configuration, size_t count);
bool trap_if_not(bool value)
{