aboutsummaryrefslogtreecommitdiff
path: root/sim/riscv
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-15 23:50:33 -0400
committerMike Frysinger <vapier@gentoo.org>2021-05-16 00:04:17 -0400
commit79633c125eb260a9ac9ed49e314b916f353c4373 (patch)
treea9cd7798829069234b4251363fec707e9ae185f9 /sim/riscv
parent246ee38501205610cd3db75982c5e40cbd13a9b4 (diff)
downloadfsf-binutils-gdb-79633c125eb260a9ac9ed49e314b916f353c4373.zip
fsf-binutils-gdb-79633c125eb260a9ac9ed49e314b916f353c4373.tar.gz
fsf-binutils-gdb-79633c125eb260a9ac9ed49e314b916f353c4373.tar.bz2
sim: riscv: move __int128 check to configure
Diffstat (limited to 'sim/riscv')
-rw-r--r--sim/riscv/ChangeLog5
-rw-r--r--sim/riscv/config.in3
-rwxr-xr-xsim/riscv/configure14
-rw-r--r--sim/riscv/sim-main.c2
4 files changed, 21 insertions, 3 deletions
diff --git a/sim/riscv/ChangeLog b/sim/riscv/ChangeLog
index 557b722..9fe89f4 100644
--- a/sim/riscv/ChangeLog
+++ b/sim/riscv/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.c (mulhu): Change check to HAVE___INT128.
+ * config.in, configure: Regenerate.
+
2021-05-12 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Delete SIM_AC_OPTION_ENVIRONMENT call.
diff --git a/sim/riscv/config.in b/sim/riscv/config.in
index c694fde..a7c8785 100644
--- a/sim/riscv/config.in
+++ b/sim/riscv/config.in
@@ -139,6 +139,9 @@
/* Define to 1 if you have the <windows.h> header file. */
#undef HAVE_WINDOWS_H
+/* Define to 1 if the system has the type `__int128'. */
+#undef HAVE___INT128
+
/* Define to 1 if you have the `__setfpucw' function. */
#undef HAVE___SETFPUCW
diff --git a/sim/riscv/configure b/sim/riscv/configure
index c41f800..a3587bb 100755
--- a/sim/riscv/configure
+++ b/sim/riscv/configure
@@ -7498,6 +7498,16 @@ _ACEOF
fi
+ac_fn_c_check_type "$LINENO" "__int128" "ac_cv_type___int128" "$ac_includes_default"
+if test "x$ac_cv_type___int128" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE___INT128 1
+_ACEOF
+
+
+fi
+
ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
#include <sys/socket.h>
@@ -11202,7 +11212,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11205 "configure"
+#line 11215 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11308,7 +11318,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11311 "configure"
+#line 11321 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c
index 6a2904c..bb45ffe 100644
--- a/sim/riscv/sim-main.c
+++ b/sim/riscv/sim-main.c
@@ -603,7 +603,7 @@ execute_i (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op)
static unsigned64
mulhu (unsigned64 a, unsigned64 b)
{
-#if defined(__GNUC__) && defined(__SIZEOF_INT128__)
+#ifdef HAVE___INT128
return ((__int128)a * b) >> 64;
#else
uint64_t t;