[v1] RISC-V: Fix one typo for emit_mode_set.

Message ID 20230703105716.2909864-1-pan2.li@intel.com
State Unresolved
Headers
Series [v1] RISC-V: Fix one typo for emit_mode_set. |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Li, Pan2 via Gcc-patches July 3, 2023, 10:57 a.m. UTC
  From: Pan Li <pan2.li@intel.com>

This patch would like to fix one typo for scaler[should be scalar] in
emit_mode_set, as well as minor change for mov emit.

Signed-off-by: Pan Li <pan2.li@intel.com>

gcc/ChangeLog:

	* config/riscv/riscv.cc (riscv_emit_mode_set): Fix typo.
---
 gcc/config/riscv/riscv.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

juzhe.zhong@rivai.ai July 3, 2023, 11:11 a.m. UTC | #1
LGTM



juzhe.zhong@rivai.ai
 
From: pan2.li
Date: 2023-07-03 18:57
To: gcc-patches
CC: juzhe.zhong; jeffreyalaw; pan2.li; yanzhang.wang; kito.cheng
Subject: [PATCH v1] RISC-V: Fix one typo for emit_mode_set.
From: Pan Li <pan2.li@intel.com>
 
This patch would like to fix one typo for scaler[should be scalar] in
emit_mode_set, as well as minor change for mov emit.
 
Signed-off-by: Pan Li <pan2.li@intel.com>
 
gcc/ChangeLog:
 
* config/riscv/riscv.cc (riscv_emit_mode_set): Fix typo.
---
gcc/config/riscv/riscv.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
 
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index e4dc8115e69..7761e946761 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -7672,11 +7672,11 @@ riscv_emit_mode_set (int entity, int mode, int prev_mode,
     case RISCV_FRM:
       if (mode != FRM_MODE_NONE && mode != prev_mode)
{
-   rtx scaler = gen_reg_rtx (SImode);
+   rtx scalar = gen_reg_rtx (SImode);
  rtx imm = gen_int_mode (mode, SImode);
-   emit_insn (gen_movsi (scaler, imm));
-   emit_insn (gen_fsrm (scaler, scaler));
+   emit_move_insn (scalar, imm);
+   emit_insn (gen_fsrm (scalar, scalar));
}
       break;
     default:
-- 
2.34.1
  
Kito Cheng July 3, 2023, 1:41 p.m. UTC | #2
Lgtm


juzhe.zhong@rivai.ai <juzhe.zhong@rivai.ai>於 2023年7月3日 週一,19:11寫道:

> LGTM
>
>
>
> juzhe.zhong@rivai.ai
>
> From: pan2.li
> Date: 2023-07-03 18:57
> To: gcc-patches
> CC: juzhe.zhong; jeffreyalaw; pan2.li; yanzhang.wang; kito.cheng
> Subject: [PATCH v1] RISC-V: Fix one typo for emit_mode_set.
> From: Pan Li <pan2.li@intel.com>
>
> This patch would like to fix one typo for scaler[should be scalar] in
> emit_mode_set, as well as minor change for mov emit.
>
> Signed-off-by: Pan Li <pan2.li@intel.com>
>
> gcc/ChangeLog:
>
> * config/riscv/riscv.cc (riscv_emit_mode_set): Fix typo.
> ---
> gcc/config/riscv/riscv.cc | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
> index e4dc8115e69..7761e946761 100644
> --- a/gcc/config/riscv/riscv.cc
> +++ b/gcc/config/riscv/riscv.cc
> @@ -7672,11 +7672,11 @@ riscv_emit_mode_set (int entity, int mode, int
> prev_mode,
>      case RISCV_FRM:
>        if (mode != FRM_MODE_NONE && mode != prev_mode)
> {
> -   rtx scaler = gen_reg_rtx (SImode);
> +   rtx scalar = gen_reg_rtx (SImode);
>   rtx imm = gen_int_mode (mode, SImode);
> -   emit_insn (gen_movsi (scaler, imm));
> -   emit_insn (gen_fsrm (scaler, scaler));
> +   emit_move_insn (scalar, imm);
> +   emit_insn (gen_fsrm (scalar, scalar));
> }
>        break;
>      default:
> --
> 2.34.1
>
>
>
  
Maciej W. Rozycki July 24, 2023, 9:49 p.m. UTC | #3
On Mon, 3 Jul 2023, Kito Cheng via Gcc-patches wrote:

> Lgtm
> 
> 
> juzhe.zhong@rivai.ai <juzhe.zhong@rivai.ai>於 2023年7月3日 週一,19:11寫道:
> 
> > LGTM
> >
> >
> >
> > juzhe.zhong@rivai.ai
> >
> > From: pan2.li
> > Date: 2023-07-03 18:57
> > To: gcc-patches
> > CC: juzhe.zhong; jeffreyalaw; pan2.li; yanzhang.wang; kito.cheng
> > Subject: [PATCH v1] RISC-V: Fix one typo for emit_mode_set.
> > From: Pan Li <pan2.li@intel.com>
> >
> > This patch would like to fix one typo for scaler[should be scalar] in
> > emit_mode_set, as well as minor change for mov emit.

 These should be two separate changes though: one obviously correct for 
the typo fix and the other one for the semantic change.  We have it 
explicitly documented even:

"Don't mix together changes made for different reasons.  Send them 
individually.  Ideally, each change you send should be impossible to 
subdivide into parts that we might want to consider separately, because 
each of its parts gets its motivation from the other parts.  In 
particular, changes to code formatting to conform to coding standards are 
best not mixed with substantive changes, because that makes it difficult 
to see what the real changes are."

cf. <https://gcc.gnu.org/contribute.html#patches>.  There are various 
reasons for this requirement beyond these stated above, e.g. someone may 
want to backport the semantic change only downstream and not the trivial 
fix, or we may want to revert one commit later on for some reason and not 
to have to disentangle it first.

  Maciej
  
Li, Pan2 via Gcc-patches July 24, 2023, 11:19 p.m. UTC | #4
Thanks Maciej for pointing this out, we should follow the principle that one thing for one patch, as well as keep it simple and stupid. Thus, this patch was dropped and covered by other ones.

Pan

-----Original Message-----
From: Maciej W. Rozycki <macro@orcam.me.uk> 
Sent: Tuesday, July 25, 2023 5:49 AM
To: Kito Cheng <kito.cheng@gmail.com>
Cc: juzhe.zhong@rivai.ai; gcc-patches <gcc-patches@gcc.gnu.org>; jeffreyalaw <jeffreyalaw@gmail.com>; Li, Pan2 <pan2.li@intel.com>; Wang, Yanzhang <yanzhang.wang@intel.com>
Subject: Re: [PATCH v1] RISC-V: Fix one typo for emit_mode_set.

On Mon, 3 Jul 2023, Kito Cheng via Gcc-patches wrote:

> Lgtm
> 
> 
> juzhe.zhong@rivai.ai <juzhe.zhong@rivai.ai>於 2023年7月3日 週一,19:11寫道:
> 
> > LGTM
> >
> >
> >
> > juzhe.zhong@rivai.ai
> >
> > From: pan2.li
> > Date: 2023-07-03 18:57
> > To: gcc-patches
> > CC: juzhe.zhong; jeffreyalaw; pan2.li; yanzhang.wang; kito.cheng
> > Subject: [PATCH v1] RISC-V: Fix one typo for emit_mode_set.
> > From: Pan Li <pan2.li@intel.com>
> >
> > This patch would like to fix one typo for scaler[should be scalar] in
> > emit_mode_set, as well as minor change for mov emit.

 These should be two separate changes though: one obviously correct for 
the typo fix and the other one for the semantic change.  We have it 
explicitly documented even:

"Don't mix together changes made for different reasons.  Send them 
individually.  Ideally, each change you send should be impossible to 
subdivide into parts that we might want to consider separately, because 
each of its parts gets its motivation from the other parts.  In 
particular, changes to code formatting to conform to coding standards are 
best not mixed with substantive changes, because that makes it difficult 
to see what the real changes are."

cf. <https://gcc.gnu.org/contribute.html#patches>.  There are various 
reasons for this requirement beyond these stated above, e.g. someone may 
want to backport the semantic change only downstream and not the trivial 
fix, or we may want to revert one commit later on for some reason and not 
to have to disentangle it first.

  Maciej
  

Patch

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index e4dc8115e69..7761e946761 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -7672,11 +7672,11 @@  riscv_emit_mode_set (int entity, int mode, int prev_mode,
     case RISCV_FRM:
       if (mode != FRM_MODE_NONE && mode != prev_mode)
 	{
-	  rtx scaler = gen_reg_rtx (SImode);
+	  rtx scalar = gen_reg_rtx (SImode);
 	  rtx imm = gen_int_mode (mode, SImode);
 
-	  emit_insn (gen_movsi (scaler, imm));
-	  emit_insn (gen_fsrm (scaler, scaler));
+	  emit_move_insn (scalar, imm);
+	  emit_insn (gen_fsrm (scalar, scalar));
 	}
       break;
     default: