sim: riscv: fix building on 32-bit hosts w/out int128

Check for __SIZEOF_INT128__ before trying to use the builtin type.
This fixes building on some 32-bit systems like x86.
This commit is contained in:
Mike Frysinger
2021-05-01 15:58:09 -04:00
parent f1ca32150c
commit bd12755bf4
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2021-05-01 Mike Frysinger <vapier@gentoo.org>
* sim-main.c (mulhu): Check if __SIZEOF_INT128__ is defined.
2021-04-26 Mike Frysinger <vapier@gentoo.org>
* sim-main.c (MAX, MIN): Delete.

View File

@ -603,7 +603,7 @@ execute_i (SIM_CPU *cpu, unsigned_word iw, const struct riscv_opcode *op)
static unsigned64
mulhu (unsigned64 a, unsigned64 b)
{
#ifdef __GNUC__
#if defined(__GNUC__) && defined(__SIZEOF_INT128__)
return ((__int128)a * b) >> 64;
#else
uint64_t t;