aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Zhao <jerryz123@berkeley.edu>2023-05-27 10:40:28 -0700
committerGitHub <noreply@github.com>2023-05-27 10:40:28 -0700
commit740e6353a166ec3ba936b200482d6fc381b8082b (patch)
treeaeaa4d28a87c8587e49fb3ae34f00b3beffef92e
parentc7cc62952d480b1c96f4b539f843e41b84320fb2 (diff)
parentc231e0c9f6dcf3e9fe0637724d8672560d62c58e (diff)
downloadriscv-isa-sim-740e6353a166ec3ba936b200482d6fc381b8082b.zip
riscv-isa-sim-740e6353a166ec3ba936b200482d6fc381b8082b.tar.gz
riscv-isa-sim-740e6353a166ec3ba936b200482d6fc381b8082b.tar.bz2
Merge pull request #1368 from glg-rv/have_int128/0/topic
Minor fixes (mostly related to __int128 support)
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac4
-rw-r--r--riscv/decode.h5
-rw-r--r--riscv/decode_macros.h5
-rw-r--r--riscv/processor.cc4
6 files changed, 16 insertions, 8 deletions
diff --git a/config.h.in b/config.h.in
index f6755a1..95514fd 100644
--- a/config.h.in
+++ b/config.h.in
@@ -39,6 +39,9 @@
/* Dynamic library loading is supported */
#undef HAVE_DLOPEN
+/* __int128_t is supported */
+#undef HAVE_INT128
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
diff --git a/configure b/configure
index 93a4302..73e5203 100755
--- a/configure
+++ b/configure
@@ -4742,6 +4742,9 @@ ac_fn_cxx_check_type "$LINENO" "__int128_t" "ac_cv_type___int128_t" "$ac_include
if test "x$ac_cv_type___int128_t" = xyes; then :
HAVE_INT128=yes
+
+$as_echo "#define HAVE_INT128 1" >>confdefs.h
+
fi
diff --git a/configure.ac b/configure.ac
index 1b46578..701bd99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,9 @@ AC_HEADER_STDC
# Checks for type
#-------------------------------------------------------------------------
-AC_CHECK_TYPE([__int128_t], AC_SUBST([HAVE_INT128],[yes]))
+AC_CHECK_TYPE([__int128_t],
+ [AC_SUBST([HAVE_INT128],[yes])
+ AC_DEFINE([HAVE_INT128], [1], [__int128_t is supported])])
#-------------------------------------------------------------------------
# Default compiler flags
diff --git a/riscv/decode.h b/riscv/decode.h
index a55b069..dad32a1 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 4391235..6bdd574 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 ef985a1..a75b0ff 100644
--- a/riscv/processor.cc
+++ b/riscv/processor.cc
@@ -42,8 +42,8 @@ processor_t::processor_t(const isa_parser_t *isa, const cfg_t *cfg,
VU.p = this;
TM.proc = this;
-#ifndef __SIZEOF_INT128__
- if (extension_enabled('V')) {
+#ifndef HAVE_INT128
+ if (isa->extension_enabled('V')) {
fprintf(stderr, "V extension is not supported on platforms without __int128 type\n");
abort();
}