OSDN Git Service

target/i386: DPPS rounding fix
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 25 Aug 2022 16:47:50 +0000 (18:47 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Sep 2022 06:37:04 +0000 (08:37 +0200)
commitbf30ad8cefeb3b199f5485c5d78f2801cd248264
treec557ab9696f23b3e3363c857e8d724d3221b74d2
parent75046ad72eaaae954849e2b793b6f629befb4ebc
target/i386: DPPS rounding fix

The DPPS (Dot Product) instruction is defined to first sum pairs of
intermediate results, then sum those values to get the final result.
i.e. (A+B)+(C+D)

We incrementally sum the results, i.e. ((A+B)+C)+D, which can result
in incorrect rouding.

For consistency, also change the variable names to the ones used
in the Intel SDM and implement DPPD following the manual.

Based on a patch by Paul Brook <paul@nowt.org>.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/ops_sse.h