On Tue, 2025-06-10 at 16:55 +0800, mengqinggang wrote:
> Change condition to IMM12_OPERAND (offset) on LA32.
> 
> gcc/ChangeLog:
> 
>       * config/loongarch/loongarch.cc
> (loongarch_get_separate_components):
>       Change max offset for LA32.
> ---
>  gcc/config/loongarch/loongarch.cc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/config/loongarch/loongarch.cc
> b/gcc/config/loongarch/loongarch.cc
> index 37b46e9ccfe..73fe5af65d2 100644
> --- a/gcc/config/loongarch/loongarch.cc
> +++ b/gcc/config/loongarch/loongarch.cc
> @@ -8293,7 +8293,8 @@ loongarch_get_separate_components (void)
>  
>          TODO: This may need a revise when we add LA32 as ldptr.w
> is not
>          guaranteed available by the manual.  */

This TODO can be removed then.

> -     if (offset < 32768)
> +     if (IMM12_OPERAND (offset)
> +         || (TARGET_64BIT && (offset < 32768)))
>         bitmap_set_bit (components, regno);
>  
>       offset -= UNITS_PER_WORD;

-- 
Xi Ruoyao <xry...@xry111.site>
School of Aerospace Science and Technology, Xidian University

Reply via email to