unicorn/qemu/include/qemu
Emilio G. Cota 5ad6116f20
tcg: allocate optimizer temps with tcg_malloc
Groundwork for supporting multiple TCG contexts.

While at it, also allocate temps_used directly as a bitmap of the
required size, instead of using a bitmap of TCG_MAX_TEMPS via
TCGTempSet.

Performance-wise we lose about 1.12% in a translation-heavy workload
such as booting+shutting down debian-arm:

Performance counter stats for 'taskset -c 0 arm-softmmu/qemu-system-arm \
-machine type=virt -nographic -smp 1 -m 4096 \
-netdev user,id=unet,hostfwd=tcp::2222-:22 \
-device virtio-net-device,netdev=unet \
-drive file=die-on-boot.qcow2,id=myblock,index=0,if=none \
-device virtio-blk-device,drive=myblock \
-kernel kernel.img -append console=ttyAMA0 root=/dev/vda1 \
-name arm,debug-threads=on -smp 1' (10 runs):

exec time (s) Relative slowdown wrt original (%)
---------------------------------------------------------------
original 20.213321616 0.
tcg_malloc 20.441130078 1.1270214
TCGContext 20.477846517 1.3086662
g_malloc 20.780527895 2.8061013

The other two alternatives shown in the table are:
- TCGContext: embed temps[TCG_MAX_TEMPS] and TCGTempSet used_temps
in TCGContext. This is simple enough but it isn't faster than using
tcg_malloc; moreover, it wastes memory.
- g_malloc: allocate/deallocate both temps and used_temps every time
tcg_optimize is executed.

Backports commit 34184b071817b4f9edbfd1aa2225c196f05a0947 from qemu
2018-03-14 12:10:28 -04:00
..
atomic.h qemu/atomic: Loosen restrictions for 64-bit ILP32 hosts 2018-03-02 20:06:39 -05:00
bitmap.h tcg: allocate optimizer temps with tcg_malloc 2018-03-14 12:10:28 -04:00
bitops.h bitops: Add MAKE_64BIT_MASK macro 2018-02-25 00:30:39 -05:00
bswap.h fpu/softfloat-types: new header to prevent excessive re-builds 2018-03-08 09:52:15 -05:00
compiler.h Backport qht hashtable 2018-03-13 13:55:30 -04:00
cpuid.h util: Introduce include/qemu/cpuid.h 2018-03-09 12:12:00 -05:00
crc32c.h import 2015-08-21 15:04:50 +08:00
cutils.h util/cutils: Change qemu_strtosz*() from int64_t to uint64_t 2018-03-02 08:58:55 -05:00
fprintf-fn.h Clean up decorations and whitespace around header guards 2018-02-25 04:26:02 -05:00
host-utils.h Drop QEMU_GNUC_PREREQ() checks for gcc older than 4.1 2018-03-02 18:59:05 -05:00
int128.h tcg: Add atomic128 helpers 2018-02-27 21:43:48 -05:00
log.h tcg: Lower indirect registers in a separate pass 2018-02-25 22:32:28 -05:00
mmap-alloc.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
module.h cleanup qemu/include/qemu/module.h 2017-01-25 00:20:08 +08:00
osdep.h osdep.h: Make TIME_MAX handle different time_t types 2018-03-05 13:48:29 -05:00
qht.h Backport qht hashtable 2018-03-13 13:55:30 -04:00
queue.h tcg: Dynamically allocate TCGOps 2018-03-05 16:34:40 -05:00
range.h range: Replace internal representation of Range 2018-02-25 00:44:36 -05:00
thread-posix.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
thread-win32.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
thread.h Clean up ill-advised or unusual header guards 2018-02-25 04:22:46 -05:00
timer.h Drop remaining bits of ia64 host support 2018-03-09 11:54:57 -05:00
typedefs.h memory: Move AddressSpaceDispatch from AddressSpace to FlatView 2018-03-11 20:40:24 -04:00