diff options
author | Chenghui Pan <panchenghui@loongson.cn> | 2024-03-15 09:30:27 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2024-03-20 10:14:05 +0800 |
commit | 994d8f922b9d88f45775f57a490409ab1c3baf59 (patch) | |
tree | ae47cf740138d602c75204848c92d1779b3f5a8e /gcc/config/loongarch | |
parent | 1938d9d2bb8ecf84d2aa3c3ef2fb78ec19433057 (diff) | |
download | gcc-994d8f922b9d88f45775f57a490409ab1c3baf59.zip gcc-994d8f922b9d88f45775f57a490409ab1c3baf59.tar.gz gcc-994d8f922b9d88f45775f57a490409ab1c3baf59.tar.bz2 |
LoongArch: Combine UNITS_PER_FP_REG and UNITS_PER_FPREG macros.
These macros are completely same in definition, so we can keep the previous one
and eliminate later one.
gcc/ChangeLog:
* config/loongarch/loongarch.cc
(loongarch_hard_regno_mode_ok_uncached): Combine UNITS_PER_FP_REG and
UNITS_PER_FPREG macros.
(loongarch_hard_regno_nregs): Ditto.
(loongarch_class_max_nregs): Ditto.
(loongarch_get_separate_components): Ditto.
(loongarch_process_components): Ditto.
* config/loongarch/loongarch.h (UNITS_PER_FPREG): Ditto.
(UNITS_PER_HWFPVALUE): Ditto.
(UNITS_PER_FPVALUE): Ditto.
Diffstat (limited to 'gcc/config/loongarch')
-rw-r--r-- | gcc/config/loongarch/loongarch.cc | 10 | ||||
-rw-r--r-- | gcc/config/loongarch/loongarch.h | 7 |
2 files changed, 7 insertions, 10 deletions
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index f11cf14..030957d 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -6776,7 +6776,7 @@ loongarch_hard_regno_mode_ok_uncached (unsigned int regno, machine_mode mode) and TRUNC. There's no point allowing sizes smaller than a word, because the FPU has no appropriate load/store instructions. */ if (mclass == MODE_INT) - return size >= MIN_UNITS_PER_WORD && size <= UNITS_PER_FPREG; + return size >= MIN_UNITS_PER_WORD && size <= UNITS_PER_FP_REG; } return false; @@ -6819,7 +6819,7 @@ loongarch_hard_regno_nregs (unsigned int regno, machine_mode mode) if (LASX_SUPPORTED_MODE_P (mode)) return 1; - return (GET_MODE_SIZE (mode) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG; + return (GET_MODE_SIZE (mode) + UNITS_PER_FP_REG - 1) / UNITS_PER_FP_REG; } /* All other registers are word-sized. */ @@ -6854,7 +6854,7 @@ loongarch_class_max_nregs (enum reg_class rclass, machine_mode mode) else if (LSX_SUPPORTED_MODE_P (mode)) size = MIN (size, UNITS_PER_LSX_REG); else - size = MIN (size, UNITS_PER_FPREG); + size = MIN (size, UNITS_PER_FP_REG); } left &= ~reg_class_contents[FP_REGS]; } @@ -8228,7 +8228,7 @@ loongarch_get_separate_components (void) if (IMM12_OPERAND (offset)) bitmap_set_bit (components, regno); - offset -= UNITS_PER_FPREG; + offset -= UNITS_PER_FP_REG; } /* Don't mess with the hard frame pointer. */ @@ -8307,7 +8307,7 @@ loongarch_process_components (sbitmap components, loongarch_save_restore_fn fn) if (bitmap_bit_p (components, regno)) loongarch_save_restore_reg (mode, regno, offset, fn); - offset -= UNITS_PER_FPREG; + offset -= UNITS_PER_FP_REG; } } diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h index bf2351f..888a633 100644 --- a/gcc/config/loongarch/loongarch.h +++ b/gcc/config/loongarch/loongarch.h @@ -138,19 +138,16 @@ along with GCC; see the file COPYING3. If not see /* Width of a LASX vector register in bits. */ #define BITS_PER_LASX_REG (UNITS_PER_LASX_REG * BITS_PER_UNIT) -/* For LARCH, width of a floating point register. */ -#define UNITS_PER_FPREG (TARGET_DOUBLE_FLOAT ? 8 : 4) - /* The largest size of value that can be held in floating-point registers and moved with a single instruction. */ #define UNITS_PER_HWFPVALUE \ - (TARGET_SOFT_FLOAT ? 0 : UNITS_PER_FPREG) + (TARGET_SOFT_FLOAT ? 0 : UNITS_PER_FP_REG) /* The largest size of value that can be held in floating-point registers. */ #define UNITS_PER_FPVALUE \ (TARGET_SOFT_FLOAT ? 0 \ - : TARGET_SINGLE_FLOAT ? UNITS_PER_FPREG \ + : TARGET_SINGLE_FLOAT ? UNITS_PER_FP_REG \ : LONG_DOUBLE_TYPE_SIZE / BITS_PER_UNIT) /* The number of bytes in a double. */ |