aboutsummaryrefslogtreecommitdiff
path: root/arm64/isel.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2022-11-24 11:08:33 +0100
committerQuentin Carbonneaux <[email protected]>2022-11-27 21:48:21 +0100
commit9126afa2da0e1635d78429075cc44ca576f68169 (patch)
tree0836f3da0fdfee9af24ca5dabb8244af61e5283e /arm64/isel.c
parentb5da3f3d64c857baf808220e202dc37c5c039eb8 (diff)
new hlt block terminator
It is handy to express when the end of a block cannot be reached. If a hlt terminator is executed, it traps the program. We don't go the llvm way and specify execution semantics as undefined behavior.
Diffstat (limited to 'arm64/isel.c')
-rw-r--r--arm64/isel.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arm64/isel.c b/arm64/isel.c
index 9b062d8..062beb3 100644
--- a/arm64/isel.c
+++ b/arm64/isel.c
@@ -239,16 +239,11 @@ seljmp(Blk *b, Fn *fn)
Ins *i, *ir;
int ck, cc, use;
- switch (b->jmp.type) {
- default:
- assert(0 && "TODO 2");
- break;
- case Jret0:
- case Jjmp:
+ if (b->jmp.type == Jret0
+ || b->jmp.type == Jjmp
+ || b->jmp.type == Jhlt)
return;
- case Jjnz:
- break;
- }
+ assert(b->jmp.type == Jjnz);
r = b->jmp.arg;
use = -1;
b->jmp.arg = R;