@@ -37,7 +37,8 @@ enum PartialMappingIdx {
37
37
PMI_FirstGPR = PMI_GPR32,
38
38
PMI_LastGPR = PMI_GPR64,
39
39
PMI_FirstFPR = PMI_FPR32,
40
- PMI_LastFPR = PMI_FPR512
40
+ PMI_LastFPR = PMI_FPR512,
41
+ PMI_Min = PMI_FirstGPR,
41
42
};
42
43
43
44
static unsigned getRegBankBaseIdxOffset (unsigned Size) {
@@ -76,34 +77,53 @@ enum ValueMappingIdx {
76
77
};
77
78
78
79
// ValueMappings.
79
- RegisterBankInfo::ValueMapping ValMappings[] {
80
- /* BreakDown, NumBreakDowns */
81
- // 3-operands instructions (all binary operations should end up with one of
82
- // those mapping).
83
- // 0: GPR 32-bit value. <-- This must match First3OpsIdx.
84
- {&PartMappings[0 ], 1 }, {&PartMappings[0 ], 1 }, {&PartMappings[0 ], 1 },
85
- // 3: GPR 64-bit value.
86
- {&PartMappings[1 ], 1 }, {&PartMappings[1 ], 1 }, {&PartMappings[1 ], 1 },
87
- // 6: FPR 32-bit value.
88
- {&PartMappings[2 ], 1 }, {&PartMappings[2 ], 1 }, {&PartMappings[2 ], 1 },
89
- // 9: FPR 64-bit value.
90
- {&PartMappings[3 ], 1 }, {&PartMappings[3 ], 1 }, {&PartMappings[3 ], 1 },
91
- // 12: FPR 128-bit value.
92
- {&PartMappings[4 ], 1 }, {&PartMappings[4 ], 1 }, {&PartMappings[4 ], 1 },
93
- // 15: FPR 256-bit value.
94
- {&PartMappings[5 ], 1 }, {&PartMappings[5 ], 1 }, {&PartMappings[5 ], 1 },
95
- // 18: FPR 512-bit value. <-- This must match Last3OpsIdx.
96
- {&PartMappings[6 ], 1 }, {&PartMappings[6 ], 1 }, {&PartMappings[6 ], 1 },
97
- // Cross register bank copies.
98
- // 21: GPR 32-bit value to FPR 32-bit value. <-- This must match FirstCrossRegCpyIdx.
99
- {&PartMappings[0 ], 1 }, {&PartMappings[2 ], 1 },
100
- // 23: GPR 64-bit value to FPR 64-bit value.
101
- {&PartMappings[1 ], 1 }, {&PartMappings[3 ], 1 },
102
- // 25: FPR 32-bit value to GPR 32-bit value.
103
- {&PartMappings[2 ], 1 }, {&PartMappings[0 ], 1 },
104
- // 27: FPR 64-bit value to GPR 64-bit value. <-- This must match LastCrossRegCpyIdx.
105
- {&PartMappings[3 ], 1 }, {&PartMappings[1 ], 1 }
106
-
80
+ RegisterBankInfo::ValueMapping ValMappings[]{
81
+ /* BreakDown, NumBreakDowns */
82
+ // 3-operands instructions (all binary operations should end up with one of
83
+ // those mapping).
84
+ // 0: GPR 32-bit value. <-- This must match First3OpsIdx.
85
+ {&PartMappings[PMI_GPR32 - PMI_Min], 1 },
86
+ {&PartMappings[PMI_GPR32 - PMI_Min], 1 },
87
+ {&PartMappings[PMI_GPR32 - PMI_Min], 1 },
88
+ // 3: GPR 64-bit value.
89
+ {&PartMappings[PMI_GPR64 - PMI_Min], 1 },
90
+ {&PartMappings[PMI_GPR64 - PMI_Min], 1 },
91
+ {&PartMappings[PMI_GPR64 - PMI_Min], 1 },
92
+ // 6: FPR 32-bit value.
93
+ {&PartMappings[PMI_FPR32 - PMI_Min], 1 },
94
+ {&PartMappings[PMI_FPR32 - PMI_Min], 1 },
95
+ {&PartMappings[PMI_FPR32 - PMI_Min], 1 },
96
+ // 9: FPR 64-bit value.
97
+ {&PartMappings[PMI_FPR64 - PMI_Min], 1 },
98
+ {&PartMappings[PMI_FPR64 - PMI_Min], 1 },
99
+ {&PartMappings[PMI_FPR64 - PMI_Min], 1 },
100
+ // 12: FPR 128-bit value.
101
+ {&PartMappings[PMI_FPR128 - PMI_Min], 1 },
102
+ {&PartMappings[PMI_FPR128 - PMI_Min], 1 },
103
+ {&PartMappings[PMI_FPR128 - PMI_Min], 1 },
104
+ // 15: FPR 256-bit value.
105
+ {&PartMappings[PMI_FPR256 - PMI_Min], 1 },
106
+ {&PartMappings[PMI_FPR256 - PMI_Min], 1 },
107
+ {&PartMappings[PMI_FPR256 - PMI_Min], 1 },
108
+ // 18: FPR 512-bit value. <-- This must match Last3OpsIdx.
109
+ {&PartMappings[PMI_FPR512 - PMI_Min], 1 },
110
+ {&PartMappings[PMI_FPR512 - PMI_Min], 1 },
111
+ {&PartMappings[PMI_FPR512 - PMI_Min], 1 },
112
+ // Cross register bank copies.
113
+ // 21: GPR 32-bit value to FPR 32-bit value. <-- This must match
114
+ // FirstCrossRegCpyIdx.
115
+ {&PartMappings[PMI_GPR32 - PMI_Min], 1 },
116
+ {&PartMappings[PMI_FPR32 - PMI_Min], 1 },
117
+ // 23: GPR 64-bit value to FPR 64-bit value.
118
+ {&PartMappings[PMI_GPR64 - PMI_Min], 1 },
119
+ {&PartMappings[PMI_FPR64 - PMI_Min], 1 },
120
+ // 25: FPR 32-bit value to GPR 32-bit value.
121
+ {&PartMappings[PMI_FPR32 - PMI_Min], 1 },
122
+ {&PartMappings[PMI_GPR32 - PMI_Min], 1 },
123
+ // 27: FPR 64-bit value to GPR 64-bit value. <-- This must match
124
+ // LastCrossRegCpyIdx.
125
+ {&PartMappings[PMI_FPR64 - PMI_Min], 1 },
126
+ {&PartMappings[PMI_GPR64 - PMI_Min], 1 }
107
127
};
108
128
109
129
// / Get the pointer to the ValueMapping representing the RegisterBank
0 commit comments