1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-05 23:20:38 +02:00
guile/lib/jit_x86-sz.c
pcpa b768fab8b1 Add code to calculate code buffer size based on devel time information.
* lib/jit_aarch64-sz.c, lib/jit_arm-sz.c, lib/jit_hppa-sz.c,
	lib/jit_ia64-sz.c, lib/jit_mips-sz.c, lib/jit_ppc-sz.c,
	lib/jit_s390x-sz.c, lib/jit_size.c, lib/jit_sparc-sz.c,
	lib/jit_x86-sz.c: New files implementing static tables
	with longest known instructions length generated to match
	a lightning instruction. These tables should make it easier
	to make it very unlikely to ever miscalculate, or by too
	much, the size of a code buffer.

	* lib/jit_size.c: New file that aids to either collect
	jit code size information, or use the information depending
	on build options.

	* size.c: New helper file that parses input for, and create
	an initial jit_$arch-sz.c file, that needs some minor edit
	for arches with multiple configurations.

	* configure.ac, Makefile.am: Add the new, devel mode only
	--enable-devel-get-jit-size configure option, that sets
	compile time flags to collect jit code size information,
	that will be used as input for the "noinst size program".

	* lib/jit_aarch64.c, lib/jit_arm.c, lib/jit_disasm.c,
	lib/jit_hppa.c, lib/jit_ia64.c, lib/jit_memory.c,
	lib/jit_mips.c, lib/jit_ppc.c, lib/jit_s390x.c,
	lib/jit_sparc.c, lib/jit_x86.c, lib/lightning.c: Minor
	changes for the --enable-devel-get-jit-size build mode,
	as well as the "production build mode" with jit code
	size information.
2013-09-24 03:31:54 -03:00

700 lines
5.3 KiB
C

#if __WORDSIZE == 32
#define JIT_INSTR_MAX 26
0,
0,
0,
0,
0,
0,
3,
26,
0,
3,
6,
4,
6,
4,
5,
4,
6,
6,
6,
6,
5,
5,
7,
20,
23,
20,
23,
21,
24,
22,
25,
23,
24,
24,
25,
21,
24,
22,
25,
4,
7,
4,
8,
4,
8,
16,
7,
16,
5,
16,
5,
4,
4,
15,
16,
15,
16,
15,
16,
15,
16,
15,
16,
15,
16,
15,
16,
15,
16,
15,
16,
15,
16,
2,
5,
11,
11,
3,
3,
0,
0,
4,
3,
7,
3,
7,
3,
7,
3,
7,
2,
6,
0,
0,
0,
0,
4,
4,
4,
4,
4,
4,
4,
4,
3,
6,
0,
0,
0,
0,
10,
14,
3,
7,
2,
6,
0,
0,
11,
11,
4,
4,
3,
6,
0,
0,
8,
9,
8,
9,
8,
12,
8,
9,
8,
12,
8,
9,
8,
9,
8,
9,
8,
9,
8,
12,
8,
12,
8,
12,
8,
9,
8,
9,
8,
9,
8,
9,
8,
9,
8,
9,
8,
9,
8,
9,
0,
5,
2,
5,
24,
0,
8,
16,
12,
16,
8,
16,
12,
16,
12,
12,
6,
13,
21,
13,
21,
15,
22,
13,
21,
13,
21,
18,
25,
13,
21,
13,
21,
13,
20,
13,
21,
13,
21,
13,
20,
13,
20,
13,
20,
7,
0,
7,
4,
10,
8,
4,
8,
5,
5,
6,
10,
7,
7,
10,
18,
10,
18,
12,
20,
10,
18,
10,
18,
13,
21,
10,
18,
10,
18,
10,
18,
10,
18,
10,
18,
10,
18,
10,
17,
10,
18,
0,
8,
16,
12,
16,
8,
16,
12,
16,
18,
13,
6,
13,
21,
13,
21,
15,
23,
13,
21,
13,
21,
18,
26,
13,
21,
13,
21,
13,
21,
13,
21,
13,
21,
13,
21,
13,
21,
13,
21,
7,
0,
7,
4,
10,
8,
4,
8,
5,
8,
6,
10,
7,
7,
10,
18,
10,
18,
12,
20,
10,
18,
10,
18,
13,
21,
10,
18,
10,
18,
10,
18,
10,
18,
10,
18,
10,
18,
10,
18,
10,
18,
0,
0,
0,
0,
0,
0,
0,
0,
0,
14,
10,
#endif /* __WORDSIZE */
#if __WORDSIZE == 64
#define JIT_INSTR_MAX 43
0,
0,
0,
0,
0,
0,
7,
43,
0,
5,
13,
6,
13,
6,
7,
6,
13,
9,
13,
9,
7,
7,
14,
20,
30,
20,
30,
22,
29,
23,
30,
25,
32,
26,
33,
22,
29,
23,
30,
6,
13,
6,
13,
6,
13,
9,
8,
9,
7,
9,
7,
6,
6,
13,
14,
13,
14,
13,
14,
13,
14,
13,
14,
13,
14,
13,
14,
13,
14,
13,
14,
13,
14,
3,
10,
4,
4,
4,
4,
3,
3,
6,
5,
9,
5,
9,
5,
9,
5,
9,
4,
8,
4,
8,
4,
8,
6,
5,
6,
5,
6,
5,
6,
5,
5,
7,
5,
4,
5,
7,
4,
8,
5,
9,
4,
8,
4,
8,
5,
4,
6,
5,
5,
6,
5,
7,
9,
10,
9,
10,
9,
13,
9,
10,
9,
19,
9,
10,
9,
10,
9,
10,
9,
10,
9,
19,
9,
13,
9,
13,
9,
10,
9,
10,
9,
10,
9,
10,
9,
10,
9,
10,
9,
10,
9,
10,
0,
5,
3,
13,
37,
0,
10,
20,
15,
20,
10,
20,
15,
20,
14,
15,
5,
11,
26,
11,
26,
13,
28,
11,
26,
11,
26,
16,
31,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
5,
5,
5,
5,
5,
15,
6,
10,
7,
6,
6,
10,
7,
7,
10,
20,
10,
25,
12,
27,
10,
25,
10,
25,
13,
28,
10,
25,
10,
25,
10,
25,
10,
25,
10,
25,
10,
25,
10,
25,
10,
25,
0,
10,
25,
15,
25,
10,
25,
15,
25,
21,
16,
5,
12,
27,
12,
27,
14,
29,
12,
27,
12,
27,
17,
32,
12,
27,
12,
27,
12,
27,
12,
27,
12,
27,
12,
27,
12,
27,
12,
27,
5,
5,
5,
5,
5,
15,
6,
10,
7,
6,
6,
10,
7,
7,
11,
26,
11,
26,
13,
28,
11,
26,
11,
26,
14,
29,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
11,
26,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
#endif /* __WORDSIZE */