All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, danielhb413@gmail.com,
	peter.maydell@linaro.org, richard.henderson@linaro.org,
	"Víctor Colombo" <victor.colombo@eldorado.org.br>,
	"Fabiano Rosas" <farosas@linux.ibm.com>
Subject: [PULL 09/34] target/ppc: Change FPSCR_* to follow POWER ISA numbering convention
Date: Wed,  6 Jul 2022 17:09:21 -0300	[thread overview]
Message-ID: <20220706200946.471114-10-danielhb413@gmail.com> (raw)
In-Reply-To: <20220706200946.471114-1-danielhb413@gmail.com>

From: Víctor Colombo <victor.colombo@eldorado.org.br>

FPSCR_* bit values in QEMU are in the 'inverted' order from what Power
ISA defines (e.g. FPSCR.FI is bit 46 but is defined as 17 in cpu.h).
Now that PPC_BIT_NR macro was introduced to fix this situation for the
MSR bits, we can use it for the FPSCR bits too.

Also, adjust the comments to make then fit in 80 columns

Signed-off-by: Víctor Colombo <victor.colombo@eldorado.org.br>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Message-Id: <20220622193203.127698-1-victor.colombo@eldorado.org.br>
[danielhb: fixed 'exceptio' typo in target/ppc/cpu.h]
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 target/ppc/cpu.h | 72 ++++++++++++++++++++++++------------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index 6d78078f37..e109b5902b 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -694,42 +694,42 @@ enum {
 
 /*****************************************************************************/
 /* Floating point status and control register                                */
-#define FPSCR_DRN2   34 /* Decimal Floating-Point rounding control           */
-#define FPSCR_DRN1   33 /* Decimal Floating-Point rounding control           */
-#define FPSCR_DRN0   32 /* Decimal Floating-Point rounding control           */
-#define FPSCR_FX     31 /* Floating-point exception summary                  */
-#define FPSCR_FEX    30 /* Floating-point enabled exception summary          */
-#define FPSCR_VX     29 /* Floating-point invalid operation exception summ.  */
-#define FPSCR_OX     28 /* Floating-point overflow exception                 */
-#define FPSCR_UX     27 /* Floating-point underflow exception                */
-#define FPSCR_ZX     26 /* Floating-point zero divide exception              */
-#define FPSCR_XX     25 /* Floating-point inexact exception                  */
-#define FPSCR_VXSNAN 24 /* Floating-point invalid operation exception (sNan) */
-#define FPSCR_VXISI  23 /* Floating-point invalid operation exception (inf)  */
-#define FPSCR_VXIDI  22 /* Floating-point invalid operation exception (inf)  */
-#define FPSCR_VXZDZ  21 /* Floating-point invalid operation exception (zero) */
-#define FPSCR_VXIMZ  20 /* Floating-point invalid operation exception (inf)  */
-#define FPSCR_VXVC   19 /* Floating-point invalid operation exception (comp) */
-#define FPSCR_FR     18 /* Floating-point fraction rounded                   */
-#define FPSCR_FI     17 /* Floating-point fraction inexact                   */
-#define FPSCR_C      16 /* Floating-point result class descriptor            */
-#define FPSCR_FL     15 /* Floating-point less than or negative              */
-#define FPSCR_FG     14 /* Floating-point greater than or negative           */
-#define FPSCR_FE     13 /* Floating-point equal or zero                      */
-#define FPSCR_FU     12 /* Floating-point unordered or NaN                   */
-#define FPSCR_FPCC   12 /* Floating-point condition code                     */
-#define FPSCR_FPRF   12 /* Floating-point result flags                       */
-#define FPSCR_VXSOFT 10 /* Floating-point invalid operation exception (soft) */
-#define FPSCR_VXSQRT 9  /* Floating-point invalid operation exception (sqrt) */
-#define FPSCR_VXCVI  8  /* Floating-point invalid operation exception (int)  */
-#define FPSCR_VE     7  /* Floating-point invalid operation exception enable */
-#define FPSCR_OE     6  /* Floating-point overflow exception enable          */
-#define FPSCR_UE     5  /* Floating-point underflow exception enable          */
-#define FPSCR_ZE     4  /* Floating-point zero divide exception enable       */
-#define FPSCR_XE     3  /* Floating-point inexact exception enable           */
-#define FPSCR_NI     2  /* Floating-point non-IEEE mode                      */
-#define FPSCR_RN1    1
-#define FPSCR_RN0    0  /* Floating-point rounding control                   */
+#define FPSCR_DRN2   PPC_BIT_NR(29) /* Decimal Floating-Point rounding ctrl. */
+#define FPSCR_DRN1   PPC_BIT_NR(30) /* Decimal Floating-Point rounding ctrl. */
+#define FPSCR_DRN0   PPC_BIT_NR(31) /* Decimal Floating-Point rounding ctrl. */
+#define FPSCR_FX     PPC_BIT_NR(32) /* Floating-point exception summary      */
+#define FPSCR_FEX    PPC_BIT_NR(33) /* Floating-point enabled exception summ.*/
+#define FPSCR_VX     PPC_BIT_NR(34) /* Floating-point invalid op. excp. summ.*/
+#define FPSCR_OX     PPC_BIT_NR(35) /* Floating-point overflow exception     */
+#define FPSCR_UX     PPC_BIT_NR(36) /* Floating-point underflow exception    */
+#define FPSCR_ZX     PPC_BIT_NR(37) /* Floating-point zero divide exception  */
+#define FPSCR_XX     PPC_BIT_NR(38) /* Floating-point inexact exception      */
+#define FPSCR_VXSNAN PPC_BIT_NR(39) /* Floating-point invalid op. excp (sNan)*/
+#define FPSCR_VXISI  PPC_BIT_NR(40) /* Floating-point invalid op. excp (inf) */
+#define FPSCR_VXIDI  PPC_BIT_NR(41) /* Floating-point invalid op. excp (inf) */
+#define FPSCR_VXZDZ  PPC_BIT_NR(42) /* Floating-point invalid op. excp (zero)*/
+#define FPSCR_VXIMZ  PPC_BIT_NR(43) /* Floating-point invalid op. excp (inf) */
+#define FPSCR_VXVC   PPC_BIT_NR(44) /* Floating-point invalid op. excp (comp)*/
+#define FPSCR_FR     PPC_BIT_NR(45) /* Floating-point fraction rounded       */
+#define FPSCR_FI     PPC_BIT_NR(46) /* Floating-point fraction inexact       */
+#define FPSCR_C      PPC_BIT_NR(47) /* Floating-point result class descriptor*/
+#define FPSCR_FL     PPC_BIT_NR(48) /* Floating-point less than or negative  */
+#define FPSCR_FG     PPC_BIT_NR(49) /* Floating-point greater than or neg.   */
+#define FPSCR_FE     PPC_BIT_NR(50) /* Floating-point equal or zero          */
+#define FPSCR_FU     PPC_BIT_NR(51) /* Floating-point unordered or NaN       */
+#define FPSCR_FPCC   PPC_BIT_NR(51) /* Floating-point condition code         */
+#define FPSCR_FPRF   PPC_BIT_NR(51) /* Floating-point result flags           */
+#define FPSCR_VXSOFT PPC_BIT_NR(53) /* Floating-point invalid op. excp (soft)*/
+#define FPSCR_VXSQRT PPC_BIT_NR(54) /* Floating-point invalid op. excp (sqrt)*/
+#define FPSCR_VXCVI  PPC_BIT_NR(55) /* Floating-point invalid op. excp (int) */
+#define FPSCR_VE     PPC_BIT_NR(56) /* Floating-point invalid op. excp enable*/
+#define FPSCR_OE     PPC_BIT_NR(57) /* Floating-point overflow excp. enable  */
+#define FPSCR_UE     PPC_BIT_NR(58) /* Floating-point underflow excp. enable */
+#define FPSCR_ZE     PPC_BIT_NR(59) /* Floating-point zero divide excp enable*/
+#define FPSCR_XE     PPC_BIT_NR(60) /* Floating-point inexact excp. enable   */
+#define FPSCR_NI     PPC_BIT_NR(61) /* Floating-point non-IEEE mode          */
+#define FPSCR_RN1    PPC_BIT_NR(62)
+#define FPSCR_RN0    PPC_BIT_NR(63) /* Floating-point rounding control       */
 /* Invalid operation exception summary */
 #define FPSCR_IX     ((1 << FPSCR_VXSNAN) | (1 << FPSCR_VXISI)  | \
                       (1 << FPSCR_VXIDI)  | (1 << FPSCR_VXZDZ)  | \
-- 
2.36.1



  parent reply	other threads:[~2022-07-06 20:16 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 20:09 [PULL 00/34] ppc queue Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 01/34] ppc/pnv: move root port attach to pnv_phb4_realize() Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 02/34] ppc/pnv: attach phb3/phb4 root ports in QOM tree Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 03/34] ppc/pnv: assign pnv-phb-root-port chassis/slot earlier Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 04/34] ppc/pnv: make pnv_ics_get() use the chip8->phbs[] array Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 05/34] ppc/pnv: make pnv_ics_resend() use chip8->phbs[] Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 06/34] ppc/pnv: make pnv_chip_power8_pic_print_info() " Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 07/34] ppc/pnv: remove 'INTERFACE_PCIE_DEVICE' from phb3 root bus Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 08/34] ppc/pnv: remove 'INTERFACE_PCIE_DEVICE' from phb4 " Daniel Henrique Barboza
2022-07-06 20:09 ` Daniel Henrique Barboza [this message]
2022-07-06 20:09 ` [PULL 10/34] spapr/ddw: Reset DMA when the last non-default window is removed Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 11/34] spapr/ddw: Implement 64bit query extension Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 12/34] target/ppc: use int128.h methods in vpmsumd Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 13/34] target/ppc: use int128.h methods in vadduqm Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 14/34] target/ppc: use int128.h methods in vaddecuq and vaddeuqm Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 15/34] target/ppc: use int128.h methods in vaddcuq Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 16/34] target/ppc: use int128.h methods in vsubuqm Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 17/34] target/ppc: use int128.h methods in vsubecuq and vsubeuqm Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 18/34] target/ppc: use int128.h methods in vsubcuq Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 19/34] ppc: Define SETFIELD for the ppc target Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 20/34] ppc/spapr: Implement H_WATCHDOG Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 21/34] target/ppc: Fix insn32.decode style issues Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 22/34] target/ppc: Move mffscrn[i] to decodetree Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 23/34] target/ppc: Move mffsce " Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 24/34] target/ppc: Move mffsl " Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 25/34] target/ppc: Move mffs[.] " Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 26/34] target/ppc: Implement mffscdrn[i] instructions Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 27/34] tests/tcg/ppc64: Add mffsce test Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 28/34] target/ppc: Add flag for ISA v2.06 BCDA instructions Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 29/34] target/ppc: implement addg6s Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 30/34] target/ppc: implement cbcdtd Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 31/34] target/ppc: implement cdtbcd Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 32/34] target/ppc: Return default CPU for max CPU Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 33/34] target/ppc/cpu-models: Remove the "default" CPU alias Daniel Henrique Barboza
2022-07-06 20:09 ` [PULL 34/34] target/ppc: Fix MPC8555 and MPC8560 core type to e500v1 Daniel Henrique Barboza
2022-07-07  2:24 ` [PULL 00/34] ppc queue Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220706200946.471114-10-danielhb413@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=farosas@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=victor.colombo@eldorado.org.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.