Add trap codes to the Cretonne IL.

The trap and trapz/trapnz instructions now take a trap code immediate
operand which indicates the reason for trapping.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-20 13:58:57 -07:00
parent 0f21fd342a
commit e8723be33f
28 changed files with 199 additions and 62 deletions

View File

@@ -44,11 +44,11 @@ fn simple_traversal() {
brz v4, ebb4
jump ebb5
ebb3:
trap
trap user0
ebb4:
trap
trap user0
ebb5:
trap
trap user0
}
",
vec![0, 1, 3, 2, 4, 5],
@@ -123,7 +123,7 @@ fn loops_three() {
jump ebb6
ebb5:
brz v0, ebb4
trap
trap user0
ebb6:
jump ebb7
ebb7:
@@ -152,7 +152,7 @@ fn back_edge_one() {
brnz v0, ebb0
return
ebb4:
trap
trap user0
}
",
vec![0, 1, 3, 2, 4],