public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Fix one warning of frm enum.
@ 2023-06-12 14:26 Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2023-06-12 14:26 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5c9b57041f60fa42af84b17f7314c8b97e501cc5

commit 5c9b57041f60fa42af84b17f7314c8b97e501cc5
Author: Pan Li <pan2.li@intel.com>
Date:   Fri Jun 9 15:44:57 2023 +0800

    RISC-V: Fix one warning of frm enum.
    
    This patch would like to fix one warning similar as below, and add the
    link for where the values comes from.
    
    ./gcc/config/riscv/riscv-protos.h:260:13: warning: binary constants are
    a C++14 feature or GCC extension
            FRM_RNE = 0b000,
                      ^~~~~
    
    Signed-off-by: Pan Li <pan2.li@intel.com>
    
    gcc/ChangeLog:
    
            * config/riscv/riscv-protos.h (enum frm_field_enum): Adjust
            literal to int.

Diff:
---
 gcc/config/riscv/riscv-protos.h | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
index 38e4125424b..66c1f535d60 100644
--- a/gcc/config/riscv/riscv-protos.h
+++ b/gcc/config/riscv/riscv-protos.h
@@ -254,15 +254,18 @@ enum vxrm_field_enum
   VXRM_RDN,
   VXRM_ROD
 };
-/* Rounding mode bitfield for floating point FRM.  */
+/* Rounding mode bitfield for floating point FRM.  The value of enum comes
+   from the below link.
+   https://github.com/riscv/riscv-isa-manual/blob/main/src/f-st-ext.adoc#floating-point-control-and-status-register
+ */
 enum frm_field_enum
 {
-  FRM_RNE = 0b000,
-  FRM_RTZ = 0b001,
-  FRM_RDN = 0b010,
-  FRM_RUP = 0b011,
-  FRM_RMM = 0b100,
-  FRM_DYN = 0b111
+  FRM_RNE = 0, /* Aka 0b000.  */
+  FRM_RTZ = 1, /* Aka 0b001.  */
+  FRM_RDN = 2, /* Aka 0b010.  */
+  FRM_RUP = 3, /* Aka 0b011.  */
+  FRM_RMM = 4, /* Aka 0b100.  */
+  FRM_DYN = 7, /* Aka 0b111.  */
 };
 
 opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Fix one warning of frm enum.
@ 2023-07-14  2:44 Jeff Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Law @ 2023-07-14  2:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8aeb7218b3e7e1a3138d969fe8949530524293d2

commit 8aeb7218b3e7e1a3138d969fe8949530524293d2
Author: Pan Li <pan2.li@intel.com>
Date:   Fri Jun 9 15:44:57 2023 +0800

    RISC-V: Fix one warning of frm enum.
    
    This patch would like to fix one warning similar as below, and add the
    link for where the values comes from.
    
    ./gcc/config/riscv/riscv-protos.h:260:13: warning: binary constants are
    a C++14 feature or GCC extension
            FRM_RNE = 0b000,
                      ^~~~~
    
    Signed-off-by: Pan Li <pan2.li@intel.com>
    
    gcc/ChangeLog:
    
            * config/riscv/riscv-protos.h (enum frm_field_enum): Adjust
            literal to int.

Diff:
---
 gcc/config/riscv/riscv-protos.h | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
index 38e4125424b..66c1f535d60 100644
--- a/gcc/config/riscv/riscv-protos.h
+++ b/gcc/config/riscv/riscv-protos.h
@@ -254,15 +254,18 @@ enum vxrm_field_enum
   VXRM_RDN,
   VXRM_ROD
 };
-/* Rounding mode bitfield for floating point FRM.  */
+/* Rounding mode bitfield for floating point FRM.  The value of enum comes
+   from the below link.
+   https://github.com/riscv/riscv-isa-manual/blob/main/src/f-st-ext.adoc#floating-point-control-and-status-register
+ */
 enum frm_field_enum
 {
-  FRM_RNE = 0b000,
-  FRM_RTZ = 0b001,
-  FRM_RDN = 0b010,
-  FRM_RUP = 0b011,
-  FRM_RMM = 0b100,
-  FRM_DYN = 0b111
+  FRM_RNE = 0, /* Aka 0b000.  */
+  FRM_RTZ = 1, /* Aka 0b001.  */
+  FRM_RDN = 2, /* Aka 0b010.  */
+  FRM_RUP = 3, /* Aka 0b011.  */
+  FRM_RMM = 4, /* Aka 0b100.  */
+  FRM_DYN = 7, /* Aka 0b111.  */
 };
 
 opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-14  2:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 14:26 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Fix one warning of frm enum Jeff Law
2023-07-14  2:44 Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).