diff mbox series

[3/9] ppc: add predefines __LONGDOUBLE128 & __LONG_DOUBLE_128__

Message ID 20200713223304.83666-4-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series arch specific predefines | expand

Commit Message

Luc Van Oostenryck July 13, 2020, 10:32 p.m. UTC
On powerpc, if long double is 128-bit width, then
'__LONGDOUBLE128' & '__LONG_DOUBLE_128__' should be defined.

So do this in the target specific file.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 target-ppc.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/target-ppc.c b/target-ppc.c
index c0d6068f436a..dede8917cbd6 100644
--- a/target-ppc.c
+++ b/target-ppc.c
@@ -14,6 +14,10 @@  static void predefine_ppc(const struct target *self)
 	predefine("_ARCH_PPC", 1, "1");
 	if (arch_big_endian)
 		predefine("_BIG_ENDIAN", 1, "1");
+	if (ldouble_ctype.bit_size == 128) {
+		predefine("__LONGDOUBLE128", 1, "1");
+		predefine("__LONG_DOUBLE_128__", 1, "1");
+	}
 }
 
 static const char *asm_constraint_ppc(struct asm_operand *op, int c, const char *str)