-
Ng Zhi An authored
Quasi Fused Multiply-Add and Quasi Fused Multiply-Subtract performs, on floats, a + b * c and a - b * c respectively. When there is only a single rounding, it is a fused operation. Quasi in this case means that the result can either be fused or not fused (two roundings), depending on hardware support. It is tricky to write the test because we need to calculate the expected value, and there is no easy way to express fused or unfused operation in C++, i.e. we cannot confirm that float expected = a + b * c will perform a fused or unfused operation (unless we use intrinsics). Thus in the test we have a list of simple checks, plus interesting values that we know will produce different results depending on whether it was fused or not. The difference between 32x4 and 64x2 qfma/qfms is the type, and also the values of b and c that will cause an overflow, and thus the intermediate rounding will affect the final result. The same array can be copy pasted for both types, but with a bit of templating we can avoid that duplication. Change-Id: I0973a3d28468d25f310b593c72f21bff54d809a7 Bug: v8:9415 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1779325 Commit-Queue: Zhi An Ng <zhin@chromium.org> Reviewed-by: Deepti Gandluri <gdeepti@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#63878}
2cf821cc