Implement jump table fix-ups for linear register allocator.
authorEdward Z. Yang <ezyang@mit.edu>
Sun, 17 Apr 2011 22:29:29 +0000 (23:29 +0100)
committerEdward Z. Yang <ezyang@mit.edu>
Wed, 27 Apr 2011 17:01:53 +0000 (18:01 +0100)
commit16a037a8f9c7e444230c226081023fe56ffa2264
tree57f0abe8b53f4cbbe39f305397ea128a1d549edc
parentcb5a1b4c5fee21a2bd79bd1469684f1ff97804fa
Implement jump table fix-ups for linear register allocator.

We achieve this by splitting up instruction selection for case
switches into two parts: the actual code generation, and the
generation of the accompanying jump table.  With this scheme,
the jump fixup code can modify the contents of the jump table
stored within the JMP_TBL (or BCTL) instruction, before the
actual data section is created.

SPARC and PPC patches are untested; they might not work!

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
compiler/nativeGen/AsmCodeGen.lhs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/PPC/Instr.hs
compiler/nativeGen/PPC/Ppr.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/SPARC/Instr.hs
compiler/nativeGen/SPARC/Ppr.hs
compiler/nativeGen/X86/CodeGen.hs
compiler/nativeGen/X86/Instr.hs
compiler/nativeGen/X86/Ppr.hs