diff --git a/src/vm/vector_functions.hpp b/src/vm/vector_functions.hpp index 88de862..9f75b13 100644 --- a/src/vm/vector_functions.hpp +++ b/src/vm/vector_functions.hpp @@ -85,6 +85,20 @@ std::function<dest_elem_t(src2_elem_t, src1_elem_t)> get_funct(unsigned funct) { return [](src2_elem_t vs2, src1_elem_t vs1) { return vs2 - vs1; }; case 0b000011: // VRSUB return [](src2_elem_t vs2, src1_elem_t vs1) { return vs1 - vs2; }; + case 0b000100: // VMINU + return [](src2_elem_t vs2, src1_elem_t vs1) { return std::min(vs2, static_cast<src2_elem_t>(vs1)); }; + case 0b000101: // VMIN + return [](src2_elem_t vs2, src1_elem_t vs1) { + return std::min(static_cast<typename std::make_signed_t<src2_elem_t>>(vs2), + static_cast<typename std::make_signed_t<src2_elem_t>>(vs1)); + }; + case 0b000110: // VMAXU + return [](src2_elem_t vs2, src1_elem_t vs1) { return std::max(vs2, static_cast<src2_elem_t>(vs1)); }; + case 0b000111: // VMAX + return [](src2_elem_t vs2, src1_elem_t vs1) { + return std::max(static_cast<typename std::make_signed_t<src2_elem_t>>(vs2), + static_cast<typename std::make_signed_t<src2_elem_t>>(vs1)); + }; case 0b001001: // VAND return [](src2_elem_t vs2, src1_elem_t vs1) { return vs1 & vs2; }; case 0b001010: // VOR