From 9ba9d2432c6c8594b5d172766bcac3b0fe6df456 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Mon, 17 Feb 2025 15:19:56 +0100 Subject: [PATCH] adds Vector Widening Integer Multiply Instructions --- src/vm/vector_functions.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/vm/vector_functions.hpp b/src/vm/vector_functions.hpp index c82462d..d00624c 100644 --- a/src/vm/vector_functions.hpp +++ b/src/vm/vector_functions.hpp @@ -270,9 +270,20 @@ std::function get_funct(unsigned funct6, return static_cast>(static_cast>(vs2) - static_cast>(vs1)); }; - // case 0b111000: // VWMULU - // case 0b111010: // VWMULSU - // case 0b111011: // VWMUL + case 0b111000: // VWMULU + return [](src2_elem_t vs2, src1_elem_t vs1) { + return (static_cast>(vs2) * static_cast>(vs1)); + }; + case 0b111010: // VWMULSU + return [](src2_elem_t vs2, src1_elem_t vs1) { + return (static_cast>>(static_cast>(vs2)) * + static_cast>(vs1)); + }; + case 0b111011: // VWMUL + return [](src2_elem_t vs2, src1_elem_t vs1) { + return (static_cast>>(static_cast>(vs2)) * + static_cast>>(static_cast>(vs1))); + }; // case 0b111100: // VWMACCU // case 0b111101: // VWMACC // case 0b111110: // VWMACCUS