Power: Change bitfield name to avoid conflicts with range_map
authorAndreas Hansson <andreas.hansson@arm.com>
Mon, 26 Mar 2012 09:35:24 +0000 (05:35 -0400)
committerAndreas Hansson <andreas.hansson@arm.com>
Mon, 26 Mar 2012 09:35:24 +0000 (05:35 -0400)
This patch changes the name of a bitfield from W to W_FIELD to avoid
clashes with W being used as a class (typename) in the templatized
range_map. It also changes L to L_FIELD to avoid future problems. The
problem manifestes itself when the CPU includes a header that in turn
includes range_map.hh. The relevant parts of the decoder are updated.

src/arch/power/isa/bitfields.isa
src/arch/power/isa/decoder.isa

index 8cd323ad5aac5c2432d944767061dfe579c70e1a..2997ea52ffed2c52467ad0d91c48c22350621337 100644 (file)
@@ -75,8 +75,10 @@ def bitfield BF            <25:23>;
 
 // Fields for FPSCR manipulation instructions
 def bitfield FLM           <24:17>;
-def bitfield L             <25>;
-def bitfield W             <16>;
+// Named so to avoid conflicts with potential template typenames
+def bitfield L_FIELD       <25>;
+// Named so to avoid conflicts with range_map.hh
+def bitfield W_FIELD       <16>;
 // Named so to avoid conflicts with range.hh
 def bitfield U_FIELD       <15:12>;
 
index 23089190f213125bb9850c1e0242b5929e06051a..11d22239029b6c3aff1e7abe593f5a2de7c285f2 100644 (file)
@@ -571,14 +571,15 @@ decode OPCODE default Unknown::unknown() {
                 }});
                 583: mffs({{ Ft_uq = FPSCR; }});
                 134: mtfsfi({{
-                    FPSCR = insertCRField(FPSCR, BF + (8 * (1 - W)), U_FIELD);
+                    FPSCR = insertCRField(FPSCR, BF + (8 * (1 - W_FIELD)),
+                                          U_FIELD);
                 }});
                 711: mtfsf({{
-                    if (L == 1) { FPSCR = Fb_uq; }
+                    if (L_FIELD == 1) { FPSCR = Fb_uq; }
                     else {
                         for (int i = 0; i < 8; ++i) {
                             if (bits(FLM, i) == 1) {
-                                int k = 4 * (i + (8 * (1 - W)));
+                                int k = 4 * (i + (8 * (1 - W_FIELD)));
                                 FPSCR = insertBits(FPSCR, k, k + 3,
                                                    bits(Fb_uq, k, k + 3));
                             }