Skip to content

Commit

Permalink
Merge pull request #1368 from glg-rv/have_int128/0/topic
Browse files Browse the repository at this point in the history
Minor fixes (mostly related to __int128 support)
  • Loading branch information
jerryz123 authored May 27, 2023
2 parents c7cc629 + c231e0c commit 740e635
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions riscv/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions riscv/decode_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions riscv/processor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 740e635

Please sign in to comment.