Deleted Added
sdiff udiff text old ( 6306:fe1004d455b2 ) new ( 6712:b95abe00dd9d )
full compact
1/* Copyright (c) 2007-2008 The Florida State University
2 * All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

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

24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Authors: Stephen Hines
28 */
29
30#include "arch/arm/insts/static_inst.hh"
31#include "base/condcodes.hh"
32#include "base/loader/symtab.hh"
33
34namespace ArmISA
35{
36// Shift Rm by an immediate value
37int32_t
38ArmStaticInst::shift_rm_imm(uint32_t base, uint32_t shamt,
39 uint32_t type, uint32_t cfval) const

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

57 else
58 return (int32_t)base >> shamt;
59 case ROR:
60 if (shamt == 0)
61 return (cfval << 31) | (base >> 1); // RRX
62 else
63 return (base << (32 - shamt)) | (base >> shamt);
64 default:
65 fprintf(stderr, "Unhandled shift type\n");
66 exit(1);
67 break;
68 }
69 return 0;
70}
71
72// Shift Rm by Rs
73int32_t

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

96 return (int32_t)base >> shamt;
97 case ROR:
98 shamt = shamt & 0x1f;
99 if (shamt == 0)
100 return base;
101 else
102 return (base << (32 - shamt)) | (base >> shamt);
103 default:
104 fprintf(stderr, "Unhandled shift type\n");
105 exit(1);
106 break;
107 }
108 return 0;
109}
110
111
112// Generate C for a shift by immediate

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

136 return (base >> (shamt - 1)) & 1;
137 case ROR:
138 shamt = shamt & 0x1f;
139 if (shamt == 0)
140 return (base & 1); // RRX
141 else
142 return (base >> (shamt - 1)) & 1;
143 default:
144 fprintf(stderr, "Unhandled shift type\n");
145 exit(1);
146 break;
147 }
148 return 0;
149}
150
151
152// Generate C for a shift by Rs

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

177 shamt = 32;
178 return (base >> (shamt - 1)) & 1;
179 case ROR:
180 shamt = shamt & 0x1f;
181 if (shamt == 0)
182 shamt = 32;
183 return (base >> (shamt - 1)) & 1;
184 default:
185 fprintf(stderr, "Unhandled shift type\n");
186 exit(1);
187 break;
188 }
189 return 0;
190}
191
192
193// Generate the appropriate carry bit for an addition operation

--- 227 unchanged lines hidden ---