#define _MIPSNN_SHIFT(reg) __MIPSNN_SHIFT(reg)
#define __MIPSNN_SHIFT(reg) MIPSNN_ ## reg ## _SHIFT
#define _MIPSNN_MASK(reg) __MIPSNN_MASK(reg)
#define __MIPSNN_MASK(reg) MIPSNN_ ## reg ## _MASK
#define MIPSNN_GET(reg, x) \
((unsigned)((x) & _MIPSNN_MASK(reg)) >> _MIPSNN_SHIFT(reg))
#define MIPSNN_PUT(reg, val) \
(((x) << _MIPSNN_SHIFT(reg)) & _MIPSNN_MASK(reg))
#define MIPSNN_CFG_M 0x80000000
#define MIPSNN_CFG_BE 0x00008000
#define MIPSNN_CFG_AT_MASK 0x00006000
#define MIPSNN_CFG_AT_SHIFT 13
#define MIPSNN_CFG_AT_MIPS32 0
#define MIPSNN_CFG_AT_MIPS64S 1
#define MIPSNN_CFG_AT_MIPS64 2
#define MIPSNN_CFG_AR_MASK 0x00001c00
#define MIPSNN_CFG_AR_SHIFT 10
#define MIPSNN_CFG_AR_REV1 0
#define MIPSNN_CFG_AR_REV2 1
#define MIPSNN_CFG_MT_MASK 0x00000380
#define MIPSNN_CFG_MT_SHIFT 7
#define MIPSNN_CFG_MT_NONE 0
#define MIPSNN_CFG_MT_TLB 1
#define MIPSNN_CFG_MT_BAT 2
#define MIPSNN_CFG_MT_FIXED 3
#define MIPSNN_CFG_VI 0x00000008
#define MIPSNN_CFG_K0_MASK 0x00000007
#define MIPSNN_CFG_K0_SHIFT 0
#define MIPSNN_CFG1_M 0x80000000
#define MIPSNN_CFG1_MS_MASK 0x7e000000
#define MIPSNN_CFG1_MS_SHIFT 25
#define MIPSNN_CFG1_MS(x) (MIPSNN_GET(CFG1_MS, (x)) + 1)
#define MIPSNN_CFG1_IS_MASK 0x01c00000
#define MIPSNN_CFG1_IS_SHIFT 22
#define MIPSNN_CFG1_IS_RSVD 7
#define MIPSNN_CFG1_IS(x) (64 << MIPSNN_GET(CFG1_IS, (x)))
#define MIPSNN_CFG1_IL_MASK 0x00380000
#define MIPSNN_CFG1_IL_SHIFT 19
#define MIPSNN_CFG1_IL_NONE 0
#define MIPSNN_CFG1_IL_RSVD 7
#define MIPSNN_CFG1_IL(x) (2 << MIPSNN_GET(CFG1_IL, (x)))
#define MIPSNN_CFG1_IA_MASK 0x00070000
#define MIPSNN_CFG1_IA_SHIFT 16
#define MIPSNN_CFG1_IA(x) MIPSNN_GET(CFG1_IA, (x))
#define MIPSNN_CFG1_DS_MASK 0x0000e000
#define MIPSNN_CFG1_DS_SHIFT 13
#define MIPSNN_CFG1_DS_RSVD 7
#define MIPSNN_CFG1_DS(x) (64 << MIPSNN_GET(CFG1_DS, (x)))
#define MIPSNN_CFG1_DL_MASK 0x00001c00
#define MIPSNN_CFG1_DL_SHIFT 10
#define MIPSNN_CFG1_DL_NONE 0
#define MIPSNN_CFG1_DL_RSVD 7
#define MIPSNN_CFG1_DL(x) (2 << MIPSNN_GET(CFG1_DL, (x)))
#define MIPSNN_CFG1_DA_MASK 0x00000380
#define MIPSNN_CFG1_DA_SHIFT 7
#define MIPSNN_CFG1_DA(x) MIPSNN_GET(CFG1_DA, (x))
#define MIPSNN_CFG1_C2 0x00000040
#define MIPSNN_CFG1_MD 0x00000020
#define MIPSNN_CFG1_PC 0x00000010
#define MIPSNN_CFG1_WR 0x00000008
#define MIPSNN_CFG1_CA 0x00000004
#define MIPSNN_CFG1_EP 0x00000002
#define MIPSNN_CFG1_FP 0x00000001
#define MIPSNN_CFG2_M 0x80000000
#define MIPSNN_CFG2_TU_MASK 0x70000000
#define MIPSNN_CFG2_TU_SHIFT 28
#define MIPSNN_CFG2_TS_MASK 0x07000000
#define MIPSNN_CFG2_TS_SHIFT 24
#define MIPSNN_CFG2_TS(x) (64 << MIPSNN_GET(CFG2_TS, (x)))
#define MIPSNN_CFG2_TL_MASK 0x00700000
#define MIPSNN_CFG2_TL_SHIFT 20
#define MIPSNN_CFG2_TL_NONE 0
#define MIPSNN_CFG2_TL(x) (2 << MIPSNN_GET(CFG2_TL, (x)))
#define MIPSNN_CFG2_TA_MASK 0x00070000
#define MIPSNN_CFG2_TA_SHIFT 16
#define MIPSNN_CFG2_TA(x) MIPSNN_GET(CFG2_TA, (x))
#define MIPSNN_CFG2_SU_MASK 0x0000f000
#define MIPSNN_CFG2_SU_SHIFT 12
#define MIPSNN_CFG2_SS_MASK 0x00000700
#define MIPSNN_CFG2_SS_SHIFT 8
#define MIPSNN_CFG2_SS(x) (64 << MIPSNN_GET(CFG2_SS, (x)))
#define MIPSNN_CFG2_SL_MASK 0x00000070
#define MIPSNN_CFG2_SL_SHIFT 4
#define MIPSNN_CFG2_SL_NONE 0
#define MIPSNN_CFG2_SL(x) (2 << MIPSNN_GET(CFG2_SL, (x)))
#define MIPSNN_CFG2_SA_MASK 0x00000007
#define MIPSNN_CFG2_SA_SHIFT 0
#define MIPSNN_CFG2_SA(x) MIPSNN_GET(CFG2_SA, (x))
#define MIPSNN_CFG3_M 0x80000000
#define MIPSNN_CFG3_BPG 0x40000000
#define MIPSNN_CFG3_CMGCR 0x20000000
#define MIPSNN_CFG3_IPLW_MASK 0x00600000
#define MIPSNN_CFG3_IPLW_SHIFT 21
#define MIPSNN_CFG3_IPLW_6BITS 0
#define MIPSNN_CFG3_IPLW_8BITS 1
#define MIPSNN_CFG3_MMAR_MASK 0x001c0000
#define MIPSNN_CFG3_MMAR_SHIFT 18
#define MIPSNN_CFG3_MMAR_REV1 0
#define MIPSNN_CFG3_MCU 0x00020000
#define MIPSNN_CFG3_ISAOnExc 0x00010000
#define MIPSNN_CFG3_ISA_MASK 0x0000c000
#define MIPSNN_CFG3_ISA_SHIFT 14
#define MIPSNN_CFG3_ISA_MIPS64 0
#define MIPSNN_CFG3_ISA_microMIPS64 1
#define MIPSNN_CFG3_ISA_MIPS64_OOR 2
#define MIPSNN_CFG3_ISA_microMIPS64_OOR 3
#define MIPSNN_CFG3_ULRI 0x00002000
#define MIPSNN_CFG3_DSP2P 0x00000800
#define MIPSNN_CFG3_DSPP 0x00000400
#define MIPSNN_CFG3_LPA 0x00000080
#define MIPSNN_CFG3_VEIC 0x00000040
#define MIPSNN_CFG3_VINT 0x00000020
#define MIPSNN_CFG3_SP 0x00000010
#define MIPSNN_CFG3_MT 0x00000004
#define MIPSNN_CFG3_SM 0x00000002
#define MIPSNN_CFG3_TL 0x00000001
#define MIPSNN_CFG4_M __BIT(31)
#define MIPSNN_CFG4_IE __BITS(30,29)
#define MIPSNN_CFG4_AE __BIT(28)
#define MIPSNN_CFG4_VTLB_SE __BITS(27,24)
#define MIPSNN_CFG4_KSCR_EXIST __BITS(23,16)
#define MIPSNN_CFG4_MMU_EXT_DEF __BITS(15,14)
#define MIPSNN_CFG4_MMU_EXT_DEF_MMU 1
#define MIPSNN_CFG4_MMU_EXT_DEF_FLTB 2
#define MIPSNN_CFG4_MMU_EXT_DEF_VTLB 3
#define MIPSNN_CFG4_MMU_SIZE_EXT __BITS(7,0)
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE __BITS(10,8)
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_1K 0
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_4K 1
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_16K 2
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_64K 3
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_256K 4
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_1G 5
#define MIPSNN_CFG4_FTLB_FTLB_PAGE_SIZE_4G 6
#define MIPSNN_CFG4_FTLB_FTLB_WAYS __BITS(7,4)
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_2 0
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_3 1
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_4 2
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_5 3
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_6 4
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_7 5
#define MIPSNN_CFG4_FTLB_FTLB_WAYS_8 6
#define MIPSNN_CFG4_FTLB_FTLB_SETS __BITS(3,0)
#define MIPSNN_CFG4_FTLB_FTLB_SETS_1 0
#define MIPSNN_CFG4_FTLB_FTLB_SETS_2 1
#define MIPSNN_CFG4_FTLB_FTLB_SETS_4 2
#define MIPSNN_CFG4_FTLB_FTLB_SETS_8 3
#define MIPSNN_CFG4_FTLB_FTLB_SETS_16 4
#define MIPSNN_CFG4_FTLB_FTLB_SETS_32 5
#define MIPSNN_CFG4_FTLB_FTLB_SETS_64 6
#define MIPSNN_CFG4_FTLB_FTLB_SETS_128 7
#define MIPSNN_CFG4_FTLB_FTLB_SETS_256 8
#define MIPSNN_CFG4_FTLB_FTLB_SETS_512 9
#define MIPSNN_CFG4_FTLB_FTLB_SETS_1024 10
#define MIPSNN_CFG4_FTLB_FTLB_SETS_2048 11
#define MIPSNN_CFG4_FTLB_FTLB_SETS_4096 12
#define MIPSNN_CFG4_FTLB_FTLB_SETS_8192 13
#define MIPSNN_CFG4_FTLB_FTLB_SETS_16384 14
#define MIPSNN_CFG4_FTLB_FTLB_SETS_32768 15
#define MIPSNN_CFG4_FVTLB_VTLB_SIZE_EXT __BITS(27,24)
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE __BITS(12,8)
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_1K 0
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_4K 1
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_16K 2
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_64K 3
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_256K 4
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_1M 5
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_4M 6
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_16M 7
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_64M 8
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_256M 9
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_1G 10
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_4G 11
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_16G 12
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_64G 13
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_256G 14
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_1T 15
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_4T 16
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_16T 17
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_64T 18
#define MIPSNN_CFG4_FVTLB_FTLB_PAGE_SIZE_256T 19
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS __BITS(7,4)
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_2 0
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_3 1
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_4 2
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_5 3
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_6 4
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_7 5
#define MIPSNN_CFG4_FVTLB_FTLB_WAYS_8 6
#define MIPSNN_CFG4_FVTLB_FTLB_SETS __BITS(3,0)
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_1 0
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_2 1
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_4 2
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_8 3
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_16 4
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_32 5
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_64 6
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_128 7
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_256 8
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_512 9
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_1024 10
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_2048 11
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_4096 12
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_8192 13
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_16384 14
#define MIPSNN_CFG4_FVTLB_FTLB_SETS_32768 15
#define MIPSNN_CFG5_M __BIT(31)
#define MIPSNN_CFG5_K __BIT(30)
#define MIPSNN_CFG5_CV __BIT(29)
#define MIPSNN_CFG5_EVA __BIT(28)
#define MIPSNN_CFG5_MSAEn __BIT(27)
#define MIPSNN_CFG5_XNP __BIT(13)
#define MIPSNN_CFG5_DEC __BIT(11)
#define MIPSNN_CFG5_L2C __BIT(10)
#define MIPSNN_CFG5_UFE __BIT(9)
#define MIPSNN_CFG5_FRE __BIT(8)
#define MIPSNN_CFG5_VP __BIT(7)
#define MIPSNN_CFG5_SBRI __BIT(6)
#define MIPSNN_CFG5_MVH __BIT(5)
#define MIPSNN_CFG5_LLB __BIT(4)
#define MIPSNN_CFG5_MRP __BIT(3)
#define MIPSNN_CFG5_UFR __BIT(2)
#define MIPSNN_CFG5_NF_EXISTS __BIT(0)
#define MIPSNN_PERFCTL_M __BIT(31)
#define MIPSNN_PERFCTL_W __BIT(30)
#define MIPSNN_PERFCTL_IMPL __BITS(29,25)
#define MIPSNN_PERFCTL_EC __BITS(24,23)
#define MIPSNN_PERFCTL_PCTD __BIT(15)
#define MIPSNN_PERFCTL_EVENT __BITS(14,5)
#define MIPSNN_PERFCTL_IE __BIT(4)
#define MIPSNN_PERFCTL_U __BIT(3)
#define MIPSNN_PERFCTL_S __BIT(2)
#define MIPSNN_PERFCTL_K __BIT(1)
#define MIPSNN_PERFCTL_EXL __BIT(0)
#define MIPSNN_RMIXLP_CFG6_CTLB_SIZE_MASK 0xffff0000
#define MIPSNN_RMIXLP_CFG6_CTLB_SIZE_SHIFT 16
#define MIPSNN_RMIXLP_CFG6_VTLB_SIZE_MASK 0x0000ffc0
#define MIPSNN_RMIXLP_CFG6_VTLB_SIZE_SHIFT 6
#define MIPSNN_RMIXLP_CFG6_ELVT 0x00000020
#define MIPSNN_RMIXLP_CFG6_EPW 0x00000008
#define MIPSNN_RMIXLP_CFG6_EFT 0x00000004
#define MIPSNN_RMIXLP_CFG6_PWI 0x00000001
#define MIPSNN_RMIXLP_CFG6_FTI 0x00000001
#define MIPSNN_RMIXLP_CFG7_LG_MASK __BIT(61)
#define MIPSNN_RMIXLP_CFG7_MASKLG_MASK 0x0000ff00
#define MIPSNN_RMIXLP_CFG7_MASKLG_SHIFT 8
#define MIPSNN_RMIXLP_CFG7_MASKLG_4KB (0xff >> 8)
#define MIPSNN_RMIXLP_CFG7_MASKLG_16KB (0xff >> 7)
#define MIPSNN_RMIXLP_CFG7_MASKLG_64KB (0xff >> 6)
#define MIPSNN_RMIXLP_CFG7_MASKLG_256KB (0xff >> 5)
#define MIPSNN_RMIXLP_CFG7_MASKLG_1MB (0xff >> 4)
#define MIPSNN_RMIXLP_CFG7_MASKLG_4MB (0xff >> 3)
#define MIPSNN_RMIXLP_CFG7_MASKLG_16MB (0xff >> 2)
#define MIPSNN_RMIXLP_CFG7_MASKLG_64MB (0xff >> 1)
#define MIPSNN_RMIXLP_CFG7_MASKLG_256MB (0xff >> 0)
#define MIPSNN_RMIXLP_CFG7_MASKSM_MASK 0x000000ff
#define MIPSNN_RMIXLP_CFG7_MASKSM_SHIFT 0
#define MIPSNN_RMIXLP_CFG7_MASKSM_4KB (0xff >> 8)
#define MIPSNN_RMIXLP_CFG7_MASKSM_16KB (0xff >> 7)
#define MIPSNN_RMIXLP_CFG7_MASKSM_64KB (0xff >> 6)
#define MIPSNN_RMIXLP_CFG7_MASKSM_256KB (0xff >> 5)
#define MIPSNN_RMIXLP_CFG7_MASKSM_1MB (0xff >> 4)
#define MIPSNN_RMIXLP_CFG7_MASKSM_4MB (0xff >> 3)
#define MIPSNN_RMIXLP_CFG7_MASKSM_16MB (0xff >> 2)
#define MIPSNN_RMIXLP_CFG7_MASKSM_64MB (0xff >> 1)
#define MIPSNN_RMIXLP_CFG7_MASKSM_256MB (0xff >> 0)
#define MIPSNN_MTI_CFG6_SPCD __BIT(14)
#define MIPSNN_MTI_CFG6_SYND __BIT(13)
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_MASK __BIT(12:10)
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_STALL 0
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_JUMP 1
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_STALLED_INSN 2
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_CACHE_MISPREDICTION 3
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_CACHE_PREDICTION 4
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_BAD_JR_CACHE_ENTRY 5
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_UNIMPL 6
#define MIPSNN_MTI_CFG6_IFU_PERF_CTL_CBRACH_TAKEN 7
#define MIPSNN_MTI_CFG6_NMRUP __BIT(9)
#define MIPSNN_MTI_CFG6_NMRUD __BIT(8)
#define MIPSNN_MTI_CFG6_JRCP __BIT(1)
#define MIPSNN_MTI_CFG6_JRCD __BIT(0)
#define MIPSNN_MTI_CFG7_WII __BIT(31)
#define MIPSNN_MTI_CFG7_FPFS __BIT(30)
#define MIPSNN_MTI_CFG7_IHB __BIT(29)
#define MIPSNN_MTI_CFG7_FPR1 __BIT(28)
#define MIPSNN_MTI_CFG7_SEHB __BIT(27)
#define MIPSNN_MTI_CFG7_CP2IO __BIT(26)
#define MIPSNN_MTI_CFG7_IAGN __BIT(25)
#define MIPSNN_MTI_CFG7_IAGN __BIT(25)
#define MIPSNN_MTI_CFG7_IALU __BIT(24)
#define MIPSNN_MTI_CFG7_DGHR __BIT(23)
#define MIPSNN_MTI_CFG7_SG __BIT(22)
#define MIPSNN_MTI_CFG7_SUI __BIT(21)
#define MIPSNN_MTI_CFG7_NCWB __BIT(20)
#define MIPSNN_MTI_CFG7_PCT __BIT(19)
#define MIPSNN_MTI_CFG7_HCI __BIT(18)
#define MIPSNN_MTI_CFG7_FPR0 __BIT(17)
#define MIPSNN_MTI_CFG7_FPR_MASK (MIPSNN_MTI_CFG7_FPR1|MIPSNN_MTI_CFG7_FPR0)
#define MIPSNN_MTI_CFG7_FPR_SHIFT 0
#define MIPSNN_MTI_CFG7_FPR_1to1 0
#define MIPSNN_MTI_CFG7_FPR_2to1 MIPSNN_MTI_CFG7_FPR0
#define MIPSNN_MTI_CFG7_FPR_3to2 MIPSNN_MTI_CFG7_FPR1
#define MIPSNN_MTI_CFG7_FPR_RESERVED MIPSNN_MTI_CFG7_FPR_MASK
#define MIPSNN_MTI_CFG7_AR __BIT(16)
#define MIPSNN_MTI_CFG7_PREF_MASK __BITS(12,11)
#define MIPSNN_MTI_CFG7_PREF_SHIFT 11
#define MIPSNN_MTI_CFG7_PREF_DISABLE 0
#define MIPSNN_MTI_CFG7_PREF_ONELINE 1
#define MIPSNN_MTI_CFG7_PREF_RESERVED 2
#define MIPSNN_MTI_CFG7_PREF_TWOLINES 3
#define MIPSNN_MTI_CFG7_IAR __BIT(10)
#define MIPSNN_MTI_CFG7_IVA __BIT(9)
#define MIPSNN_MTI_CFG7_ES __BIT(8)
#define MIPSNN_MTI_CFG7_BTLM __BIT(7)
#define MIPSNN_MTI_CFG7_CPOOO __BIT(6)
#define MIPSNN_MTI_CFG7_NBLSU __BIT(5)
#define MIPSNN_MTI_CFG7_UBL __BIT(4)
#define MIPSNN_MTI_CFG7_BP __BIT(3)
#define MIPSNN_MTI_CFG7_RPS __BIT(2)
#define MIPSNN_MTI_CFG7_BHT __BIT(1)
#define MIPSNN_MTI_CFG7_SL __BIT(0)