X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=deps%2Flightning%2Flib%2Fjit_size.c;h=143a5d9d77336f997340df9fac189a54e8eeee17;hb=b68d544b28b604e2e88e2dbab5b55826a03a269e;hp=b3e1caea85cbdbb206ea4b9b60f3d41f5caab33b;hpb=c0c1a5b0163ec977f5cc597a8732e0fce93203f7;p=pcsx_rearmed.git diff --git a/deps/lightning/lib/jit_size.c b/deps/lightning/lib/jit_size.c index b3e1caea..143a5d9d 100644 --- a/deps/lightning/lib/jit_size.c +++ b/deps/lightning/lib/jit_size.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2022 Free Software Foundation, Inc. + * Copyright (C) 2013-2023 Free Software Foundation, Inc. * * This file is part of GNU lightning. * @@ -28,7 +28,7 @@ */ static jit_int16_t _szs[jit_code_last_code] = { #if GET_JIT_SIZE -# define JIT_INSTR_MAX 512 +# define JIT_INSTR_MAX 1024 #else # if defined(__i386__) || defined(__x86_64__) # include "jit_x86-sz.c" @@ -121,7 +121,15 @@ _jit_get_size(jit_state_t *_jit) break; } # endif - size += _szs[node->code]; + switch (node->code) { + /* The instructions are special because they can be arbitrarily long. */ + case jit_code_align: + case jit_code_skip: + size += node->u.w; + break; + default: + size += _szs[node->code]; + } } # if __riscv && __WORDSIZE == 64 /* Heuristically only 20% of constants are unique. */ @@ -143,7 +151,7 @@ jit_finish_size(void) { #if GET_JIT_SIZE FILE *fp; - jit_word_t offset; + int offset; /* Define a single path */ fp = fopen(JIT_SIZE_PATH, "a");