64 "SR_XER", "SR_LR", "SR_CTR", "SR_VRSAVE", "SR_SPEFSCR", "SR_PPR"
65 };
66 return is_valid() ? names[encoding()] : "snoreg";
67 }
68
69 const char* VectorRegisterImpl::name() const {
70 const char* names[number_of_registers] = {
71 "VR0", "VR1", "VR2", "VR3", "VR4", "VR5", "VR6", "VR7",
72 "VR8", "VR9", "VR10", "VR11", "VR12", "VR13", "VR14", "VR15",
73 "VR16", "VR17", "VR18", "VR19", "VR20", "VR21", "VR22", "VR23",
74 "VR24", "VR25", "VR26", "VR27", "VR28", "VR29", "VR30", "VR31"
75 };
76 return is_valid() ? names[encoding()] : "vnoreg";
77 }
78
79 const char* VectorSRegisterImpl::name() const {
80 const char* names[number_of_registers] = {
81 "VSR0", "VSR1", "VSR2", "VSR3", "VSR4", "VSR5", "VSR6", "VSR7",
82 "VSR8", "VSR9", "VSR10", "VSR11", "VSR12", "VSR13", "VSR14", "VSR15",
83 "VSR16", "VSR17", "VSR18", "VSR19", "VSR20", "VSR21", "VSR22", "VSR23",
84 "VSR24", "VSR25", "VSR26", "VSR27", "VSR28", "VSR29", "VSR30", "VSR31"
85 };
86 return is_valid() ? names[encoding()] : "vsnoreg";
87 }
88
|
64 "SR_XER", "SR_LR", "SR_CTR", "SR_VRSAVE", "SR_SPEFSCR", "SR_PPR"
65 };
66 return is_valid() ? names[encoding()] : "snoreg";
67 }
68
69 const char* VectorRegisterImpl::name() const {
70 const char* names[number_of_registers] = {
71 "VR0", "VR1", "VR2", "VR3", "VR4", "VR5", "VR6", "VR7",
72 "VR8", "VR9", "VR10", "VR11", "VR12", "VR13", "VR14", "VR15",
73 "VR16", "VR17", "VR18", "VR19", "VR20", "VR21", "VR22", "VR23",
74 "VR24", "VR25", "VR26", "VR27", "VR28", "VR29", "VR30", "VR31"
75 };
76 return is_valid() ? names[encoding()] : "vnoreg";
77 }
78
79 const char* VectorSRegisterImpl::name() const {
80 const char* names[number_of_registers] = {
81 "VSR0", "VSR1", "VSR2", "VSR3", "VSR4", "VSR5", "VSR6", "VSR7",
82 "VSR8", "VSR9", "VSR10", "VSR11", "VSR12", "VSR13", "VSR14", "VSR15",
83 "VSR16", "VSR17", "VSR18", "VSR19", "VSR20", "VSR21", "VSR22", "VSR23",
84 "VSR24", "VSR25", "VSR26", "VSR27", "VSR28", "VSR29", "VSR30", "VSR31",
85 "VSR32", "VSR33", "VSR34", "VSR35", "VSR36", "VSR37", "VSR38", "VSR39",
86 "VSR40", "VSR41", "VSR42", "VSR43", "VSR44", "VSR45", "VSR46", "VSR47",
87 "VSR48", "VSR49", "VSR50", "VSR51", "VSR52", "VSR53", "VSR54", "VSR55",
88 "VSR56", "VSR57", "VSR58", "VSR59", "VSR60", "VSR61", "VSR62", "VSR63"
89 };
90 return is_valid() ? names[encoding()] : "vsnoreg";
91 }
92
93 // Method to convert a VectorRegister to a Vector-Scalar Register (VectorSRegister)
94 VectorSRegister VectorRegisterImpl::to_vsr() const {
95 // Inneficient, but the short list won't hurt performance plus it's very easy
96 // to understand and review.
97 if (VR0 == this) return VSR32;
98 if (VR1 == this) return VSR33;
99 if (VR2 == this) return VSR34;
100 if (VR3 == this) return VSR35;
101 if (VR4 == this) return VSR36;
102 if (VR5 == this) return VSR37;
103 if (VR6 == this) return VSR38;
104 if (VR7 == this) return VSR39;
105 if (VR8 == this) return VSR40;
106 if (VR9 == this) return VSR41;
107 if (VR10 == this) return VSR42;
108 if (VR11 == this) return VSR43;
109 if (VR12 == this) return VSR44;
110 if (VR13 == this) return VSR45;
111 if (VR14 == this) return VSR46;
112 if (VR15 == this) return VSR47;
113 if (VR16 == this) return VSR48;
114 if (VR17 == this) return VSR49;
115 if (VR18 == this) return VSR50;
116 if (VR19 == this) return VSR51;
117 if (VR20 == this) return VSR52;
118 if (VR21 == this) return VSR53;
119 if (VR22 == this) return VSR54;
120 if (VR23 == this) return VSR55;
121 if (VR24 == this) return VSR56;
122 if (VR25 == this) return VSR57;
123 if (VR26 == this) return VSR58;
124 if (VR27 == this) return VSR59;
125 if (VR28 == this) return VSR60;
126 if (VR29 == this) return VSR61;
127 if (VR30 == this) return VSR62;
128 if (VR31 == this) return VSR63;
129 return vsnoregi;
130 }
|