> On Sep 30, 2024, at 13:58, Kito Cheng <kito.ch...@gmail.com> wrote:
> 
> Hi Yang-Yu:
> 
>> 
>> Specially, we can reproduce the result on BananaPi-F3 Hardware:
>> 
>> Use this GCC branch with my patch:
>> https://github.com/cyyself/gcc/tree/rv_can_inline
>> 
>> And compile the coremark on this branch:
>> https://github.com/cyyself/coremark/tree/rva22_v_hotspot
>> 
>> With command `make CC=riscv64-unknown-linux-gnu-gcc compile`
>> 
>> With my patch, we will get the coremark scored `Iterations/Sec   :
>> 5992.917461`. But without this patch after `git reset HEAD^` and
>> recompile the GCC and then coremark, we will get `Iterations/Sec :
>> 5235.602094`, which is 12.6% slower.
> 
> Could you add a test case to demonstrate that ?
> 

I will try.

>> /* Callee's ISA should be a subset of the caller's ISA.  */
> 
> This check is necessary, but this way may not scalable for longer term,
> I mean people may forgot to update this part when adding new extension
> variables,
> so I would suggest add a new function to construct a riscv_subset_list
> from options
> e.g.
> 
> diff --git a/gcc/config/riscv/riscv-subset.h b/gcc/config/riscv/riscv-subset.h
> index dace4de6575..e8b7c0f194b 100644
> --- a/gcc/config/riscv/riscv-subset.h
> +++ b/gcc/config/riscv/riscv-subset.h
> @@ -103,6 +103,7 @@ public:
>  riscv_subset_list *clone () const;
> 
>  static riscv_subset_list *parse (const char *, location_t);
> +  static riscv_subset_list *parse (struct gcc_options *opts);

Thanks for this hint. However, using the class riscv_subset_list
is very costly and requires a copy of the ISA string. We can implement
a new function like bool riscv_ext_is_subset(struct gcc_options
*opts, struct gcc_options *subset) in riscv-common.cc and iterate
through the riscv_ext_flag_table. This method is also scalable for
the long term. I will submit the next revision lately.

>  const char *parse_single_ext (const char *, bool exact_single_p = true);
> 
>  const riscv_subset_t *begin () const {return m_head;};
> 
> And then use riscv_subset_list to do the checking

Reply via email to