Browse Source

fesvr: support int128_t/uint128_t

Also remove now duplicate definition for types.
pull/1364/head
Gianluca Guida 3 years ago
parent
commit
07e7626e56
  1. 7
      fesvr/byteorder.h
  2. 5
      riscv/decode_macros.h

7
fesvr/byteorder.h

@ -15,6 +15,13 @@ static inline int16_t swap(int16_t n) { return int16_t(swap(uint16_t(n))); }
static inline int32_t swap(int32_t n) { return int32_t(swap(uint32_t(n))); }
static inline int64_t swap(int64_t n) { return int64_t(swap(uint64_t(n))); }
#ifdef HAVE_INT128
typedef __int128 int128_t;
typedef unsigned __int128 uint128_t;
static inline uint128_t swap(uint128_t n) { return (uint128_t(swap(uint64_t(n))) << 64) | swap(uint64_t(n >> 64)); }
static inline int128_t swap(int128_t n) { return int128_t(swap(uint128_t(n))); }
#endif
#ifdef WORDS_BIGENDIAN
template<typename T> static inline T from_be(T n) { return n; }
template<typename T> static inline T to_be(T n) { return n; }

5
riscv/decode_macros.h

@ -10,11 +10,6 @@
#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())

Loading…
Cancel
Save