qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/26] target/mips: Make CPU/FPU regnames[] arrays global


From: Richard Henderson
Subject: Re: [PATCH 04/26] target/mips: Make CPU/FPU regnames[] arrays global
Date: Sun, 18 Apr 2021 11:59:34 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote:
+const char * const regnames[32] = {
+    "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
+    "t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
+    "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
+    "t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra",
+};
+
  #if !defined(CONFIG_USER_ONLY)
/* Called for updates to CP0_Status. */
diff --git a/target/mips/fpu.c b/target/mips/fpu.c
index 39a2f7fd22e..1447dba3fa3 100644
--- a/target/mips/fpu.c
+++ b/target/mips/fpu.c
@@ -16,3 +16,10 @@ const FloatRoundMode ieee_rm[4] = {
      float_round_up,
      float_round_down
  };
+
+const char * const fregnames[32] = {
+    "f0",  "f1",  "f2",  "f3",  "f4",  "f5",  "f6",  "f7",
+    "f8",  "f9",  "f10", "f11", "f12", "f13", "f14", "f15",
+    "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
+    "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
+};

Code motion, so,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

but I'll note that you can save space and pie runtime relocations by using

const char {f,}regnames[32][4]

since all entries are no more than 4 bytes including nul terminator.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]