diff options
author | Quentin Carbonneaux <quentin@c9x.me> | 2022-11-24 11:08:33 +0100 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2022-11-27 21:48:21 +0100 |
commit | 9126afa2da0e1635d78429075cc44ca576f68169 (patch) | |
tree | 0836f3da0fdfee9af24ca5dabb8244af61e5283e /arm64/emit.c | |
parent | b5da3f3d64c857baf808220e202dc37c5c039eb8 (diff) | |
download | roux-9126afa2da0e1635d78429075cc44ca576f68169.tar.gz |
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/emit.c')
-rw-r--r-- | arm64/emit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arm64/emit.c b/arm64/emit.c index 38b7e1a..4a0316c 100644 --- a/arm64/emit.c +++ b/arm64/emit.c @@ -561,6 +561,9 @@ arm64_emitfn(Fn *fn, FILE *out) emitins(i, e); lbl = 1; switch (b->jmp.type) { + case Jhlt: + fprintf(e->f, "\tbrk\t#1000\n"); + break; case Jret0: s = (e->frame - e->padding) / 4; for (r=arm64_rclob; *r>=0; r++) |