From 6852d1d2990d2e2c72294bddbf1c4267d038241d Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Mon, 17 Feb 2025 16:16:39 +0100 Subject: [PATCH] adds Vector Widening Integer Multiply-Add Instructions --- src/vm/vector_functions.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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"); }