tcg/mips: detect available host instructions at runtime
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 15 Aug 2013 15:57:59 +0000 (17:57 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Mon, 2 Sep 2013 23:34:46 +0000 (01:34 +0200)
commit988902fc3bc599f7431461b790f3d63d3a2357f9
tree49ecdb66af7b7591076aa62c8acc2c7e2e56d1a8
parent4ff78e0dbcd5c795962567fdc1b31e9e03c55b07
tcg/mips: detect available host instructions at runtime

Now that TCG supports enabling and disabling ops at runtime, it's
possible to detect the available host instructions at runtime, and
enable the corresponding ops accordingly.

Unfortunately it's not easy to probe for available instructions on
MIPS, the information is partially available in /proc/cpuinfo, and
not available in AUXV. This patch therefore probes for the instructions
by trying to execute them and by catching a possible SIGILL signal.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/mips/tcg-target.c
tcg/mips/tcg-target.h