43 #ifndef __ARCH_ARM_REGS_INT_HH__
44 #define __ARCH_ARM_REGS_INT_HH__
60 SignedBitfield<31, 16>
sh1;
61 SignedBitfield<15, 0>
sh0;
63 SignedBitfield<31, 0>
sw;
163 inline constexpr
RegId
252 inline constexpr
auto
416 const RegMap Reg64Map = {
418 R8Usr, R9Usr, R10Usr, R11Usr, R12Usr, R13Usr, R14Usr, R13Hyp,
419 R14Irq, R13Irq, R14Svc, R13Svc, R14Abt, R13Abt, R14Und, R13Und,
420 R8Fiq, R9Fiq, R10Fiq, R11Fiq, R12Fiq, R13Fiq, R14Fiq,
Zero
430 const RegMap RegUsrMap = {
431 R0Usr, R1Usr, R2Usr, R3Usr, R4Usr, R5Usr, R6Usr, R7Usr,
432 R8Usr, R9Usr, R10Usr, R11Usr, R12Usr, R13Usr, R14Usr, R15Usr,
437 static inline const RegId &
441 return RegUsrMap[
index];
444 const RegMap RegHypMap = {
445 R0Hyp, R1Hyp, R2Hyp, R3Hyp, R4Hyp, R5Hyp, R6Hyp, R7Hyp,
446 R8Hyp, R9Hyp, R10Hyp, R11Hyp, R12Hyp, R13Hyp, R14Hyp, R15Hyp,
451 static inline const RegId &
455 return RegHypMap[
index];
458 const RegMap RegSvcMap = {
459 R0Svc, R1Svc, R2Svc, R3Svc, R4Svc, R5Svc, R6Svc, R7Svc,
460 R8Svc, R9Svc, R10Svc, R11Svc, R12Svc, R13Svc, R14Svc, R15Svc,
465 static inline const RegId &
469 return RegSvcMap[
index];
472 const RegMap RegMonMap = {
473 R0Mon, R1Mon, R2Mon, R3Mon, R4Mon, R5Mon, R6Mon, R7Mon,
474 R8Mon, R9Mon, R10Mon, R11Mon, R12Mon, R13Mon, R14Mon, R15Mon,
479 static inline const RegId &
483 return RegMonMap[
index];
486 const RegMap RegAbtMap = {
487 R0Abt, R1Abt, R2Abt, R3Abt, R4Abt, R5Abt, R6Abt, R7Abt,
488 R8Abt, R9Abt, R10Abt, R11Abt, R12Abt, R13Abt, R14Abt, R15Abt,
493 static inline const RegId &
497 return RegAbtMap[
index];
500 const RegMap RegUndMap = {
501 R0Und, R1Und, R2Und, R3Und, R4Und, R5Und, R6Und, R7Und,
502 R8Und, R9Und, R10Und, R11Und, R12Und, R13Und, R14Und, R15Und,
507 static inline const RegId &
511 return RegUndMap[
index];
514 const RegMap RegIrqMap = {
515 R0Irq, R1Irq, R2Irq, R3Irq, R4Irq, R5Irq, R6Irq, R7Irq,
516 R8Irq, R9Irq, R10Irq, R11Irq, R12Irq, R13Irq, R14Irq, R15Irq,
521 static inline const RegId &
525 return RegIrqMap[
index];
528 const RegMap RegFiqMap = {
529 R0Fiq, R1Fiq, R2Fiq, R3Fiq, R4Fiq, R5Fiq, R6Fiq, R7Fiq,
530 R8Fiq, R9Fiq, R10Fiq, R11Fiq, R12Fiq, R13Fiq, R14Fiq, R15Fiq,
535 static inline const RegId &
539 return RegFiqMap[
index];
542 static const unsigned regsPerMode =
NumRegs;
548 return mode * regsPerMode +
reg;
556 int mode =
reg / int_reg::regsPerMode;
557 reg =
reg % int_reg::regsPerMode;
567 return int_reg::svc(
reg);
569 return int_reg::mon(
reg);
571 return int_reg::abt(
reg);
573 return int_reg::hyp(
reg);
575 return int_reg::und(
reg);
577 panic(
"%d: Flattening into an unknown mode: reg:%#x mode:%#x\n",
586 if (
reg == int_reg::X31)
594 return (
reg == int_reg::X31 ||
reg == int_reg::Spx);
600 return reg == int_reg::Spx;
618 if (
reg == int_reg::X31)
626 inline constexpr
auto