[PATCH-for-8.0 1/3] tcg/s390x: Fix coding style

Philippe Mathieu-Daudé posted 3 patches 3 years, 2 months ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, WANG Xuerui <git@xen0n.name>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <Alistair.Francis@wdc.com>, Stefan Weil <sw@weilnetz.de>, Thomas Huth <thuth@redhat.com>
[PATCH-for-8.0 1/3] tcg/s390x: Fix coding style
Posted by Philippe Mathieu-Daudé 3 years, 2 months ago
We are going to modify this code, so fix its style first to avoid:

  ERROR: spaces required around that '*' (ctx:VxV)
  #281: FILE: tcg/s390x/tcg-target.c.inc:1224:
  +        uintptr_t mask = ~(0xffffull << i*16);
                                            ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tcg/s390x/tcg-target.c.inc | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index 33becd7694..f1d3907cd8 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -802,9 +802,9 @@ static bool maybe_out_small_movi(TCGContext *s, TCGType type,
     }
 
     for (i = 0; i < 4; i++) {
-        tcg_target_long mask = 0xffffull << i*16;
+        tcg_target_long mask = 0xffffull << i * 16;
         if ((uval & mask) == uval) {
-            tcg_out_insn_RI(s, lli_insns[i], ret, uval >> i*16);
+            tcg_out_insn_RI(s, lli_insns[i], ret, uval >> i * 16);
             return true;
         }
     }
@@ -1221,9 +1221,9 @@ static void tgen_andi(TCGContext *s, TCGType type, TCGReg dest, uint64_t val)
 
     /* Try all 32-bit insns that can perform it in one go.  */
     for (i = 0; i < 4; i++) {
-        tcg_target_ulong mask = ~(0xffffull << i*16);
+        tcg_target_ulong mask = ~(0xffffull << i * 16);
         if (((val | ~valid) & mask) == mask) {
-            tcg_out_insn_RI(s, ni_insns[i], dest, val >> i*16);
+            tcg_out_insn_RI(s, ni_insns[i], dest, val >> i * 16);
             return;
         }
     }
@@ -1231,9 +1231,9 @@ static void tgen_andi(TCGContext *s, TCGType type, TCGReg dest, uint64_t val)
     /* Try all 48-bit insns that can perform it in one go.  */
     if (HAVE_FACILITY(EXT_IMM)) {
         for (i = 0; i < 2; i++) {
-            tcg_target_ulong mask = ~(0xffffffffull << i*32);
+            tcg_target_ulong mask = ~(0xffffffffull << i * 32);
             if (((val | ~valid) & mask) == mask) {
-                tcg_out_insn_RIL(s, nif_insns[i], dest, val >> i*32);
+                tcg_out_insn_RIL(s, nif_insns[i], dest, val >> i * 32);
                 return;
             }
         }
@@ -1279,9 +1279,9 @@ static void tgen_ori(TCGContext *s, TCGType type, TCGReg dest, uint64_t val)
 
     /* Try all 32-bit insns that can perform it in one go.  */
     for (i = 0; i < 4; i++) {
-        tcg_target_ulong mask = (0xffffull << i*16);
+        tcg_target_ulong mask = (0xffffull << i * 16);
         if ((val & mask) != 0 && (val & ~mask) == 0) {
-            tcg_out_insn_RI(s, oi_insns[i], dest, val >> i*16);
+            tcg_out_insn_RI(s, oi_insns[i], dest, val >> i * 16);
             return;
         }
     }
@@ -1289,9 +1289,9 @@ static void tgen_ori(TCGContext *s, TCGType type, TCGReg dest, uint64_t val)
     /* Try all 48-bit insns that can perform it in one go.  */
     if (HAVE_FACILITY(EXT_IMM)) {
         for (i = 0; i < 2; i++) {
-            tcg_target_ulong mask = (0xffffffffull << i*32);
+            tcg_target_ulong mask = (0xffffffffull << i * 32);
             if ((val & mask) != 0 && (val & ~mask) == 0) {
-                tcg_out_insn_RIL(s, oif_insns[i], dest, val >> i*32);
+                tcg_out_insn_RIL(s, oif_insns[i], dest, val >> i * 32);
                 return;
             }
         }
-- 
2.38.1


Re: [PATCH-for-8.0 1/3] tcg/s390x: Fix coding style
Posted by Richard Henderson 3 years, 2 months ago
On 11/30/22 05:26, Philippe Mathieu-Daudé wrote:
> We are going to modify this code, so fix its style first to avoid:
> 
>    ERROR: spaces required around that '*' (ctx:VxV)
>    #281: FILE: tcg/s390x/tcg-target.c.inc:1224:
>    +        uintptr_t mask = ~(0xffffull << i*16);
>                                              ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   tcg/s390x/tcg-target.c.inc | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)


Thanks, queued to tcg-next.


r~

Re: [PATCH-for-8.0 1/3] tcg/s390x: Fix coding style
Posted by Wilfred Mallawa 3 years, 2 months ago
On Wed, 2022-11-30 at 14:26 +0100, Philippe Mathieu-Daudé wrote:
> We are going to modify this code, so fix its style first to avoid:
> 
>   ERROR: spaces required around that '*' (ctx:VxV)
>   #281: FILE: tcg/s390x/tcg-target.c.inc:1224:
>   +        uintptr_t mask = ~(0xffffull << i*16);
>                                             ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  tcg/s390x/tcg-target.c.inc | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
Reviewed-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> 
> diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
> index 33becd7694..f1d3907cd8 100644
> --- a/tcg/s390x/tcg-target.c.inc
> +++ b/tcg/s390x/tcg-target.c.inc
> @@ -802,9 +802,9 @@ static bool maybe_out_small_movi(TCGContext *s,
> TCGType type,
>      }
>  
>      for (i = 0; i < 4; i++) {
> -        tcg_target_long mask = 0xffffull << i*16;
> +        tcg_target_long mask = 0xffffull << i * 16;
>          if ((uval & mask) == uval) {
> -            tcg_out_insn_RI(s, lli_insns[i], ret, uval >> i*16);
> +            tcg_out_insn_RI(s, lli_insns[i], ret, uval >> i * 16);
>              return true;
>          }
>      }
> @@ -1221,9 +1221,9 @@ static void tgen_andi(TCGContext *s, TCGType
> type, TCGReg dest, uint64_t val)
>  
>      /* Try all 32-bit insns that can perform it in one go.  */
>      for (i = 0; i < 4; i++) {
> -        tcg_target_ulong mask = ~(0xffffull << i*16);
> +        tcg_target_ulong mask = ~(0xffffull << i * 16);
>          if (((val | ~valid) & mask) == mask) {
> -            tcg_out_insn_RI(s, ni_insns[i], dest, val >> i*16);
> +            tcg_out_insn_RI(s, ni_insns[i], dest, val >> i * 16);
>              return;
>          }
>      }
> @@ -1231,9 +1231,9 @@ static void tgen_andi(TCGContext *s, TCGType
> type, TCGReg dest, uint64_t val)
>      /* Try all 48-bit insns that can perform it in one go.  */
>      if (HAVE_FACILITY(EXT_IMM)) {
>          for (i = 0; i < 2; i++) {
> -            tcg_target_ulong mask = ~(0xffffffffull << i*32);
> +            tcg_target_ulong mask = ~(0xffffffffull << i * 32);
>              if (((val | ~valid) & mask) == mask) {
> -                tcg_out_insn_RIL(s, nif_insns[i], dest, val >>
> i*32);
> +                tcg_out_insn_RIL(s, nif_insns[i], dest, val >> i *
> 32);
>                  return;
>              }
>          }
> @@ -1279,9 +1279,9 @@ static void tgen_ori(TCGContext *s, TCGType
> type, TCGReg dest, uint64_t val)
>  
>      /* Try all 32-bit insns that can perform it in one go.  */
>      for (i = 0; i < 4; i++) {
> -        tcg_target_ulong mask = (0xffffull << i*16);
> +        tcg_target_ulong mask = (0xffffull << i * 16);
>          if ((val & mask) != 0 && (val & ~mask) == 0) {
> -            tcg_out_insn_RI(s, oi_insns[i], dest, val >> i*16);
> +            tcg_out_insn_RI(s, oi_insns[i], dest, val >> i * 16);
>              return;
>          }
>      }
> @@ -1289,9 +1289,9 @@ static void tgen_ori(TCGContext *s, TCGType
> type, TCGReg dest, uint64_t val)
>      /* Try all 48-bit insns that can perform it in one go.  */
>      if (HAVE_FACILITY(EXT_IMM)) {
>          for (i = 0; i < 2; i++) {
> -            tcg_target_ulong mask = (0xffffffffull << i*32);
> +            tcg_target_ulong mask = (0xffffffffull << i * 32);
>              if ((val & mask) != 0 && (val & ~mask) == 0) {
> -                tcg_out_insn_RIL(s, oif_insns[i], dest, val >>
> i*32);
> +                tcg_out_insn_RIL(s, oif_insns[i], dest, val >> i *
> 32);
>                  return;
>              }
>          }