OSDN Git Service

Hexagon (target/hexagon) Change subtract from zero to change sign
authorTaylor Simpson <tsimpson@quicinc.com>
Tue, 7 Mar 2023 02:58:25 +0000 (18:58 -0800)
committerTaylor Simpson <tsimpson@quicinc.com>
Tue, 7 Mar 2023 04:47:12 +0000 (20:47 -0800)
commit1a442c09310de23d7cab4c5efedba607c2672d44
tree8f1af14ee17dc6dd500528d978844752ee494b34
parent1c629814f708e58aac6fa6da0d3725df5c831c4c
Hexagon (target/hexagon) Change subtract from zero to change sign

The F2_sffms instruction [r0 -= sfmpy(r1, r2)] doesn't properly
handle -0.  Previously we would negate the input operand by subtracting
from zero.  Instead, we negate by changing the sign bit.

Test case added to tests/tcg/hexagon/fpstuff.c

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20230307025828.1612809-12-tsimpson@quicinc.com>
target/hexagon/op_helper.c
tests/tcg/hexagon/fpstuff.c