GNU Binutils with patches for OS216
修訂 | 478fd476d3fe8a73ff3faa0b2b62ef4b66def9d7 (tree) |
---|---|
時間 | 2016-08-23 17:41:03 |
作者 | Richard Sandiford <richard.sandiford@arm....> |
Commiter | Richard Sandiford |
[AArch64][SVE 17/32] Add a prefix parameter to print_register_list
This patch generalises the interface to print_register_list so
that it can print register lists involving SVE z registers as
well as AdvSIMD v ones.
opcodes/
* aarch64-opc.c (print_register_list): Add a prefix parameter.
(aarch64_print_operand): Update accordingly.
Change-Id: Iae90472b0e2ef7acfcf749bd1d4296ccf82378d6
@@ -2261,9 +2261,11 @@ expand_fp_imm (int size, uint32_t imm8) | ||
2261 | 2261 | } |
2262 | 2262 | |
2263 | 2263 | /* Produce the string representation of the register list operand *OPND |
2264 | - in the buffer pointed by BUF of size SIZE. */ | |
2264 | + in the buffer pointed by BUF of size SIZE. PREFIX is the part of | |
2265 | + the register name that comes before the register number, such as "v". */ | |
2265 | 2266 | static void |
2266 | -print_register_list (char *buf, size_t size, const aarch64_opnd_info *opnd) | |
2267 | +print_register_list (char *buf, size_t size, const aarch64_opnd_info *opnd, | |
2268 | + const char *prefix) | |
2267 | 2269 | { |
2268 | 2270 | const int num_regs = opnd->reglist.num_regs; |
2269 | 2271 | const int first_reg = opnd->reglist.first_regno; |
@@ -2284,8 +2286,8 @@ print_register_list (char *buf, size_t size, const aarch64_opnd_info *opnd) | ||
2284 | 2286 | more than two registers in the list, and the register numbers |
2285 | 2287 | are monotonically increasing in increments of one. */ |
2286 | 2288 | if (num_regs > 2 && last_reg > first_reg) |
2287 | - snprintf (buf, size, "{v%d.%s-v%d.%s}%s", first_reg, qlf_name, | |
2288 | - last_reg, qlf_name, tb); | |
2289 | + snprintf (buf, size, "{%s%d.%s-%s%d.%s}%s", prefix, first_reg, qlf_name, | |
2290 | + prefix, last_reg, qlf_name, tb); | |
2289 | 2291 | else |
2290 | 2292 | { |
2291 | 2293 | const int reg0 = first_reg; |
@@ -2296,20 +2298,21 @@ print_register_list (char *buf, size_t size, const aarch64_opnd_info *opnd) | ||
2296 | 2298 | switch (num_regs) |
2297 | 2299 | { |
2298 | 2300 | case 1: |
2299 | - snprintf (buf, size, "{v%d.%s}%s", reg0, qlf_name, tb); | |
2301 | + snprintf (buf, size, "{%s%d.%s}%s", prefix, reg0, qlf_name, tb); | |
2300 | 2302 | break; |
2301 | 2303 | case 2: |
2302 | - snprintf (buf, size, "{v%d.%s, v%d.%s}%s", reg0, qlf_name, | |
2303 | - reg1, qlf_name, tb); | |
2304 | + snprintf (buf, size, "{%s%d.%s, %s%d.%s}%s", prefix, reg0, qlf_name, | |
2305 | + prefix, reg1, qlf_name, tb); | |
2304 | 2306 | break; |
2305 | 2307 | case 3: |
2306 | - snprintf (buf, size, "{v%d.%s, v%d.%s, v%d.%s}%s", reg0, qlf_name, | |
2307 | - reg1, qlf_name, reg2, qlf_name, tb); | |
2308 | + snprintf (buf, size, "{%s%d.%s, %s%d.%s, %s%d.%s}%s", | |
2309 | + prefix, reg0, qlf_name, prefix, reg1, qlf_name, | |
2310 | + prefix, reg2, qlf_name, tb); | |
2308 | 2311 | break; |
2309 | 2312 | case 4: |
2310 | - snprintf (buf, size, "{v%d.%s, v%d.%s, v%d.%s, v%d.%s}%s", | |
2311 | - reg0, qlf_name, reg1, qlf_name, reg2, qlf_name, | |
2312 | - reg3, qlf_name, tb); | |
2313 | + snprintf (buf, size, "{%s%d.%s, %s%d.%s, %s%d.%s, %s%d.%s}%s", | |
2314 | + prefix, reg0, qlf_name, prefix, reg1, qlf_name, | |
2315 | + prefix, reg2, qlf_name, prefix, reg3, qlf_name, tb); | |
2313 | 2316 | break; |
2314 | 2317 | } |
2315 | 2318 | } |
@@ -2513,7 +2516,7 @@ aarch64_print_operand (char *buf, size_t size, bfd_vma pc, | ||
2513 | 2516 | case AARCH64_OPND_LVt: |
2514 | 2517 | case AARCH64_OPND_LVt_AL: |
2515 | 2518 | case AARCH64_OPND_LEt: |
2516 | - print_register_list (buf, size, opnd); | |
2519 | + print_register_list (buf, size, opnd, "v"); | |
2517 | 2520 | break; |
2518 | 2521 | |
2519 | 2522 | case AARCH64_OPND_Cn: |