static_inst.hh (7397:cbd950459a29) static_inst.hh (7400:f6c9b27c4dbe)
1/*
2 * Copyright (c) 2010 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

--- 142 unchanged lines hidden (view full) ---

151 IntRegIndex rd, IntRegIndex rn, IntRegIndex rm,
152 IntRegIndex rs, uint32_t shiftAmt, ArmShiftType type,
153 uint32_t imm) const;
154
155 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
156
157 static uint32_t
158 cpsrWriteByInstr(CPSR cpsr, uint32_t val,
1/*
2 * Copyright (c) 2010 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

--- 142 unchanged lines hidden (view full) ---

151 IntRegIndex rd, IntRegIndex rn, IntRegIndex rm,
152 IntRegIndex rs, uint32_t shiftAmt, ArmShiftType type,
153 uint32_t imm) const;
154
155 std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
156
157 static uint32_t
158 cpsrWriteByInstr(CPSR cpsr, uint32_t val,
159 uint8_t byteMask, bool affectState)
159 uint8_t byteMask, bool affectState, bool nmfi)
160 {
161 bool privileged = (cpsr.mode != MODE_USER);
162
163 uint32_t bitMask = 0;
164
165 if (bits(byteMask, 3)) {
166 unsigned lowIdx = affectState ? 24 : 27;
167 bitMask = bitMask | mask(31, lowIdx);

--- 14 unchanged lines hidden (view full) ---

182 } else {
183 warn_once("Ignoring write of bad mode to CPSR.\n");
184 }
185 }
186 if (affectState)
187 bitMask = bitMask | (1 << 5);
188 }
189
160 {
161 bool privileged = (cpsr.mode != MODE_USER);
162
163 uint32_t bitMask = 0;
164
165 if (bits(byteMask, 3)) {
166 unsigned lowIdx = affectState ? 24 : 27;
167 bitMask = bitMask | mask(31, lowIdx);

--- 14 unchanged lines hidden (view full) ---

182 } else {
183 warn_once("Ignoring write of bad mode to CPSR.\n");
184 }
185 }
186 if (affectState)
187 bitMask = bitMask | (1 << 5);
188 }
189
190 return ((uint32_t)cpsr & ~bitMask) | (val & bitMask);
190 bool cpsr_f = cpsr.f;
191 uint32_t new_cpsr = ((uint32_t)cpsr & ~bitMask) | (val & bitMask);
192 if (nmfi && !cpsr_f)
193 new_cpsr &= ~(1 << 6);
194 return new_cpsr;
191 }
192
193 static uint32_t
194 spsrWriteByInstr(uint32_t spsr, uint32_t val,
195 uint8_t byteMask, bool affectState)
196 {
197 uint32_t bitMask = 0;
198

--- 100 unchanged lines hidden ---
195 }
196
197 static uint32_t
198 spsrWriteByInstr(uint32_t spsr, uint32_t val,
199 uint8_t byteMask, bool affectState)
200 {
201 uint32_t bitMask = 0;
202

--- 100 unchanged lines hidden ---