-
Notifications
You must be signed in to change notification settings - Fork 2
/
decode_end.sail
71 lines (63 loc) · 3.1 KB
/
decode_end.sail
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function clause __DecodeA64_Reserved(_, _) = throw (Error_Undefined())
function clause __DecodeA64_SME(_, _) = throw (Error_Undefined())
function clause __DecodeA64_Unallocated1(_, _) = throw (Error_Undefined())
function clause __DecodeA64_SVE(_, _) = throw (Error_Undefined())
function clause __DecodeA64_Unallocated2(_, _) = throw (Error_Undefined())
function clause __DecodeA64_DataProcImm(_, _) = throw (Error_Undefined())
function clause __DecodeA64_BranchExcSys(_, _) = throw (Error_Undefined())
function clause __DecodeA64_LoadStore(_, _) = throw (Error_Undefined())
function clause __DecodeA64_DataProcReg(_, _) = throw (Error_Undefined())
function clause __DecodeA64_DataProcFPSIMD(_, _) = throw (Error_Undefined())
function clause __DecodeA32_Unconditional(_, _) = throw (Error_Undefined())
function clause __DecodeA32_DataProMisc(_, _) = throw (Error_Undefined())
function clause __DecodeA32_LoadStoreImmLit(_, _) = throw (Error_Undefined())
function clause __DecodeA32_LoadStoreReg(_, _) = throw (Error_Undefined())
function clause __DecodeA32_Media(_, _) = throw (Error_Undefined())
function clause __DecodeA32_BranchBlock(_, _) = throw (Error_Undefined())
function clause __DecodeA32_SysASIMDFP(_, _) = throw (Error_Undefined())
function clause __DecodeT32(_, _) = throw (Error_Undefined())
function clause __DecodeT16(_, _) = throw (Error_Undefined())
end __DecodeA64_Reserved
end __DecodeA64_SME
end __DecodeA64_Unallocated1
end __DecodeA64_SVE
end __DecodeA64_Unallocated2
end __DecodeA64_DataProcImm
end __DecodeA64_BranchExcSys
end __DecodeA64_LoadStore
end __DecodeA64_DataProcReg
end __DecodeA64_DataProcFPSIMD
end __DecodeA32_Unconditional
end __DecodeA32_DataProMisc
end __DecodeA32_LoadStoreImmLit
end __DecodeA32_LoadStoreReg
end __DecodeA32_Media
end __DecodeA32_BranchBlock
end __DecodeA32_SysASIMDFP
end __DecodeT32
end __DecodeT16
function clause __DecodeA64(pc, opcode) =
match opcode {
[bitzero, _, _] @ 0x0 @ _ => __DecodeA64_Reserved(pc, opcode),
[bitone, _ ,_] @ 0x0 @ _ => __DecodeA64_SME(pc, opcode),
[_, _, _] @ 0x1 @ _ => __DecodeA64_Unallocated1(pc, opcode),
[_, _, _] @ 0x2 @ _ => __DecodeA64_SVE(pc, opcode),
[_, _, _] @ 0x3 @ _ => __DecodeA64_Unallocated2(pc, opcode),
[_, _, _] @ 0b100 @ _ => __DecodeA64_DataProcImm(pc, opcode),
[_, _, _] @ 0b101 @ _ => __DecodeA64_BranchExcSys(pc, opcode),
[_, _, _, _, bitone, _, bitzero] @ _ => __DecodeA64_LoadStore(pc, opcode),
[_, _, _, _] @ 0b101 @ _ => __DecodeA64_DataProcReg(pc, opcode),
[_, _, _, _] @ 0b111 @ _ => __DecodeA64_DataProcFPSIMD(pc, opcode),
}
function clause __DecodeA32(pc, opcode) =
match opcode {
0b11110 @ _ => __DecodeA32_Unconditional(pc, opcode),
[_, _, _, _] @ 0b00 @ _ => __DecodeA32_DataProMisc(pc, opcode),
[_, _, _, _] @ 0b010 @ _ => __DecodeA32_LoadStoreImmLit(pc, opcode),
[_, _, _, _] @ 0b011 @ _ @ 0b0 @ (_ : bits(4)) => __DecodeA32_LoadStoreReg(pc, opcode),
[_, _, _, _] @ 0b011 @ _ @ 0b1 @ (_ : bits(4)) => __DecodeA32_Media(pc, opcode),
[_, _, _, _] @ 0b10 @ _ => __DecodeA32_BranchBlock(pc, opcode),
[_, _, _, _] @ 0b11 @ _ => __DecodeA32_SysASIMDFP(pc, opcode),
}
end __DecodeA64
end __DecodeA32