From: Jiajie Chen <[email protected]>

According to latest loongarch procedure call standard, sizeof(long
double) == 128 in ilp32 data model regardless of target bitness.

gcc/ChangeLog:

        * config/loongarch/loongarch.cc: Use TFmode for long double
        regardless of target bitness.
        * config/loongarch/loongarch.h: Set LONG_DOUBLE_TYPE_SIZE to 128
        regardless of target bitness.
---
 gcc/config/loongarch/loongarch.cc | 2 +-
 gcc/config/loongarch/loongarch.h  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/loongarch/loongarch.cc 
b/gcc/config/loongarch/loongarch.cc
index c725d028d8c..5032e0681bb 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -11148,7 +11148,7 @@ static machine_mode
 loongarch_c_mode_for_floating_type (enum tree_index ti)
 {
   if (ti == TI_LONG_DOUBLE_TYPE)
-    return TARGET_64BIT ? TFmode : DFmode;
+    return TFmode;
   return default_mode_for_floating_type (ti);
 }
 
diff --git a/gcc/config/loongarch/loongarch.h b/gcc/config/loongarch/loongarch.h
index e8819bf1480..62a93d0d072 100644
--- a/gcc/config/loongarch/loongarch.h
+++ b/gcc/config/loongarch/loongarch.h
@@ -158,7 +158,7 @@ along with GCC; see the file COPYING3.  If not see
 #define LONG_LONG_TYPE_SIZE 64
 
 /* LONG_DOUBLE_TYPE_SIZE get poisoned, so add LA_ prefix.  */
-#define LA_LONG_DOUBLE_TYPE_SIZE (TARGET_64BIT ? 128 : 64)
+#define LA_LONG_DOUBLE_TYPE_SIZE 128
 
 /* Define the sizes of fixed-point types.  */
 #define SHORT_FRACT_TYPE_SIZE 8
-- 
2.34.1

Reply via email to