[PATCH v3 19/19] fix the size of long double

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The odd on here is, of course i386, with its 80-bit extended floats
taking 12 bytes. Idem for __m68k__.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 target.c | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/target.c b/target.c
index ad12b630c..1f71743e3 100644
--- a/target.c
+++ b/target.c
@@ -38,9 +38,9 @@ int max_int_alignment = 4;
  */
 int bits_in_float = 32;
 int bits_in_double = 64;
-int bits_in_longdouble = 80;
+int bits_in_longdouble = 128;
 
-int max_fp_alignment = 8;
+int max_fp_alignment = 16;
 
 /*
  * Pointer data type
@@ -93,6 +93,27 @@ void init_target(void)
 		break;
 	}
 
+	switch (arch_mach) {
+	case MACH_ARM:
+	case MACH_MIPS32:
+	case MACH_S390X:
+	case MACH_SPARC32:
+		bits_in_longdouble = 64;
+		max_fp_alignment = 8;
+		break;
+	case MACH_X86_64:
+		if (arch_m64 == ARCH_LP64)
+			break;
+		/* fall through */
+	case MACH_I386:
+	case MACH_M68K:
+		bits_in_longdouble = 96;
+		max_fp_alignment = 4;
+		break;
+	default:
+		break;
+	}
+
 #if defined(__FreeBSD__) || defined(__APPLE__)
 	wint_ctype = &int_ctype;
 #endif
-- 
2.19.2




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux