File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ function get_stack_adj_base(rlist : bits(4)) -> int = {
33
33
0b01 => 16 ,
34
34
0b10 => 32 ,
35
35
0b11 => if rlist == 0b1111 then 64 else 48 ,
36
+ _ => 0 ,
36
37
}
37
38
else {
38
39
match rlist [3 .. 1 ] {
@@ -42,16 +43,22 @@ function get_stack_adj_base(rlist : bits(4)) -> int = {
42
43
0b101 => 64 ,
43
44
0b110 => 80 ,
44
45
0b111 => if rlist == 0b1111 then 112 else 96 ,
46
+ _ => 0 ,
45
47
}
46
48
}
47
49
}
48
50
49
51
mapping zcmp_assembly_mapping : (bits (4 ), bits (2 ), bool ) <-> string = {
50
52
forwards (rlist , spimm54 , is_negative ) => {
51
53
var stack_adj : int = undefined ;
54
+ let stack_adj_base = get_stack_adj_base (rlist );
52
55
stack_adj = get_stack_adj_base (rlist ) + unsigned (spimm54 ) * 16 ;
53
56
54
- "{" ^ zcmp_assembly_rlist (rlist ) ^ "}" ^ sep () ^ negative_sign (is_negative ) ^ dec_str (stack_adj )
57
+ if stack_adj_base == 0 then {
58
+ "unsupport rlist" ^ sep () ^ negative_sign (is_negative ) ^ dec_str (stack_adj )
59
+ } else {
60
+ "{" ^ zcmp_assembly_rlist (rlist ) ^ "}" ^ sep () ^ negative_sign (is_negative ) ^ dec_str (stack_adj )
61
+ }
55
62
},
56
63
backwards str_input => {
57
64
var str = str_input ;
You can’t perform that action at this time.
0 commit comments