]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Move function place to make it looks better. [NFC]
authorJu-Zhe Zhong <juzhe.zhong@rivai.ai>
Tue, 11 Oct 2022 04:48:20 +0000 (12:48 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 12 Oct 2022 12:50:51 +0000 (20:50 +0800)
gcc/ChangeLog:

* config/riscv/riscv-vector-builtins.h (class rvv_switcher): Move to
this to ....
* config/riscv/riscv-vector-builtins.cc (class rvv_switcher):
here.

gcc/config/riscv/riscv-vector-builtins.cc
gcc/config/riscv/riscv-vector-builtins.h

index 7033b1fc176f640122b0b006305dc66051652f59..d523192570b80248dcfc6ee7e5d3f3e26342a625 100644 (file)
@@ -86,6 +86,25 @@ static GTY(()) tree abi_vector_types[NUM_VECTOR_TYPES + 1];
 extern GTY(()) tree builtin_vector_types[MAX_TUPLE_SIZE][NUM_VECTOR_TYPES + 1];
 tree builtin_vector_types[MAX_TUPLE_SIZE][NUM_VECTOR_TYPES + 1];
 
+/* RAII class for enabling enough RVV features to define the built-in
+   types and implement the riscv_vector.h pragma.
+
+   Note: According to 'TYPE_MODE' macro implementation, we need set
+   have_regs_of_mode[mode] to be true if we want to get the exact mode
+   from 'TYPE_MODE'. However, have_regs_of_mode has not been set yet in
+   targetm.init_builtins (). We need rvv_switcher to set have_regs_of_mode
+   before targetm.init_builtins () and recover back have_regs_of_mode
+   after targetm.init_builtins ().  */
+class rvv_switcher
+{
+public:
+  rvv_switcher ();
+  ~rvv_switcher ();
+
+private:
+  bool m_old_have_regs_of_mode[MAX_MACHINE_MODE];
+};
+
 rvv_switcher::rvv_switcher ()
 {
   /* Set have_regs_of_mode before targetm.init_builtins ().  */
index ec85e0b1320dc3f4ca46cf4e3a7b6dc36fa2adcc..5c01a76065792ecbf7e4bb3da126e72c952b303e 100644 (file)
@@ -36,25 +36,6 @@ enum vector_type_index
   NUM_VECTOR_TYPES
 };
 
-/* RAII class for enabling enough RVV features to define the built-in
-   types and implement the riscv_vector.h pragma.
-
-   Note: According to 'TYPE_MODE' macro implementation, we need set
-   have_regs_of_mode[mode] to be true if we want to get the exact mode
-   from 'TYPE_MODE'. However, have_regs_of_mode has not been set yet in
-   targetm.init_builtins (). We need rvv_switcher to set have_regs_of_mode
-   before targetm.init_builtins () and recover back have_regs_of_mode
-   after targetm.init_builtins ().  */
-class rvv_switcher
-{
-public:
-  rvv_switcher ();
-  ~rvv_switcher ();
-
-private:
-  bool m_old_have_regs_of_mode[MAX_MACHINE_MODE];
-};
-
 } // end namespace riscv_vector
 
 #endif