target/mips: Optimize regnames[] arrays
Since all entries are no more than 3/4/6 bytes (including nul terminator), can save space and pie runtime relocations by declaring regnames[] as array of 3/4/6 const char. Inspired-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20210617174323.2900831-10-f4bug@amsat.org>
This commit is contained in:
parent
dae7324b97
commit
0610677293
@ -35,7 +35,7 @@
|
||||
#include "qapi/qapi-commands-machine-target.h"
|
||||
#include "fpu_helper.h"
|
||||
|
||||
const char regnames[32][4] = {
|
||||
const char regnames[32][3] = {
|
||||
"r0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
|
||||
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
|
||||
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
|
||||
|
@ -74,7 +74,7 @@ struct mips_def_t {
|
||||
int32_t SAARP;
|
||||
};
|
||||
|
||||
extern const char regnames[32][4];
|
||||
extern const char regnames[32][3];
|
||||
extern const char fregnames[32][4];
|
||||
|
||||
extern const struct mips_def_t mips_defs[];
|
||||
|
@ -255,7 +255,7 @@ enum {
|
||||
OPC_BINSRI_df = (0x7 << 23) | OPC_MSA_BIT_09,
|
||||
};
|
||||
|
||||
static const char * const msaregnames[] = {
|
||||
static const char msaregnames[][6] = {
|
||||
"w0.d0", "w0.d1", "w1.d0", "w1.d1",
|
||||
"w2.d0", "w2.d1", "w3.d0", "w3.d1",
|
||||
"w4.d0", "w4.d1", "w5.d0", "w5.d1",
|
||||
|
@ -447,9 +447,9 @@ enum {
|
||||
static TCGv mxu_gpr[NUMBER_OF_MXU_REGISTERS - 1];
|
||||
static TCGv mxu_CR;
|
||||
|
||||
static const char * const mxuregnames[] = {
|
||||
static const char mxuregnames[][4] = {
|
||||
"XR1", "XR2", "XR3", "XR4", "XR5", "XR6", "XR7", "XR8",
|
||||
"XR9", "XR10", "XR11", "XR12", "XR13", "XR14", "XR15", "MXU_CR",
|
||||
"XR9", "XR10", "XR11", "XR12", "XR13", "XR14", "XR15", "XCR",
|
||||
};
|
||||
|
||||
void mxu_translate_init(void)
|
||||
|
@ -1280,11 +1280,11 @@ TCGv_i64 fpu_f64[32];
|
||||
#define DISAS_STOP DISAS_TARGET_0
|
||||
#define DISAS_EXIT DISAS_TARGET_1
|
||||
|
||||
static const char * const regnames_HI[] = {
|
||||
static const char regnames_HI[][4] = {
|
||||
"HI0", "HI1", "HI2", "HI3",
|
||||
};
|
||||
|
||||
static const char * const regnames_LO[] = {
|
||||
static const char regnames_LO[][4] = {
|
||||
"LO0", "LO1", "LO2", "LO3",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user