bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* host-cpu-c-abi: Add support for LoongArch64 CPU
@ 2022-01-09 23:29 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2022-01-09 23:29 UTC (permalink / raw
  To: bug-gnulib

On the LoongArch64 CPU, GCC and clang predefine only __loongarch__,
__loongarch64. GCC predefines also __loongarch_lp64. But it's too hard
to remember that __loongarch64__ is not defined. So, let host-cpu-c-abi
define it.

Btw, this is independent of the floating-point variants of the ABI:

-mabi=lp64d (the default) defines
#define __loongarch_hard_float 1
#define __loongarch_double_float 1

-mabi=lp64f defines
#define __loongarch_hard_float 1
#define __loongarch_single_float 1

-mabi=lp64s defines
#define __loongarch_soft_float 1


2022-01-09  Bruno Haible  <bruno@clisp.org>

	host-cpu-c-abi: Add support for LoongArch64 CPU.
	* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Define __loongarch64__. (GCC
	and clang predefine only __loongarch__, __loongarch64.)

diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
index 6d1e4578c7..b9223241b4 100644
--- a/m4/host-cpu-c-abi.m4
+++ b/m4/host-cpu-c-abi.m4
@@ -1,4 +1,4 @@
-# host-cpu-c-abi.m4 serial 14
+# host-cpu-c-abi.m4 serial 15
 dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -382,6 +382,9 @@ EOF
 #ifndef __ia64__
 #undef __ia64__
 #endif
+#ifndef __loongarch64__
+#undef __loongarch64__
+#endif
 #ifndef __m68k__
 #undef __m68k__
 #endif





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-09 23:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-09 23:29 host-cpu-c-abi: Add support for LoongArch64 CPU Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).