diff --git a/src/vm/vector_functions.hpp b/src/vm/vector_functions.hpp index c35740f..80da546 100644 --- a/src/vm/vector_functions.hpp +++ b/src/vm/vector_functions.hpp @@ -288,11 +288,20 @@ std::function get_funct(unsi return (static_cast>>(static_cast>(vs2)) * static_cast>>(static_cast>(vs1))); }; - // case 0b111100: // VWMACCU - // case 0b111101: // VWMACC - // case 0b111110: // VWMACCUS - // case 0b111111: // VWMACCSU - + case 0b111100: // VWMACCU + return [](dest_elem_t vd, src2_elem_t vs2, src1_elem_t vs1) { return vs1 * vs2 + vd; }; + case 0b111101: // VWMACC + return [](dest_elem_t vd, src2_elem_t vs2, src1_elem_t vs1) { + return static_cast>(vs1) * static_cast>(vs2) + vd; + }; + case 0b111110: // VWMACCUS + return [](dest_elem_t vd, src2_elem_t vs2, src1_elem_t vs1) { + return vs1 * static_cast>(vs2) + vd; + }; + case 0b111111: // VWMACCSU + return [](dest_elem_t vd, src2_elem_t vs2, src1_elem_t vs1) { + return static_cast>(vs1) * vs2 + vd; + }; default: throw new std::runtime_error("Uknown funct6 in get_funct"); }