Implement a poor man's jump table.

We will eventually support real jump tables, but for now just expand
br_table into a sequence of conditional branches.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-25 10:56:14 -07:00
parent 29dfcf5dfb
commit fdb97da21b
4 changed files with 53 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ expand.custom_legalize(insts.heap_addr, 'expand_heap_addr')
# TODO: Add sufficient XForm syntax that we don't need to hand-code these.
expand.custom_legalize(insts.trapz, 'expand_cond_trap')
expand.custom_legalize(insts.trapnz, 'expand_cond_trap')
expand.custom_legalize(insts.br_table, 'expand_br_table')
# Custom expansions for floating point constants.
# These expansions require bit-casting or creating constant pool entries.