Skip to content

Commit f565ee0

Browse files
Blackhexgithub-actions
authored andcommitted
Change long double to 64bit (#3)
1 parent 7b24845 commit f565ee0

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

gcc/config/aarch64/aarch64-coff.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@
3131
#undef PTRDIFF_TYPE
3232
#define PTRDIFF_TYPE "long long int"
3333

34+
#define TARGET_LONG_DOUBLE_64 1
35+
3436
#undef LONG_TYPE_SIZE
3537
#define LONG_TYPE_SIZE 32
3638

39+
#define __NO_BINARY80__
40+
3741
#define TARGET_SEH 1
3842

3943
#ifndef ASM_GENERATE_INTERNAL_LABEL

gcc/config/aarch64/aarch64.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28855,6 +28855,14 @@ aarch64_scalar_mode_supported_p (scalar_mode mode)
2885528855
if (DECIMAL_FLOAT_MODE_P (mode))
2885628856
return default_decimal_float_supported_p ();
2885728857

28858+
/* If long double is 64bit, we need to explicitly specify that aarch64
28859+
port is prepared to handle TFmode instructions. If long double is
28860+
128bit, this is handled by default_scalar_mode_supported_p. */
28861+
#ifdef TARGET_LONG_DOUBLE_64
28862+
if (mode == TFmode)
28863+
return true;
28864+
#endif
28865+
2885828866
return ((mode == HFmode || mode == BFmode)
2885928867
? true
2886028868
: default_scalar_mode_supported_p (mode));
@@ -28945,8 +28953,10 @@ aarch64_bitint_type_info (int n, struct bitint_info *info)
2894528953
static machine_mode
2894628954
aarch64_c_mode_for_floating_type (enum tree_index ti)
2894728955
{
28956+
#ifndef TARGET_LONG_DOUBLE_64
2894828957
if (ti == TI_LONG_DOUBLE_TYPE)
2894928958
return TFmode;
28959+
#endif
2895028960
return default_mode_for_floating_type (ti);
2895128961
}
2895228962

libgfortran/configure

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6225,10 +6225,12 @@ fi
62256225
# or floating point numbers – or may want to reduce the libgfortran size
62266226
# although they do have the support.
62276227
LIBGOMP_CHECKED_INT_KINDS="1 2 4 8 16"
6228-
LIBGOMP_CHECKED_REAL_KINDS="4 8 10 16"
6229-
6230-
6231-
6228+
case $host in
6229+
aarch64-*-mingw* | aarch64-*-cygwin*)
6230+
LIBGOMP_CHECKED_REAL_KINDS="4 8" ;;
6231+
*)
6232+
LIBGOMP_CHECKED_REAL_KINDS="4 8 10 16" ;;
6233+
esac
62326234

62336235
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
62346236
# similarly to how libstdc++ does it

libgfortran/configure.ac

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,12 @@ AM_CONDITIONAL(LIBGFOR_MINIMAL, false)
220220
# or floating point numbers – or may want to reduce the libgfortran size
221221
# although they do have the support.
222222
LIBGOMP_CHECKED_INT_KINDS="1 2 4 8 16"
223-
LIBGOMP_CHECKED_REAL_KINDS="4 8 10 16"
223+
case "${host}" in
224+
aarch64-*-mingw* | aarch64-*-cygwin*)
225+
LIBGOMP_CHECKED_REAL_KINDS="4 8" ;;
226+
*)
227+
LIBGOMP_CHECKED_REAL_KINDS="4 8 10 16" ;;
228+
esac
224229

225230
AC_SUBST(LIBGOMP_CHECKED_INT_KINDS)
226231
AC_SUBST(LIBGOMP_CHECKED_REAL_KINDS)

0 commit comments

Comments
 (0)