diff options
| author | Robert Norton | 2016-05-11 16:46:50 +0100 |
|---|---|---|
| committer | Robert Norton | 2016-05-11 16:46:50 +0100 |
| commit | 153fc080fae382bf3444ed8ae9ecb394342d8964 (patch) | |
| tree | d1786b8b0f9299dedf2315bdcaba18b79f4a74a7 /cheri | |
| parent | 2662247c6c70f0d0b448adfe14a701e669580880 (diff) | |
Fix XXX missing register accessible check in ClearRegs, also only do CP2Usable check if for cap. regsets.
Diffstat (limited to 'cheri')
| -rw-r--r-- | cheri/cheri_insts.sail | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cheri/cheri_insts.sail b/cheri/cheri_insts.sail index 5da817a3..cccb361a 100644 --- a/cheri/cheri_insts.sail +++ b/cheri/cheri_insts.sail @@ -276,9 +276,13 @@ function clause decode (0b010010 : 0b01111 : 0b00010 : (bit[16]) imm) = Some(Cle function clause decode (0b010010 : 0b01111 : 0b00011 : (bit[16]) imm) = Some(ClearRegs(CHi, imm)) (* CClearHi *) function clause execute (ClearRegs(regset, mask)) = { - checkCP2usable(); + if ((regset == CLo) | (regset == CHi)) then + checkCP2usable(); if (regset == CHi) then - ()(* XXX check exception *); + foreach (i from 0 to 15) + let r = ((bit[5]) (i+16)) in + if (mask[i] & register_inaccessible(r)) then + exit (raise_c2_exception_v(r)); foreach (i from 0 to 15) if (mask[i]) then switch (regset) { |
