diff options
| author | Alastair Reid | 2018-07-01 19:34:08 +0100 |
|---|---|---|
| committer | Alastair Reid | 2018-07-01 20:14:40 +0100 |
| commit | 117e87ce194c50b2221c7fd1966d6e0369423606 (patch) | |
| tree | ab9cac4c306480402e28e5fe67860b101260ab6c /aarch64 | |
| parent | 5361c1d65c469cf9cdaeea345c4779f9c88aad55 (diff) | |
RTS: Fail on AArch32 and ASIMD
This change causes execution of AArch32 code or ASIMD code
to fail with an easily diagnosed error message of the form
UNIMPLEMENTED: xxx support
where xxx is either AArch32 or ASIMD.
Having a clear error message allows these to be detected by triaging
scripts.
To make the AArch32 detection part work, you also need to change
HaveAnyAArch32 to read like this instead of just returning false.
function HaveAnyAArch32 () =
return ((CFG_ID_AA64PFR0_EL1_EL0 == 0x2)
|| (CFG_ID_AA64PFR0_EL1_EL1 == 0x2)
|| (CFG_ID_AA64PFR0_EL1_EL2 == 0x2)
|| (CFG_ID_AA64PFR0_EL1_EL3 == 0x2))
Diffstat (limited to 'aarch64')
| -rw-r--r-- | aarch64/elfmain.sail | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/aarch64/elfmain.sail b/aarch64/elfmain.sail index d6350b5b..bccbbda5 100644 --- a/aarch64/elfmain.sail +++ b/aarch64/elfmain.sail @@ -38,6 +38,10 @@ function Step_CPU() = { var fetch_ok = false; try { + if PSTATE.nRW != bitzero then { + print("UNIMPLEMENTED: AArch32 support\n"); + exit() + }; __currentInstr = __fetchA64(); __currentInstrLength = 4; fetch_ok = true; @@ -56,6 +60,46 @@ function Step_CPU() = { }; if fetch_ok then { + // Detect ASIMD instructions + is_asimd : bool = match __currentInstr { + // '0x00 110' @ _ : bits(25) => true, // ASIMD memory + 0b0000110 @ (_ : bits(25)) => true, + 0b0100110 @ (_ : bits(25)) => true, + + // '0xx0111' @ _ : bits(25) => true, // ASIMD + // '01x1111' @ _ : bits(25) => true, // ASIMD + // 'x0x1111' @ _ : bits(25) => false, // FP + // '1xx0111' @ _ : bits(25) => false, // unallocated + // '11xx111' @ _ : bits(25) => false, // Crypto + + 0b0000111 @ (_ : bits(25)) => true, + 0b0001111 @ (_ : bits(25)) => false, + 0b0010111 @ (_ : bits(25)) => true, + 0b0011111 @ (_ : bits(25)) => false, + + 0b0100111 @ (_ : bits(25)) => true, + 0b0101111 @ (_ : bits(25)) => true, + 0b0110111 @ (_ : bits(25)) => true, + 0b0111111 @ (_ : bits(25)) => true, + + 0b1000111 @ (_ : bits(25)) => false, + 0b1001111 @ (_ : bits(25)) => false, + 0b1010111 @ (_ : bits(25)) => false, + 0b1011111 @ (_ : bits(25)) => false, + + 0b1100111 @ (_ : bits(25)) => false, + 0b1101111 @ (_ : bits(25)) => false, + 0b1110111 @ (_ : bits(25)) => false, + 0b1111111 @ (_ : bits(25)) => false, + + _ => false + }; + if is_asimd then { + print(concat_str("UNIMPLEMENTED: ASIMD support ", + concat_str(HexStr(UInt(__currentInstr)), + "\n"))); + exit() + }; try { __PC_changed = false; ShouldAdvanceIT = (PSTATE.nRW == [bitone]) & (PSTATE.T == [bitone]); |
