From 3010cb4175c5b3f485e6ce7e749afa0667f71dbe Mon Sep 17 00:00:00 2001 From: Gianluca Guida Date: Thu, 25 May 2023 14:39:01 +0100 Subject: [PATCH] Use HAVE_INT128 instead of __SIZEOF_INT128__ Make sure that the configure decision on 128-bit is consistent during compilation. Also move uint128_t definition. --- riscv/decode.h | 5 ----- riscv/decode_macros.h | 5 +++++ riscv/processor.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/riscv/decode.h b/riscv/decode.h index a55b0694..dad32a1e 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -19,11 +19,6 @@ typedef int64_t sreg_t; typedef uint64_t reg_t; typedef float128_t freg_t; -#ifdef __SIZEOF_INT128__ -typedef __int128 int128_t; -typedef unsigned __int128 uint128_t; -#endif - const int NXPR = 32; const int NFPR = 32; const int NVPR = 32; diff --git a/riscv/decode_macros.h b/riscv/decode_macros.h index fee8ae7f..6dcf4fa4 100644 --- a/riscv/decode_macros.h +++ b/riscv/decode_macros.h @@ -10,6 +10,11 @@ #include "softfloat_types.h" #include "specialize.h" +#ifdef HAVE_INT128 +typedef __int128 int128_t; +typedef unsigned __int128 uint128_t; +#endif + // helpful macros, etc #define MMU (*p->get_mmu()) #define STATE (*p->get_state()) diff --git a/riscv/processor.cc b/riscv/processor.cc index ef985a18..e5ae60b4 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -42,7 +42,7 @@ processor_t::processor_t(const isa_parser_t *isa, const cfg_t *cfg, VU.p = this; TM.proc = this; -#ifndef __SIZEOF_INT128__ +#ifndef HAVE_INT128 if (extension_enabled('V')) { fprintf(stderr, "V extension is not supported on platforms without __int128 type\n"); abort();