gem5  v20.1.0.0
aapcs32.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Google Inc.
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
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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 
28 #ifndef __ARCH_ARM_AAPCS32_HH__
29 #define __ARCH_ARM_AAPCS32_HH__
30 
31 #include <algorithm>
32 #include <array>
33 #include <type_traits>
34 #include <utility>
35 
36 #include "arch/arm/intregs.hh"
37 #include "arch/arm/utility.hh"
38 #include "base/intmath.hh"
39 #include "cpu/thread_context.hh"
40 #include "mem/port_proxy.hh"
41 #include "sim/guest_abi.hh"
42 #include "sim/proxy_ptr.hh"
43 
44 class ThreadContext;
45 
46 struct Aapcs32
47 {
48  struct State
49  {
50  bool stackUsed=false; // Whether anything has been put on the stack.
51 
52  int ncrn=0; // Next general purpose register number.
53  Addr nsaa; // Next stacked argument address.
54 
55  // The maximum allowed general purpose register number.
56  static const int MAX_CRN = 3;
57 
59 
60  explicit State(const ThreadContext *tc) :
61  nsaa(tc->readIntReg(ArmISA::INTREG_SPX))
62  {}
63  };
64 };
65 
66 namespace GuestABI
67 {
68 
69 /*
70  * Composite Types
71  */
72 
73 template <typename T, typename Enabled=void>
74 struct IsAapcs32Composite : public std::false_type {};
75 
76 template <typename T>
77 struct IsAapcs32Composite<T, typename std::enable_if<
78  (std::is_array<T>::value ||
79  std::is_class<T>::value ||
80  std::is_union<T>::value) &&
81  // VarArgs is technically a composite type, but it's not a normal argument.
82  !IsVarArgs<T>::value
83  >::type> : public std::true_type
84 {};
85 
86 // Homogeneous Aggregates
87 // These *should* be any aggregate type which has only one type of member, but
88 // we can't actually detect that or manipulate that with templates. Instead,
89 // we approximate that by detecting only arrays with that property.
90 
91 template <typename T, std::size_t count, typename Enabled=void>
93 
94 template <typename T>
95 struct IsAapcs32HomogeneousAggregate : public std::false_type {};
96 
97 template <typename E, size_t N>
98 struct IsAapcs32HomogeneousAggregate<E[N]> : public std::true_type {};
99 
101 {
102  template <typename T>
103  static T
105  {
106  state.stackUsed = true;
107 
108  // The alignment is the larger of 4 or the natural alignment of T.
109  size_t align = std::max<size_t>(4, alignof(T));
110  // Increase the size to the next multiple of 4.
111  size_t size = roundUp(sizeof(T), 4);
112 
113  // Align the stack.
114  state.nsaa = roundUp(state.nsaa, align);
115 
116  // Extract the value from it.
117  ConstVPtr<T> val(state.nsaa, tc);
118 
119  // Move the nsaa past this argument.
120  state.nsaa += size;
121 
122  // Return the value we extracted.
123  return gtoh(*val, ArmISA::byteOrder(tc));
124  }
125 };
126 
127 
128 /*
129  * Integer arguments and return values.
130  */
131 
132 template <typename Integer>
133 struct Result<Aapcs32, Integer, typename std::enable_if<
134  std::is_integral<Integer>::value && (sizeof(Integer) < sizeof(uint32_t))
135  >::type>
136 {
137  static void
138  store(ThreadContext *tc, const Integer &i)
139  {
140  uint32_t val = std::is_signed<Integer>::value ?
141  sext<sizeof(Integer) * 8>(i) : i;
143  }
144 };
145 
146 template <typename Integer>
147 struct Result<Aapcs32, Integer, typename std::enable_if<
148  std::is_integral<Integer>::value && (sizeof(Integer) == sizeof(uint32_t))
149  >::type>
150 {
151  static void
152  store(ThreadContext *tc, const Integer &i)
153  {
154  tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)i);
155  }
156 };
157 
158 template <typename Integer>
159 struct Result<Aapcs32, Integer, typename std::enable_if<
160  std::is_integral<Integer>::value && (sizeof(Integer) == sizeof(uint64_t))
161  >::type>
162 {
163  static void
164  store(ThreadContext *tc, const Integer &i)
165  {
166  if (std::is_same<Integer, Addr>::value) {
167  tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)i);
168  } else if (ArmISA::byteOrder(tc) == ByteOrder::little) {
169  tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)(i >> 0));
170  tc->setIntReg(ArmISA::INTREG_R1, (uint32_t)(i >> 32));
171  } else {
172  tc->setIntReg(ArmISA::INTREG_R0, (uint32_t)(i >> 32));
173  tc->setIntReg(ArmISA::INTREG_R1, (uint32_t)(i >> 0));
174  }
175  }
176 };
177 
178 template <typename Integer>
179 struct Argument<Aapcs32, Integer, typename std::enable_if<
180  std::is_integral<Integer>::value && (sizeof(Integer) <= sizeof(uint32_t))
181  >::type> : public Aapcs32ArgumentBase
182 {
183  static Integer
185  {
186  if (state.ncrn <= state.MAX_CRN) {
187  return tc->readIntReg(state.ncrn++);
188  }
189 
190  // Max out the ncrn since we effectively exhausted it.
191  state.ncrn = state.MAX_CRN + 1;
192 
193  return loadFromStack<Integer>(tc, state);
194  }
195 };
196 
197 template <typename Integer>
198 struct Argument<Aapcs32, Integer, typename std::enable_if<
199  std::is_integral<Integer>::value && (sizeof(Integer) > sizeof(uint32_t))
200  >::type> : public Aapcs32ArgumentBase
201 {
202  static Integer
204  {
205  if (std::is_same<Integer, Addr>::value &&
206  state.ncrn <= state.MAX_CRN) {
207  return tc->readIntReg(state.ncrn++);
208  }
209 
210  if (alignof(Integer) == 8 && (state.ncrn % 2))
211  state.ncrn++;
212 
213  if (sizeof(Integer) == sizeof(uint64_t) &&
214  state.ncrn + 1 <= state.MAX_CRN) {
215  Integer low, high;
216  if (ArmISA::byteOrder(tc) == ByteOrder::little) {
217  low = tc->readIntReg(state.ncrn++) & mask(32);
218  high = tc->readIntReg(state.ncrn++) & mask(32);
219  } else {
220  high = tc->readIntReg(state.ncrn++) & mask(32);
221  low = tc->readIntReg(state.ncrn++) & mask(32);
222  }
223  return low | (high << 32);
224  }
225 
226  // Max out the ncrn since we effectively exhausted it.
227  state.ncrn = state.MAX_CRN + 1;
228 
229  return loadFromStack<Integer>(tc, state);
230  }
231 };
232 
233 
234 /*
235  * Floating point and Short-Vector arguments and return values.
236  */
237 
238 template <typename Float>
239 struct Result<Aapcs32, Float, typename std::enable_if<
240  std::is_floating_point<Float>::value>::type>
241 {
242  static void
243  store(ThreadContext *tc, const Float &f, Aapcs32::State &state)
244  {
245  auto i = floatToBits(f);
246  storeResult<Aapcs32, decltype(i)>(tc, i, state);
247  };
248 };
249 
250 template <typename Float>
251 struct Argument<Aapcs32, Float, typename std::enable_if<
252  std::is_floating_point<Float>::value>::type> : public Aapcs32ArgumentBase
253 {
254  static Float
256  {
257  if (sizeof(Float) == sizeof(uint32_t)) {
258  return bitsToFloat32(
259  getArgument<Aapcs32, uint32_t>(tc, state));
260  } else {
261  return bitsToFloat64(
262  getArgument<Aapcs32, uint64_t>(tc, state));
263  }
264  }
265 };
266 
267 
268 /*
269  * Composite arguments and return values.
270  */
271 
272 template <typename Composite>
273 struct Result<Aapcs32, Composite, typename std::enable_if<
274  IsAapcs32Composite<Composite>::value>::type>
275 {
276  static void
277  store(ThreadContext *tc, const Composite &composite,
278  Aapcs32::State &state)
279  {
280  if (sizeof(Composite) <= sizeof(uint32_t)) {
281  Composite cp = htog(composite, ArmISA::byteOrder(tc));
282  uint32_t val;
283  memcpy((void *)&val, (void *)&cp, sizeof(Composite));
284  val = gtoh(val, ArmISA::byteOrder(tc));
286  } else {
287  VPtr<Composite> cp(state.retAddr, tc);
288  *cp = htog(composite, ArmISA::byteOrder(tc));
289  }
290  }
291 
292  static void
294  {
295  if (sizeof(Composite) > sizeof(uint32_t))
296  state.retAddr = tc->readIntReg(state.ncrn++);
297  }
298 };
299 
300 template <typename Composite>
301 struct Argument<Aapcs32, Composite, typename std::enable_if<
302  IsAapcs32Composite<Composite>::value>::type> :
303  public Aapcs32ArgumentBase
304 {
305  static Composite
307  {
308  size_t bytes = sizeof(Composite);
309  using Chunk = uint32_t;
310 
311  const int chunk_size = sizeof(Chunk);
312  const int regs = (bytes + chunk_size - 1) / chunk_size;
313 
314  if (bytes <= chunk_size) {
315  if (state.ncrn++ <= state.MAX_CRN) {
316  alignas(alignof(Composite)) uint32_t val =
317  tc->readIntReg(state.ncrn++);
318  val = htog(val, ArmISA::byteOrder(tc));
319  return gtoh(*(Composite *)&val, ArmISA::byteOrder(tc));
320  }
321  }
322 
323  if (alignof(Composite) == 8 && (state.ncrn % 2))
324  state.ncrn++;
325 
326  if (state.ncrn + regs - 1 <= state.MAX_CRN) {
327  alignas(alignof(Composite)) uint8_t buf[bytes];
328  for (int i = 0; i < regs; i++) {
329  Chunk val = tc->readIntReg(state.ncrn++);
330  val = htog(val, ArmISA::byteOrder(tc));
331  size_t to_copy = std::min<size_t>(bytes, chunk_size);
332  memcpy(buf + i * chunk_size, &val, to_copy);
333  bytes -= to_copy;
334  }
335  return gtoh(*(Composite *)buf, ArmISA::byteOrder(tc));
336  }
337 
338  if (!state.stackUsed && state.ncrn <= state.MAX_CRN) {
339  alignas(alignof(Composite)) uint8_t buf[bytes];
340 
341  int offset = 0;
342  while (state.ncrn <= state.MAX_CRN) {
343  Chunk val = tc->readIntReg(state.ncrn++);
344  val = htog(val, ArmISA::byteOrder(tc));
345  size_t to_copy = std::min<size_t>(bytes, chunk_size);
346  memcpy(buf + offset, &val, to_copy);
347  offset += to_copy;
348  bytes -= to_copy;
349  }
350 
351  if (bytes) {
352  tc->getVirtProxy().readBlob(state.nsaa, buf, bytes);
353 
354  state.stackUsed = true;
355  state.nsaa += roundUp(bytes, 4);
356  state.ncrn = state.MAX_CRN + 1;
357  }
358 
359  return gtoh(*(Composite *)buf, ArmISA::byteOrder(tc));
360  }
361 
362  state.ncrn = state.MAX_CRN + 1;
363 
364  return loadFromStack<Composite>(tc, state);
365  }
366 };
367 
368 } // namespace GuestABI
369 
370 
371 /*
372  * VFP ABI variant.
373  */
374 
375 struct Aapcs32Vfp : public Aapcs32
376 {
377  struct State : public Aapcs32::State
378  {
379  bool variadic=false; // Whether this function is variadic.
380 
381  // Whether the various single and double precision registers have
382  // been allocated.
383  std::array<bool, 16> s;
384  std::array<bool, 8> d;
385 
386  explicit State(const ThreadContext *tc) : Aapcs32::State(tc)
387  {
388  s.fill(false);
389  d.fill(false);
390  }
391 
392  int
393  allocate(float, int count)
394  {
395  int last = 0;
396  for (int i = 0; i <= s.size() - count; i++) {
397  if (s[i]) {
398  last = i + 1;
399  continue;
400  }
401  if (i - last + 1 == count) {
402  for (int j = 0; j < count; j++) {
403  s[last + j] = true;
404  d[(last + j) / 2] = true;
405  }
406  return last;
407  }
408  }
409  s.fill(true);
410  d.fill(true);
411  return -1;
412  }
413 
414  int
415  allocate(double, int count)
416  {
417  int last = 0;
418  for (int i = 0; i <= d.size() - count; i++) {
419  if (d[i]) {
420  last = i + 1;
421  continue;
422  }
423  if (i - last + 1 == count) {
424  for (int j = 0; j < count; j++) {
425  d[last + j] = true;
426  s[(last + j) * 2] = true;
427  s[(last + j) * 2 + 1] = true;
428  }
429  return last;
430  }
431  }
432  s.fill(true);
433  d.fill(true);
434  return -1;
435  }
436  };
437 };
438 
439 namespace GuestABI
440 {
441 
442 /*
443  * Integer arguments and return values.
444  */
445 
446 template <typename Integer>
447 struct Result<Aapcs32Vfp, Integer, typename std::enable_if<
448  std::is_integral<Integer>::value>::type> : public Result<Aapcs32, Integer>
449 {};
450 
451 template <typename Integer>
452 struct Argument<Aapcs32Vfp, Integer, typename std::enable_if<
453  std::is_integral<Integer>::value>::type> :
454  public Argument<Aapcs32, Integer>
455 {};
456 
457 
458 /*
459  * Floating point arguments and return values.
460  */
461 
462 template <typename Float>
463 struct Result<Aapcs32Vfp, Float, typename std::enable_if<
464  std::is_floating_point<Float>::value>::type>
465 {
466  static void
467  store(ThreadContext *tc, const Float &f, Aapcs32Vfp::State &state)
468  {
469  if (state.variadic) {
470  storeResult<Aapcs32, Float>(tc, f, state);
471  return;
472  }
473 
474  RegId id(VecRegClass, 0);
475  auto reg = tc->readVecReg(id);
476  reg.laneView<Float, 0>() = f;
477  tc->setVecReg(id, reg);
478  };
479 };
480 
481 template <typename Float>
482 struct Argument<Aapcs32Vfp, Float, typename std::enable_if<
483  std::is_floating_point<Float>::value>::type> : public Aapcs32ArgumentBase
484 {
485  static Float
487  {
488  if (state.variadic)
489  return getArgument<Aapcs32, Float>(tc, state);
490 
491  const int index = state.allocate(Float{}, 1);
492 
493  if (index >= 0) {
494  constexpr int lane_per_reg = 16 / sizeof(Float);
495  const int reg = index / lane_per_reg;
496  const int lane = index % lane_per_reg;
497 
499  auto val = tc->readVecReg(id);
500  return val.laneView<Float>(lane);
501  }
502 
503  return loadFromStack<Float>(tc, state);
504  }
505 };
506 
507 
508 /*
509  * Composite arguments and return values which are not Homogeneous Aggregates.
510  */
511 
512 template <typename Composite>
513 struct Result<Aapcs32Vfp, Composite, typename std::enable_if<
514  IsAapcs32Composite<Composite>::value &&
515  !IsAapcs32HomogeneousAggregate<Composite>::value>::type> :
516  public Result<Aapcs32, Composite>
517 {};
518 
519 template <typename Composite>
520 struct Argument<Aapcs32Vfp, Composite, typename std::enable_if<
521  IsAapcs32Composite<Composite>::value &&
522  !IsAapcs32HomogeneousAggregate<Composite>::value>::type> :
523  public Argument<Aapcs32, Composite>
524 {};
525 
526 
527 /*
528  * Homogeneous Aggregate argument and return values.
529  */
530 
531 template <typename T>
532 struct Aapcs32ArrayType { using Type = void; };
533 
534 template <typename E, size_t N>
535 struct Aapcs32ArrayType<E[N]> { using Type = E; };
536 
537 template <typename HA>
538 struct Argument<Aapcs32Vfp, HA, typename std::enable_if<
539  IsAapcs32HomogeneousAggregate<HA>::value>::type> :
540  public Aapcs32ArgumentBase
541 {
542  static bool
544  {
545  using Elem = typename Aapcs32ArrayType<HA>::Type;
546  constexpr size_t Count = sizeof(HA) / sizeof(Elem);
547  return state.variadic || !std::is_floating_point<Elem>::value ||
548  Count > 4;
549  }
550 
551  static HA
553  {
554  using Elem = typename Aapcs32ArrayType<HA>::Type;
555  constexpr size_t Count = sizeof(HA) / sizeof(Elem);
556 
557  if (useBaseABI(state))
558  return getArgument<Aapcs32, HA>(tc, state);
559 
560  const int base = state.allocate(Elem{}, Count);
561  if (base >= 0) {
562  constexpr int lane_per_reg = 16 / sizeof(Elem);
563  HA ha;
564  for (int i = 0; i < Count; i++) {
565  const int index = base + i;
566  const int reg = index / lane_per_reg;
567  const int lane = index % lane_per_reg;
568 
570  auto val = tc->readVecReg(id);
571  ha[i] = val.laneView<Elem>(lane);
572  }
573  return ha;
574  }
575 
576  return loadFromStack<HA>(tc, state);
577  }
578 
579  static void
581  {
582  if (useBaseABI(state))
583  return Argument<Aapcs32, HA>::prepare(tc, state);
584  }
585 };
586 
587 template <typename HA>
588 struct Result<Aapcs32Vfp, HA,
589  typename std::enable_if<IsAapcs32HomogeneousAggregate<HA>::value>::type>
590 {
591  static bool
593  {
594  using Elem = typename Aapcs32ArrayType<HA>::Type;
595  constexpr size_t Count = sizeof(HA) / sizeof(Elem);
596  return state.variadic || !std::is_floating_point<Elem>::value ||
597  Count > 4;
598  }
599 
600  static HA
601  store(ThreadContext *tc, const HA &ha, Aapcs32Vfp::State &state)
602  {
603  using Elem = typename Aapcs32ArrayType<HA>::Type;
604  constexpr size_t Count = sizeof(HA) / sizeof(Elem);
605 
606  if (useBaseABI(state)) {
607  storeResult<Aapcs32, HA>(tc, ha, state);
608  return;
609  }
610 
611  constexpr int lane_per_reg = 16 / sizeof(Elem);
612  for (int i = 0; i < Count; i++) {
613  const int reg = i / lane_per_reg;
614  const int lane = i % lane_per_reg;
615 
617  auto val = tc->readVecReg(id);
618  val.laneView<Elem>(lane) = ha[i];
619  tc->setVecReg(id, val);
620  }
621  }
622 
623  static void
625  {
626  if (useBaseABI(state))
627  return Result<Aapcs32, HA>::prepare(tc, state);
628  }
629 };
630 
631 
632 /*
633  * Varargs
634  */
635 
636 template <typename ...Types>
637 struct Argument<Aapcs32Vfp, VarArgs<Types...>>
638 {
639  static VarArgs<Types...>
640  get(ThreadContext *tc, typename Aapcs32Vfp::State &state)
641  {
642  state.variadic = true;
643  return getArgument<Aapcs32, VarArgs<Types...>>(tc, state);
644  }
645 };
646 
647 } // namespace GuestABI
648 
649 #endif // __ARCH_ARM_AAPCS32_HH__
GuestABI::Aapcs32ArrayType< E[N]>::Type
E Type
Definition: aapcs32.hh:535
GuestABI::Aapcs32ArgumentBase
Definition: aapcs32.hh:100
GuestABI::IsAapcs32HomogeneousAggregate
Definition: aapcs32.hh:95
MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:44
GuestABI::enable_if< std::is_integral< Integer >::value &&(sizeof(Integer)<=sizeof(uint32_t)) >::type >::get
static Integer get(ThreadContext *tc, Aapcs32::State &state)
Definition: aapcs32.hh:184
GuestABI::Result< Aapcs32, Integer, typename std::enable_if< std::is_integral< Integer >::value &&(sizeof(Integer)==sizeof(uint64_t)) >::type >::store
static void store(ThreadContext *tc, const Integer &i)
Definition: aapcs32.hh:164
ArmISA::byteOrder
ByteOrder byteOrder(const ThreadContext *tc)
Definition: utility.hh:449
GuestABI::Argument< Aapcs32Vfp, Float, typename std::enable_if< std::is_floating_point< Float >::value >::type >::get
static Float get(ThreadContext *tc, Aapcs32Vfp::State &state)
Definition: aapcs32.hh:486
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
bitsToFloat32
static float bitsToFloat32(uint32_t val)
Definition: types.hh:198
Aapcs32Vfp::State::s
std::array< bool, 16 > s
Definition: aapcs32.hh:383
ConstProxyPtr
Definition: proxy_ptr.hh:106
GuestABI::Argument< Aapcs32, Composite, typename std::enable_if< IsAapcs32Composite< Composite >::value >::type >::get
static Composite get(ThreadContext *tc, Aapcs32::State &state)
Definition: aapcs32.hh:306
ProxyPtr
Definition: proxy_ptr.hh:236
GuestABI::Result< Aapcs32, Composite, typename std::enable_if< IsAapcs32Composite< Composite >::value >::type >::prepare
static void prepare(ThreadContext *tc, Aapcs32::State &state)
Definition: aapcs32.hh:293
ThreadContext::setVecReg
virtual void setVecReg(const RegId &reg, const VecRegContainer &val)=0
type
uint8_t type
Definition: inet.hh:421
ThreadContext::setIntReg
virtual void setIntReg(RegIndex reg_idx, RegVal val)=0
Aapcs32::State::MAX_CRN
static const int MAX_CRN
Definition: aapcs32.hh:56
Aapcs32Vfp::State::d
std::array< bool, 8 > d
Definition: aapcs32.hh:384
X86ISA::E
Bitfield< 31, 0 > E
Definition: int.hh:51
Aapcs32::State::ncrn
int ncrn
Definition: aapcs32.hh:52
X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
GuestABI::getArgument
static Arg getArgument(ThreadContext *tc, typename ABI::State &state)
Definition: layout.hh:179
proxy_ptr.hh
GuestABI::Argument::type >::get
static Integer get(ThreadContext *tc, Aapcs32::State &state)
Definition: aapcs32.hh:203
X86ISA::count
count
Definition: misc.hh:703
GuestABI::Argument< Aapcs32Vfp, HA, typename std::enable_if< IsAapcs32HomogeneousAggregate< HA >::value >::type >::useBaseABI
static bool useBaseABI(Aapcs32Vfp::State &state)
Definition: aapcs32.hh:543
Aapcs32::State::State
State(const ThreadContext *tc)
Definition: aapcs32.hh:60
ArmISA
Definition: ccregs.hh:41
X86ISA::reg
Bitfield< 5, 3 > reg
Definition: types.hh:87
GuestABI::IsAapcs32Composite
Definition: aapcs32.hh:74
GuestABI::Aapcs32HomogeneousAggregate
T[count] Aapcs32HomogeneousAggregate
Definition: aapcs32.hh:92
Aapcs32::State::nsaa
Addr nsaa
Definition: aapcs32.hh:53
sc_dt::align
void align(const scfx_rep &lhs, const scfx_rep &rhs, int &new_wp, int &len_mant, scfx_mant_ref &lhs_mant, scfx_mant_ref &rhs_mant)
Definition: scfx_rep.cc:2083
Aapcs32::State
Definition: aapcs32.hh:48
RegId
Register ID: describe an architectural register with its class and index.
Definition: reg_class.hh:75
ArmISA::INTREG_SPX
@ INTREG_SPX
Definition: intregs.hh:160
ArmISA::j
Bitfield< 24 > j
Definition: miscregs_types.hh:54
cp
Definition: cprintf.cc:40
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
ArmISA::INTREG_R0
@ INTREG_R0
Definition: intregs.hh:54
Aapcs32Vfp::State::State
State(const ThreadContext *tc)
Definition: aapcs32.hh:386
GuestABI::Result< Aapcs32, Integer, typename std::enable_if< std::is_integral< Integer >::value &&(sizeof(Integer)==sizeof(uint32_t)) >::type >::store
static void store(ThreadContext *tc, const Integer &i)
Definition: aapcs32.hh:152
GuestABI::Result< Aapcs32, Composite, typename std::enable_if< IsAapcs32Composite< Composite >::value >::type >::store
static void store(ThreadContext *tc, const Composite &composite, Aapcs32::State &state)
Definition: aapcs32.hh:277
GuestABI::VarArgs
Definition: varargs.hh:146
GuestABI
Definition: aapcs32.hh:66
Aapcs32::State::retAddr
Addr retAddr
Definition: aapcs32.hh:58
ArmISA::INTREG_R1
@ INTREG_R1
Definition: intregs.hh:55
htog
T htog(T value, ByteOrder guest_byte_order)
Definition: byteswap.hh:155
GuestABI::Argument< Aapcs32Vfp, VarArgs< Types... > >::get
static VarArgs< Types... > get(ThreadContext *tc, typename Aapcs32Vfp::State &state)
Definition: aapcs32.hh:640
GuestABI::Argument
Definition: definition.hh:93
port_proxy.hh
Aapcs32Vfp::State::allocate
int allocate(double, int count)
Definition: aapcs32.hh:415
GuestABI::Argument< Aapcs32, Float, typename std::enable_if< std::is_floating_point< Float >::value >::type >::get
static Float get(ThreadContext *tc, Aapcs32::State &state)
Definition: aapcs32.hh:255
Aapcs32
Definition: aapcs32.hh:46
ThreadContext::readVecReg
virtual const VecRegContainer & readVecReg(const RegId &reg) const =0
intregs.hh
GuestABI::Result< Aapcs32Vfp, HA, typename std::enable_if< IsAapcs32HomogeneousAggregate< HA >::value >::type >::prepare
static void prepare(ThreadContext *tc, Aapcs32Vfp::State &state)
Definition: aapcs32.hh:624
GuestABI::Aapcs32ArrayType
Definition: aapcs32.hh:532
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
bitsToFloat64
static double bitsToFloat64(uint64_t val)
Definition: types.hh:210
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
Aapcs32::State::stackUsed
bool stackUsed
Definition: aapcs32.hh:50
Aapcs32Vfp::State::allocate
int allocate(float, int count)
Definition: aapcs32.hh:393
GuestABI::Result< Aapcs32Vfp, HA, typename std::enable_if< IsAapcs32HomogeneousAggregate< HA >::value >::type >::store
static HA store(ThreadContext *tc, const HA &ha, Aapcs32Vfp::State &state)
Definition: aapcs32.hh:601
utility.hh
GuestABI::Result< Aapcs32, Float, typename std::enable_if< std::is_floating_point< Float >::value >::type >::store
static void store(ThreadContext *tc, const Float &f, Aapcs32::State &state)
Definition: aapcs32.hh:243
ThreadContext::getVirtProxy
virtual PortProxy & getVirtProxy()=0
Aapcs32Vfp::State::variadic
bool variadic
Definition: aapcs32.hh:379
VecRegClass
@ VecRegClass
Vector Register.
Definition: reg_class.hh:56
ArmISA::ha
Bitfield< 39 > ha
Definition: miscregs_types.hh:538
GuestABI::Result
Definition: definition.hh:58
std
Overload hash function for BasicBlockRange type.
Definition: vec_reg.hh:587
GuestABI::Argument< Aapcs32Vfp, HA, typename std::enable_if< IsAapcs32HomogeneousAggregate< HA >::value >::type >::prepare
static void prepare(ThreadContext *tc, Aapcs32Vfp::State &state)
Definition: aapcs32.hh:580
roundUp
T roundUp(const T &val, const U &align)
This function is used to align addresses in memory.
Definition: intmath.hh:131
guest_abi.hh
GuestABI::Result< Aapcs32Vfp, Float, typename std::enable_if< std::is_floating_point< Float >::value >::type >::store
static void store(ThreadContext *tc, const Float &f, Aapcs32Vfp::State &state)
Definition: aapcs32.hh:467
gtoh
T gtoh(T value, ByteOrder guest_byte_order)
Definition: byteswap.hh:162
intmath.hh
ThreadContext::readIntReg
virtual RegVal readIntReg(RegIndex reg_idx) const =0
GuestABI::Result< Aapcs32Vfp, HA, typename std::enable_if< IsAapcs32HomogeneousAggregate< HA >::value >::type >::useBaseABI
static bool useBaseABI(Aapcs32Vfp::State &state)
Definition: aapcs32.hh:592
GuestABI::Argument< Aapcs32Vfp, HA, typename std::enable_if< IsAapcs32HomogeneousAggregate< HA >::value >::type >::get
static HA get(ThreadContext *tc, Aapcs32Vfp::State &state)
Definition: aapcs32.hh:552
floatToBits
static uint64_t floatToBits(double val)
Definition: types.hh:194
GuestABI::enable_if< std::is_integral< Integer >::value &&(sizeof(Integer)< sizeof(uint32_t)) >::type >::store
static void store(ThreadContext *tc, const Integer &i)
Definition: aapcs32.hh:138
PortProxy::readBlob
void readBlob(Addr addr, void *p, int size) const
Higher level interfaces based on the above.
Definition: port_proxy.hh:177
GuestABI::Aapcs32ArgumentBase::loadFromStack
static T loadFromStack(ThreadContext *tc, Aapcs32::State &state)
Definition: aapcs32.hh:104
thread_context.hh
ArmISA::mask
Bitfield< 28, 24 > mask
Definition: miscregs_types.hh:711
ArmISA::id
Bitfield< 33 > id
Definition: miscregs_types.hh:247
GuestABI::Aapcs32ArrayType::Type
void Type
Definition: aapcs32.hh:532
Aapcs32Vfp
Definition: aapcs32.hh:375
ArmISA::f
Bitfield< 6 > f
Definition: miscregs_types.hh:64
ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:153
Aapcs32Vfp::State
Definition: aapcs32.hh:377

Generated on Wed Sep 30 2020 14:01:58 for gem5 by doxygen 1.8.17