|
|
@ -2245,16 +2245,18 @@ c_t generic_dot_product(const std::vector<a_t>& a, const std::vector<b_t>& b, c_ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#define ZVLDOT_LOOP(a_t, b_t, c_t, dot) \ |
|
|
#define ZVLDOT_LOOP(a_t, b_t, c_t, dot) \ |
|
|
std::vector<a_t> a(P.VU.vlmax, a_t()); \ |
|
|
if (auto vl = P.VU.vl->read()) { \ |
|
|
std::vector<b_t> b(P.VU.vlmax, b_t()); \ |
|
|
std::vector<a_t> a(P.VU.vlmax, a_t()); \ |
|
|
for (reg_t i = 0, vl = P.VU.vl->read(); i < vl; i++) { \ |
|
|
std::vector<b_t> b(P.VU.vlmax, b_t()); \ |
|
|
VI_LOOP_ELEMENT_SKIP(); \ |
|
|
for (reg_t i = 0; i < vl; i++) { \ |
|
|
a[i] = P.VU.elt<a_t>(insn.rs1(), i); \ |
|
|
VI_LOOP_ELEMENT_SKIP(); \ |
|
|
b[i] = P.VU.elt<b_t>(insn.rs2(), i); \ |
|
|
a[i] = P.VU.elt<a_t>(insn.rs1(), i); \ |
|
|
} \ |
|
|
b[i] = P.VU.elt<b_t>(insn.rs2(), i); \ |
|
|
auto& acc = P.VU.elt<c_t>(insn.rd(), 0, true); \ |
|
|
} \ |
|
|
acc = dot(a, b, acc); \ |
|
|
auto& acc = P.VU.elt<c_t>(insn.rd(), 0, true); \ |
|
|
set_fp_exceptions; |
|
|
acc = dot(a, b, acc); \ |
|
|
|
|
|
set_fp_exceptions; \ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#define ZVLDOT_GENERIC_LOOP(a_t, b_t, c_t, macc) \ |
|
|
#define ZVLDOT_GENERIC_LOOP(a_t, b_t, c_t, macc) \ |
|
|
auto dot = std::bind(generic_dot_product<a_t, b_t, c_t>, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, macc); \ |
|
|
auto dot = std::bind(generic_dot_product<a_t, b_t, c_t>, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, macc); \ |
|
|
@ -2265,18 +2267,20 @@ c_t generic_dot_product(const std::vector<a_t>& a, const std::vector<b_t>& b, c_ |
|
|
ZVLDOT_GENERIC_LOOP(a_t, b_t, c_t, macc) |
|
|
ZVLDOT_GENERIC_LOOP(a_t, b_t, c_t, macc) |
|
|
|
|
|
|
|
|
#define ZVBDOT_LOOP(a_t, b_t, c_t, dot) \ |
|
|
#define ZVBDOT_LOOP(a_t, b_t, c_t, dot) \ |
|
|
for (reg_t idx = 0; idx < 8; idx++) { \ |
|
|
if (auto vl = P.VU.vl->read()) { \ |
|
|
reg_t i = ci + idx; \ |
|
|
for (reg_t idx = 0; idx < 8; idx++) { \ |
|
|
VI_LOOP_ELEMENT_SKIP(); \ |
|
|
reg_t i = ci + idx; \ |
|
|
std::vector<a_t> a(P.VU.vlmax, a_t()); \ |
|
|
VI_LOOP_ELEMENT_SKIP(); \ |
|
|
std::vector<b_t> b(P.VU.vlmax, b_t()); \ |
|
|
std::vector<a_t> a(P.VU.vlmax, a_t()); \ |
|
|
for (reg_t k = 0, vl = P.VU.vl->read(); k < vl; k++) { \ |
|
|
std::vector<b_t> b(P.VU.vlmax, b_t()); \ |
|
|
a[k] = P.VU.elt<a_t>(insn.rs1(), k); \ |
|
|
for (reg_t k = 0; k < vl; k++) { \ |
|
|
b[k] = P.VU.elt<b_t>(vs2 + idx, k); \ |
|
|
a[k] = P.VU.elt<a_t>(insn.rs1(), k); \ |
|
|
|
|
|
b[k] = P.VU.elt<b_t>(vs2 + idx, k); \ |
|
|
|
|
|
} \ |
|
|
|
|
|
auto& acc = P.VU.elt<c_t>(insn.rd(), i, true); \ |
|
|
|
|
|
acc = dot(a, b, acc); \ |
|
|
|
|
|
set_fp_exceptions; \ |
|
|
} \ |
|
|
} \ |
|
|
auto& acc = P.VU.elt<c_t>(insn.rd(), i, true); \ |
|
|
|
|
|
acc = dot(a, b, acc); \ |
|
|
|
|
|
set_fp_exceptions; \ |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#define ZVBDOT_GENERIC_LOOP(a_t, b_t, c_t, macc) \ |
|
|
#define ZVBDOT_GENERIC_LOOP(a_t, b_t, c_t, macc) \ |
|
|
|