Since we only support 64-bit hosts, there's no real need
to parameterize TCG_TARGET_REG_BITS.  It seems worth holding
on to the identifier though, for documentation purposes.

Move one tcg/*/tcg-target-reg-bits.h to tcg/target-reg-bits.h
and remove the others.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Pierrick Bouvier <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
---
 include/tcg/helper-info.h                     |  2 +-
 .../tcg/target-reg-bits.h                     |  8 +++----
 include/tcg/tcg.h                             |  2 +-
 tcg/aarch64/tcg-target-reg-bits.h             | 12 -----------
 tcg/loongarch64/tcg-target-reg-bits.h         | 21 -------------------
 tcg/mips64/tcg-target-reg-bits.h              | 16 --------------
 tcg/riscv64/tcg-target-reg-bits.h             | 19 -----------------
 tcg/s390x/tcg-target-reg-bits.h               | 17 ---------------
 tcg/sparc64/tcg-target-reg-bits.h             | 12 -----------
 tcg/tci/tcg-target-reg-bits.h                 | 18 ----------------
 tcg/x86_64/tcg-target-reg-bits.h              | 16 --------------
 11 files changed, 6 insertions(+), 137 deletions(-)
 rename tcg/ppc64/tcg-target-reg-bits.h => include/tcg/target-reg-bits.h (71%)
 delete mode 100644 tcg/aarch64/tcg-target-reg-bits.h
 delete mode 100644 tcg/loongarch64/tcg-target-reg-bits.h
 delete mode 100644 tcg/mips64/tcg-target-reg-bits.h
 delete mode 100644 tcg/riscv64/tcg-target-reg-bits.h
 delete mode 100644 tcg/s390x/tcg-target-reg-bits.h
 delete mode 100644 tcg/sparc64/tcg-target-reg-bits.h
 delete mode 100644 tcg/tci/tcg-target-reg-bits.h
 delete mode 100644 tcg/x86_64/tcg-target-reg-bits.h

diff --git a/include/tcg/helper-info.h b/include/tcg/helper-info.h
index 49a27e4eae..d5bda83a2e 100644
--- a/include/tcg/helper-info.h
+++ b/include/tcg/helper-info.h
@@ -24,7 +24,7 @@
 #include <ffi.h>
 #pragma GCC diagnostic pop
 #endif
-#include "tcg-target-reg-bits.h"
+#include "tcg/target-reg-bits.h"
 
 #define MAX_CALL_IARGS  7
 
diff --git a/tcg/ppc64/tcg-target-reg-bits.h b/include/tcg/target-reg-bits.h
similarity index 71%
rename from tcg/ppc64/tcg-target-reg-bits.h
rename to include/tcg/target-reg-bits.h
index 3a15d7bee4..8f4ad3ed99 100644
--- a/tcg/ppc64/tcg-target-reg-bits.h
+++ b/include/tcg/target-reg-bits.h
@@ -7,10 +7,10 @@
 #ifndef TCG_TARGET_REG_BITS_H
 #define TCG_TARGET_REG_BITS_H
 
-#ifndef _ARCH_PPC64
-# error Expecting 64-bit host architecture
-#endif
-
+/*
+ * We only support 64-bit hosts now.
+ * Retain the identifier for documentation.
+ */
 #define TCG_TARGET_REG_BITS  64
 
 #endif
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index a6d9aa50d4..067150c542 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -31,7 +31,7 @@
 #include "qemu/plugin.h"
 #include "qemu/queue.h"
 #include "tcg/tcg-mo.h"
-#include "tcg-target-reg-bits.h"
+#include "tcg/target-reg-bits.h"
 #include "tcg-target.h"
 #include "tcg/tcg-cond.h"
 #include "tcg/insn-start-words.h"
diff --git a/tcg/aarch64/tcg-target-reg-bits.h 
b/tcg/aarch64/tcg-target-reg-bits.h
deleted file mode 100644
index 3b57a1aafb..0000000000
--- a/tcg/aarch64/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Define target-specific register size
- * Copyright (c) 2023 Linaro
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-#define TCG_TARGET_REG_BITS  64
-
-#endif
diff --git a/tcg/loongarch64/tcg-target-reg-bits.h 
b/tcg/loongarch64/tcg-target-reg-bits.h
deleted file mode 100644
index 51373ad70a..0000000000
--- a/tcg/loongarch64/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2021 WANG Xuerui <[email protected]>
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-/*
- * Loongson removed the (incomplete) 32-bit support from kernel and toolchain
- * for the initial upstreaming of this architecture, so don't bother and just
- * support the LP64* ABI for now.
- */
-#if defined(__loongarch64)
-# define TCG_TARGET_REG_BITS 64
-#else
-# error unsupported LoongArch register size
-#endif
-
-#endif
diff --git a/tcg/mips64/tcg-target-reg-bits.h b/tcg/mips64/tcg-target-reg-bits.h
deleted file mode 100644
index ee346a3f25..0000000000
--- a/tcg/mips64/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2008-2009 Arnaud Patard <[email protected]>
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-#if !defined(_MIPS_SIM) || _MIPS_SIM != _ABI64
-# error "Unknown ABI"
-#endif
-
-#define TCG_TARGET_REG_BITS 64
-
-#endif
diff --git a/tcg/riscv64/tcg-target-reg-bits.h 
b/tcg/riscv64/tcg-target-reg-bits.h
deleted file mode 100644
index 761ca0d774..0000000000
--- a/tcg/riscv64/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2018 SiFive, Inc
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-/*
- * We don't support oversize guests.
- * Since we will only build tcg once, this in turn requires a 64-bit host.
- */
-#if __riscv_xlen != 64
-#error "unsupported code generation mode"
-#endif
-#define TCG_TARGET_REG_BITS 64
-
-#endif
diff --git a/tcg/s390x/tcg-target-reg-bits.h b/tcg/s390x/tcg-target-reg-bits.h
deleted file mode 100644
index b01414e09d..0000000000
--- a/tcg/s390x/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2009 Ulrich Hecht <[email protected]>
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-/* We only support generating code for 64-bit mode.  */
-#if UINTPTR_MAX == UINT64_MAX
-# define TCG_TARGET_REG_BITS 64
-#else
-# error "unsupported code generation mode"
-#endif
-
-#endif
diff --git a/tcg/sparc64/tcg-target-reg-bits.h 
b/tcg/sparc64/tcg-target-reg-bits.h
deleted file mode 100644
index 34a6711013..0000000000
--- a/tcg/sparc64/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2023 Linaro
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-#define TCG_TARGET_REG_BITS  64
-
-#endif
diff --git a/tcg/tci/tcg-target-reg-bits.h b/tcg/tci/tcg-target-reg-bits.h
deleted file mode 100644
index dcb1a203f8..0000000000
--- a/tcg/tci/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2009, 2011 Stefan Weil
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-#if UINTPTR_MAX == UINT32_MAX
-# define TCG_TARGET_REG_BITS 32
-#elif UINTPTR_MAX == UINT64_MAX
-# define TCG_TARGET_REG_BITS 64
-#else
-# error Unknown pointer size for tci target
-#endif
-
-#endif
diff --git a/tcg/x86_64/tcg-target-reg-bits.h b/tcg/x86_64/tcg-target-reg-bits.h
deleted file mode 100644
index fc3377e829..0000000000
--- a/tcg/x86_64/tcg-target-reg-bits.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Define target-specific register size
- * Copyright (c) 2008 Fabrice Bellard
- */
-
-#ifndef TCG_TARGET_REG_BITS_H
-#define TCG_TARGET_REG_BITS_H
-
-#ifdef __x86_64__
-# define TCG_TARGET_REG_BITS  64
-#else
-# error
-#endif
-
-#endif
-- 
2.43.0


Reply via email to