target/ppc: implement cbcdtd
commit38d3690bda3fe217ea72903859907916a5429c6e
authorMatheus Ferst <matheus.ferst@eldorado.org.br>
Wed, 29 Jun 2022 16:29:03 +0000 (29 13:29 -0300)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 6 Jul 2022 13:22:38 +0000 (6 10:22 -0300)
treea28e2139e1c66d39bcaef4b59547747359da0933
parent6addef4d272684ba624c9fcaf66bc67e5fc4a93f
target/ppc: implement cbcdtd

Implements the Convert Binary Coded Decimal To Declets instruction.
Since libdecnumber doesn't expose the methods for direct conversion
(decDigitsToDPD, BCD2DPD, etc.), the BCD values are converted to
decimal32 format, from which the declets are extracted.

Where the behavior is undefined, we try to match the result observed in
a POWER9 DD2.3.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Signed-off-by: VĂ­ctor Colombo <victor.colombo@eldorado.org.br>
Message-Id: <20220629162904.105060-11-victor.colombo@eldorado.org.br>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
target/ppc/dfp_helper.c
target/ppc/helper.h
target/ppc/insn32.decode
target/ppc/translate/fixedpoint-impl.c.inc