tcg: initial ia64 support

A few words about design choices:
* On IA64, instructions should be grouped by bundle, and dependencies
  between instructions declared. A first version of this code tried to
  schedule instructions automatically, but was very complex and too
  invasive for the current common TCG code (ops not ending at
  instruction boundaries, code retranslation breaking already generated
  code, etc.)  It was also not very efficient, as dependencies between
  TCG ops is not available.
  Instead the option taken by the current implementation does not try
  to fill the bundle by scheduling instructions, but by providing ops
  not available as an ia64 instruction, and by offering 22-bit constant
  loading for most of the instructions. With both options the bundle are
  filled at approximately the same level.

* Up to 128 registers can be affected to a function on IA64, but TCG
  limits this number to 64, which is actually more than enough. The
  register affectation is the following:
  - r0: used to map a constant argument with value 0
  - r1: global pointer
  - r2, r3: internal use
  - r4 to r6: not used to avoid saving them
  - r7: env structure
  - r8 to r11: free for TCG (call clobbered)
  - r12: stack pointer
  - r13: thread pointer
  - r14 to r31: free for TCG (call clobbered)
  - r32: reserved (return address)
  - r33: reserved (PFS)
  - r33 to r63: free for TCG

* The IA64 architecture has only 64-bit registers and no 32-bit
  instructions (the only exception being cmp4). Therefore 64-bit
  registers and instructions are used for 32-bit ops. The adopted
  strategy is the same as the ABI, that is the higher 32 bits are
  undefined. Most ops (and, or, add, shl, etc.) can directly use
  the 64-bit registers, while some others have to sign-extend (sar,
  div, etc.) or zero-extend (shr, divu, etc.) the register first.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
4 files changed
tree: 576ec2a29439ac69b71709437de5a23e3d5f57c0
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. default-configs/
  6. docs/
  7. fpu/
  8. gdb-xml/
  9. hw/
  10. linux-user/
  11. net/
  12. pc-bios/
  13. QMP/
  14. roms/
  15. slirp/
  16. sysconfigs/
  17. target-alpha/
  18. target-arm/
  19. target-cris/
  20. target-i386/
  21. target-m68k/
  22. target-microblaze/
  23. target-mips/
  24. target-ppc/
  25. target-s390x/
  26. target-sh4/
  27. target-sparc/
  28. tcg/
  29. tests/
  30. .gitignore
  31. .gitmodules
  32. a.out.h
  33. acl.c
  34. acl.h
  35. aes.c
  36. aes.h
  37. aio.c
  38. alpha-dis.c
  39. alpha.ld
  40. arch_init.c
  41. arch_init.h
  42. arm-dis.c
  43. arm-semi.c
  44. arm.ld
  45. async.c
  46. balloon.h
  47. block-migration.c
  48. block-migration.h
  49. block.c
  50. block.h
  51. block_int.h
  52. bswap.h
  53. bt-host.c
  54. bt-host.h
  55. bt-vhci.c
  56. buffered_file.c
  57. buffered_file.h
  58. cache-utils.c
  59. cache-utils.h
  60. Changelog
  61. check-qdict.c
  62. check-qfloat.c
  63. check-qint.c
  64. check-qjson.c
  65. check-qlist.c
  66. check-qstring.c
  67. cmd.c
  68. cmd.h
  69. cocoa.m
  70. CODING_STYLE
  71. config.h
  72. configure
  73. console.c
  74. console.h
  75. COPYING
  76. COPYING.LIB
  77. cpu-all.h
  78. cpu-common.h
  79. cpu-defs.h
  80. cpu-exec.c
  81. cpus.c
  82. cpus.h
  83. create_config
  84. cris-dis.c
  85. curses.c
  86. curses_keys.h
  87. cutils.c
  88. d3des.c
  89. d3des.h
  90. def-helper.h
  91. device_tree.c
  92. device_tree.h
  93. dis-asm.h
  94. disas.c
  95. disas.h
  96. dma-helpers.c
  97. dma.h
  98. dyngen-exec.h
  99. elf.h
  100. envlist.c
  101. envlist.h
  102. exec-all.h
  103. exec.c
  104. feature_to_c.sh
  105. gdbstub.c
  106. gdbstub.h
  107. gen-icount.h
  108. host-utils.c
  109. host-utils.h
  110. hpet.h
  111. hppa-dis.c
  112. hppa.ld
  113. hxtool
  114. i386-dis.c
  115. i386.ld
  116. ia64-dis.c
  117. ia64.ld
  118. input.c
  119. ioport-user.c
  120. ioport.c
  121. ioport.h
  122. json-lexer.c
  123. json-lexer.h
  124. json-parser.c
  125. json-parser.h
  126. json-streamer.c
  127. json-streamer.h
  128. keymaps.c
  129. keymaps.h
  130. kvm-all.c
  131. kvm.h
  132. libfdt_env.h
  133. LICENSE
  134. linux-aio.c
  135. m68k-dis.c
  136. m68k-semi.c
  137. m68k.ld
  138. MAINTAINERS
  139. Makefile
  140. Makefile.dis
  141. Makefile.hw
  142. Makefile.objs
  143. Makefile.target
  144. Makefile.user
  145. microblaze-dis.c
  146. migration-exec.c
  147. migration-fd.c
  148. migration-tcp.c
  149. migration-unix.c
  150. migration.c
  151. migration.h
  152. mips-dis.c
  153. mips.ld
  154. module.c
  155. module.h
  156. monitor.c
  157. monitor.h
  158. nbd.c
  159. nbd.h
  160. net-checksum.c
  161. net.c
  162. net.h
  163. notify.c
  164. notify.h
  165. osdep.c
  166. osdep.h
  167. path.c
  168. pci-ids.txt
  169. posix-aio-compat.c
  170. ppc-dis.c
  171. ppc.ld
  172. ppc64.ld
  173. qbool.c
  174. qbool.h
  175. qdict-test-data.txt
  176. qdict.c
  177. qdict.h
  178. qemu-aio.h
  179. qemu-barrier.h
  180. qemu-binfmt-conf.sh
  181. qemu-char.c
  182. qemu-char.h
  183. qemu-common.h
  184. qemu-config.c
  185. qemu-config.h
  186. qemu-doc.texi
  187. qemu-error.c
  188. qemu-error.h
  189. qemu-img-cmds.hx
  190. qemu-img.c
  191. qemu-img.texi
  192. qemu-io.c
  193. qemu-lock.h
  194. qemu-log.h
  195. qemu-malloc.c
  196. qemu-monitor.hx
  197. qemu-nbd.c
  198. qemu-nbd.texi
  199. qemu-objects.h
  200. qemu-option.c
  201. qemu-option.h
  202. qemu-options.hx
  203. qemu-queue.h
  204. qemu-sockets.c
  205. qemu-tech.texi
  206. qemu-thread.c
  207. qemu-thread.h
  208. qemu-timer.c
  209. qemu-timer.h
  210. qemu-tool.c
  211. qemu-x509.h
  212. qemu.sasl
  213. qemu_socket.h
  214. qerror.c
  215. qerror.h
  216. qfloat.c
  217. qfloat.h
  218. qint.c
  219. qint.h
  220. qjson.c
  221. qjson.h
  222. qlist.c
  223. qlist.h
  224. qobject.h
  225. qstring.c
  226. qstring.h
  227. readline.c
  228. readline.h
  229. README
  230. rules.mak
  231. rwhandler.c
  232. rwhandler.h
  233. s390-dis.c
  234. s390.ld
  235. savevm.c
  236. sdl.c
  237. sdl_keysym.h
  238. sdl_zoom.c
  239. sdl_zoom.h
  240. sdl_zoom_template.h
  241. sh4-dis.c
  242. softmmu-semi.h
  243. softmmu_defs.h
  244. softmmu_exec.h
  245. softmmu_header.h
  246. softmmu_template.h
  247. sparc-dis.c
  248. sparc.ld
  249. sparc64.ld
  250. sysemu.h
  251. targphys.h
  252. tcg-runtime.c
  253. texi2pod.pl
  254. thunk.c
  255. thunk.h
  256. TODO
  257. translate-all.c
  258. uboot_image.h
  259. usb-bsd.c
  260. usb-linux.c
  261. usb-stub.c
  262. VERSION
  263. vgafont.h
  264. vl.c
  265. vnc-auth-sasl.c
  266. vnc-auth-sasl.h
  267. vnc-auth-vencrypt.c
  268. vnc-auth-vencrypt.h
  269. vnc-tls.c
  270. vnc-tls.h
  271. vnc.c
  272. vnc.h
  273. vnc_keysym.h
  274. vnchextile.h
  275. x86_64.ld
  276. x_keymap.c
  277. x_keymap.h