diff mbox series

[for-4.1,2/8] target/riscv: Use --static-decode for decodetree

Message ID 20190401031155.21293-3-richard.henderson@linaro.org
State New
Headers show
Series target/riscv: decodetree improvments | expand

Commit Message

Richard Henderson April 1, 2019, 3:11 a.m. UTC
The generated functions are only used within translate.c
and do not need to be global, or declared.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/riscv/translate.c   | 2 --
 target/riscv/Makefile.objs | 8 ++++----
 2 files changed, 4 insertions(+), 6 deletions(-)

-- 
2.17.1

Comments

Alistair Francis April 3, 2019, 11:29 p.m. UTC | #1
On Sun, Mar 31, 2019 at 8:15 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>

> The generated functions are only used within translate.c

> and do not need to be global, or declared.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Alistair Francis <alistair.francis@wdc.com>


Alistair

> ---

>  target/riscv/translate.c   | 2 --

>  target/riscv/Makefile.objs | 8 ++++----

>  2 files changed, 4 insertions(+), 6 deletions(-)

>

> diff --git a/target/riscv/translate.c b/target/riscv/translate.c

> index dd763647ea..7ebd590486 100644

> --- a/target/riscv/translate.c

> +++ b/target/riscv/translate.c

> @@ -538,7 +538,6 @@ static int ex_rvc_register(int reg)

>      return 8 + reg;

>  }

>

> -bool decode_insn32(DisasContext *ctx, uint32_t insn);

>  /* Include the auto-generated decoder for 32 bit insn */

>  #include "decode_insn32.inc.c"

>

> @@ -667,7 +666,6 @@ static bool gen_shift(DisasContext *ctx, arg_r *a,

>  #include "insn_trans/trans_rvd.inc.c"

>  #include "insn_trans/trans_privileged.inc.c"

>

> -bool decode_insn16(DisasContext *ctx, uint16_t insn);

>  /* auto-generated decoder*/

>  #include "decode_insn16.inc.c"

>  #include "insn_trans/trans_rvc.inc.c"

> diff --git a/target/riscv/Makefile.objs b/target/riscv/Makefile.objs

> index 9c6c109327..c7a1b063ed 100644

> --- a/target/riscv/Makefile.objs

> +++ b/target/riscv/Makefile.objs

> @@ -7,14 +7,14 @@ decode32-$(TARGET_RISCV64) += $(SRC_PATH)/target/riscv/insn32-64.decode

>

>  target/riscv/decode_insn32.inc.c: $(decode32-y) $(DECODETREE)

>         $(call quiet-command, \

> -         $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn32 $(decode32-y), \

> -         "GEN", $(TARGET_DIR)$@)

> +         $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn32 \

> +          $(decode32-y), "GEN", $(TARGET_DIR)$@)

>

>  target/riscv/decode_insn16.inc.c: \

>    $(SRC_PATH)/target/riscv/insn16.decode $(DECODETREE)

>         $(call quiet-command, \

> -         $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn16 --insnwidth 16 $<, \

> -         "GEN", $(TARGET_DIR)$@)

> +         $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn16 \

> +          --insnwidth 16 $<, "GEN", $(TARGET_DIR)$@)

>

>  target/riscv/translate.o: target/riscv/decode_insn32.inc.c \

>         target/riscv/decode_insn16.inc.c

> --

> 2.17.1

>

>
Palmer Dabbelt April 25, 2019, 3:31 a.m. UTC | #2
On Sun, 31 Mar 2019 20:11:49 PDT (-0700), richard.henderson@linaro.org wrote:
> The generated functions are only used within translate.c

> and do not need to be global, or declared.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/riscv/translate.c   | 2 --

>  target/riscv/Makefile.objs | 8 ++++----

>  2 files changed, 4 insertions(+), 6 deletions(-)

>

> diff --git a/target/riscv/translate.c b/target/riscv/translate.c

> index dd763647ea..7ebd590486 100644

> --- a/target/riscv/translate.c

> +++ b/target/riscv/translate.c

> @@ -538,7 +538,6 @@ static int ex_rvc_register(int reg)

>      return 8 + reg;

>  }

>

> -bool decode_insn32(DisasContext *ctx, uint32_t insn);

>  /* Include the auto-generated decoder for 32 bit insn */

>  #include "decode_insn32.inc.c"

>

> @@ -667,7 +666,6 @@ static bool gen_shift(DisasContext *ctx, arg_r *a,

>  #include "insn_trans/trans_rvd.inc.c"

>  #include "insn_trans/trans_privileged.inc.c"

>

> -bool decode_insn16(DisasContext *ctx, uint16_t insn);

>  /* auto-generated decoder*/

>  #include "decode_insn16.inc.c"

>  #include "insn_trans/trans_rvc.inc.c"

> diff --git a/target/riscv/Makefile.objs b/target/riscv/Makefile.objs

> index 9c6c109327..c7a1b063ed 100644

> --- a/target/riscv/Makefile.objs

> +++ b/target/riscv/Makefile.objs

> @@ -7,14 +7,14 @@ decode32-$(TARGET_RISCV64) += $(SRC_PATH)/target/riscv/insn32-64.decode

>

>  target/riscv/decode_insn32.inc.c: $(decode32-y) $(DECODETREE)

>  	$(call quiet-command, \

> -	  $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn32 $(decode32-y), \

> -	  "GEN", $(TARGET_DIR)$@)

> +	  $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn32 \

> +          $(decode32-y), "GEN", $(TARGET_DIR)$@)

>

>  target/riscv/decode_insn16.inc.c: \

>    $(SRC_PATH)/target/riscv/insn16.decode $(DECODETREE)

>  	$(call quiet-command, \

> -	  $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn16 --insnwidth 16 $<, \

> -	  "GEN", $(TARGET_DIR)$@)

> +	  $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn16 \

> +          --insnwidth 16 $<, "GEN", $(TARGET_DIR)$@)

>

>  target/riscv/translate.o: target/riscv/decode_insn32.inc.c \

>  	target/riscv/decode_insn16.inc.c


Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
diff mbox series

Patch

diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index dd763647ea..7ebd590486 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -538,7 +538,6 @@  static int ex_rvc_register(int reg)
     return 8 + reg;
 }
 
-bool decode_insn32(DisasContext *ctx, uint32_t insn);
 /* Include the auto-generated decoder for 32 bit insn */
 #include "decode_insn32.inc.c"
 
@@ -667,7 +666,6 @@  static bool gen_shift(DisasContext *ctx, arg_r *a,
 #include "insn_trans/trans_rvd.inc.c"
 #include "insn_trans/trans_privileged.inc.c"
 
-bool decode_insn16(DisasContext *ctx, uint16_t insn);
 /* auto-generated decoder*/
 #include "decode_insn16.inc.c"
 #include "insn_trans/trans_rvc.inc.c"
diff --git a/target/riscv/Makefile.objs b/target/riscv/Makefile.objs
index 9c6c109327..c7a1b063ed 100644
--- a/target/riscv/Makefile.objs
+++ b/target/riscv/Makefile.objs
@@ -7,14 +7,14 @@  decode32-$(TARGET_RISCV64) += $(SRC_PATH)/target/riscv/insn32-64.decode
 
 target/riscv/decode_insn32.inc.c: $(decode32-y) $(DECODETREE)
 	$(call quiet-command, \
-	  $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn32 $(decode32-y), \
-	  "GEN", $(TARGET_DIR)$@)
+	  $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn32 \
+          $(decode32-y), "GEN", $(TARGET_DIR)$@)
 
 target/riscv/decode_insn16.inc.c: \
   $(SRC_PATH)/target/riscv/insn16.decode $(DECODETREE)
 	$(call quiet-command, \
-	  $(PYTHON) $(DECODETREE) -o $@ --decode decode_insn16 --insnwidth 16 $<, \
-	  "GEN", $(TARGET_DIR)$@)
+	  $(PYTHON) $(DECODETREE) -o $@ --static-decode decode_insn16 \
+          --insnwidth 16 $<, "GEN", $(TARGET_DIR)$@)
 
 target/riscv/translate.o: target/riscv/decode_insn32.inc.c \
 	target/riscv/decode_insn16.inc.c