47#include "debug/Decoder.hh"
58 dvmEnabled(params.dvm_enabled),
60 decoderFlavor(
safe_cast<
ISA *>(params.isa)->decoderFlavor())
66 getCurSveVecLenInBitsAtReset() >> 7) - 1;
70 ->getCurSmeVecLenInBitsAtReset() >> 7) - 1;
74 "DVM Ops instructions are micro-architecturally "
75 "modelled as loads. This will tamper the effective "
76 "number of loads stat\n");
109 emi.instBits =
emi.instBits | word;
115 uint16_t highBits = word & 0xF800;
116 if (highBits == 0xE800 || highBits == 0xF000 ||
117 highBits == 0xF800) {
129 "First half of 32 bit Thumb.\n");
130 emi.instBits = (uint32_t)word << 16;
144 if (
bits(word, 15, 8) == 0xbf &&
145 bits(word, 3, 0) != 0x0) {
149 "IT detected, cond = %#x, mask = %#x\n",
171 offset = (fetchPC >=
pc.instAddr()) ? 0 :
pc.instAddr() - fetchPC;
172 emi.thumb =
pc.thumb();
173 emi.aarch64 =
pc.aarch64();
178 const Addr alignment(
pc.thumb() ? 0x1 : 0x3);
179 emi.decoderFault =
static_cast<uint8_t
>(
194 const int inst_size((!
emi.thumb ||
emi.bigThumb) ? 4 : 2);
197 pc.npc(
pc.pc() + inst_size);
200 this_emi.itstate =
pc.itstate();
201 this_emi.illegalExecution =
pc.illegalExec() ? 1 : 0;
202 this_emi.debugStep =
pc.debugStep() ? 1 : 0;
209 return decode(this_emi,
pc.instAddr());
void consumeBytes(int numBytes)
Consume bytes by moving the offset into the data word and sanity check the results.
void reset() override
Reset the decoders internal state.
Decoder(const ArmDecoderParams ¶ms)
int smeLen
SME vector length, encoded in the same format as the SMCR_EL<x>.LEN bitfields.
StaticInstPtr decode(ExtMachInst mach_inst, Addr addr)
Decode a pre-decoded machine instruction.
int sveLen
SVE vector length, encoded in the same format as the ZCR_EL<x>.LEN bitfields.
void process()
Pre-decode an instruction from the current state of the decoder.
void moreBytes(const PCStateBase &pc, Addr fetchPC) override
Feed data to the decoder.
const bool dvmEnabled
True if the decoder should emit DVM Ops (treated as Loads)
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
const Params & params() const
@ UNALIGNED
Unaligned instruction fault.
Bitfield< 41, 40 > fpscrStride
Bitfield< 39, 37 > fpscrLen
Copyright (c) 2024 Arm Limited All rights reserved.
T safe_cast(U &&ref_or_ptr)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.