decoder.cc (10610:5fae03bd840a) | decoder.cc (10611:3bba9f2d0c7d) |
---|---|
1/* 2 * Copyright (c) 2012-2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 125 unchanged lines hidden (view full) --- 134 } 135 } 136} 137 138void 139Decoder::consumeBytes(int numBytes) 140{ 141 offset += numBytes; | 1/* 2 * Copyright (c) 2012-2014 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 125 unchanged lines hidden (view full) --- 134 } 135 } 136} 137 138void 139Decoder::consumeBytes(int numBytes) 140{ 141 offset += numBytes; |
142 assert(offset <= sizeof(MachInst)); | 142 assert(offset <= sizeof(MachInst) || emi.decoderFault); |
143 if (offset == sizeof(MachInst)) 144 outOfBytes = true; 145} 146 147void 148Decoder::moreBytes(const PCState &pc, Addr fetchPC, MachInst inst) 149{ 150 data = inst; 151 offset = (fetchPC >= pc.instAddr()) ? 0 : pc.instAddr() - fetchPC; 152 emi.thumb = pc.thumb(); 153 emi.aarch64 = pc.aarch64(); 154 emi.fpscrLen = fpscrLen; 155 emi.fpscrStride = fpscrStride; 156 | 143 if (offset == sizeof(MachInst)) 144 outOfBytes = true; 145} 146 147void 148Decoder::moreBytes(const PCState &pc, Addr fetchPC, MachInst inst) 149{ 150 data = inst; 151 offset = (fetchPC >= pc.instAddr()) ? 0 : pc.instAddr() - fetchPC; 152 emi.thumb = pc.thumb(); 153 emi.aarch64 = pc.aarch64(); 154 emi.fpscrLen = fpscrLen; 155 emi.fpscrStride = fpscrStride; 156 |
157 const Addr alignment(pc.thumb() ? 0x1 : 0x3); 158 emi.decoderFault = static_cast<uint8_t>( 159 pc.instAddr() & alignment ? DecoderFault::UNALIGNED : DecoderFault::OK); 160 |
|
157 outOfBytes = false; 158 process(); 159} 160 161StaticInstPtr 162Decoder::decode(ArmISA::PCState &pc) 163{ 164 if (!instDone) --- 19 unchanged lines hidden --- | 161 outOfBytes = false; 162 process(); 163} 164 165StaticInstPtr 166Decoder::decode(ArmISA::PCState &pc) 167{ 168 if (!instDone) --- 19 unchanged lines hidden --- |