mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 15:37:47 +00:00
Fix asm modifiers in add_dpbusd_epi32x2 implementations
The accumulator should be an earlyclobber because it is written before all input operands are read. Otherwise, the asm code computes a wrong result if the accumulator shares a register with one of the other input operands (which happens if we pass in the same expression for the accumulator and the operand). Closes https://github.com/official-stockfish/Stockfish/pull/4339 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
3d2381d76d
commit
da5bcec481
@@ -153,7 +153,7 @@ namespace Stockfish::Simd {
|
|||||||
asm(
|
asm(
|
||||||
"vpdpbusd %[b0], %[a0], %[acc]\n\t"
|
"vpdpbusd %[b0], %[a0], %[acc]\n\t"
|
||||||
"vpdpbusd %[b1], %[a1], %[acc]\n\t"
|
"vpdpbusd %[b1], %[a1], %[acc]\n\t"
|
||||||
: [acc]"+v"(acc)
|
: [acc]"+&v"(acc)
|
||||||
: [a0]"v"(a0), [b0]"vm"(b0), [a1]"v"(a1), [b1]"vm"(b1)
|
: [a0]"v"(a0), [b0]"vm"(b0), [a1]"v"(a1), [b1]"vm"(b1)
|
||||||
);
|
);
|
||||||
# else
|
# else
|
||||||
@@ -249,7 +249,7 @@ namespace Stockfish::Simd {
|
|||||||
asm(
|
asm(
|
||||||
VNNI_PREFIX "vpdpbusd %[b0], %[a0], %[acc]\n\t"
|
VNNI_PREFIX "vpdpbusd %[b0], %[a0], %[acc]\n\t"
|
||||||
VNNI_PREFIX "vpdpbusd %[b1], %[a1], %[acc]\n\t"
|
VNNI_PREFIX "vpdpbusd %[b1], %[a1], %[acc]\n\t"
|
||||||
: [acc]"+v"(acc)
|
: [acc]"+&v"(acc)
|
||||||
: [a0]"v"(a0), [b0]"vm"(b0), [a1]"v"(a1), [b1]"vm"(b1)
|
: [a0]"v"(a0), [b0]"vm"(b0), [a1]"v"(a1), [b1]"vm"(b1)
|
||||||
);
|
);
|
||||||
# else
|
# else
|
||||||
|
|||||||
Reference in New Issue
Block a user