47#include "debug/Decoder.hh"
60 dvmEnabled(params.dvm_enabled),
62 decoderFlavor(
safe_cast<
ISA *>(params.isa)->decoderFlavor())
68 getCurSveVecLenInBitsAtReset() >> 7) - 1;
72 ->getCurSmeVecLenInBitsAtReset() >> 7) - 1;
76 "DVM Ops instructions are micro-architecturally "
77 "modelled as loads. This will tamper the effective "
78 "number of loads stat\n");
111 emi.instBits =
emi.instBits | word;
117 uint16_t highBits = word & 0xF800;
118 if (highBits == 0xE800 || highBits == 0xF000 ||
119 highBits == 0xF800) {
131 "First half of 32 bit Thumb.\n");
132 emi.instBits = (uint32_t)word << 16;
146 if (
bits(word, 15, 8) == 0xbf &&
147 bits(word, 3, 0) != 0x0) {
151 "IT detected, cond = %#x, mask = %#x\n",
173 offset = (fetchPC >=
pc.instAddr()) ? 0 :
pc.instAddr() - fetchPC;
174 emi.thumb =
pc.thumb();
175 emi.aarch64 =
pc.aarch64();
180 const Addr alignment(
pc.thumb() ? 0x1 : 0x3);
181 emi.decoderFault =
static_cast<uint8_t
>(
196 const int inst_size((!
emi.thumb ||
emi.bigThumb) ? 4 : 2);
199 pc.npc(
pc.pc() + inst_size);
202 this_emi.itstate =
pc.itstate();
203 this_emi.illegalExecution =
pc.illegalExec() ? 1 : 0;
204 this_emi.debugStep =
pc.debugStep() ? 1 : 0;
211 return decode(this_emi,
pc.instAddr());
static GenericISA::BasicDecodeCache< Decoder, ExtMachInst > defaultCache
A cache of decoded instruction objects.
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 - Pranith Kumar Copyright (c) 2020 Inria 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.