diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-08-09 08:32:54 +1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-08-09 08:32:54 +1000 |
commit | a7b0384d541b6124e55c8d19e2855e91f03fc1b4 (patch) | |
tree | 013a18801b3111d6c43a3dbae7bab64444b2c1e9 /gas | |
parent | 647adc681238f8ed1638520f7e09ed8b56af55af (diff) | |
download | fsf-binutils-gdb-a7b0384d541b6124e55c8d19e2855e91f03fc1b4.zip fsf-binutils-gdb-a7b0384d541b6124e55c8d19e2855e91f03fc1b4.tar.gz fsf-binutils-gdb-a7b0384d541b6124e55c8d19e2855e91f03fc1b4.tar.bz2 |
gas: sparc: Fix faligndatai assembly and disassembly
The first operand is a general register, not an fp register;
the third operand is encoded into RS2, not RS3;
the second operand must match the destination operand.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-sparc.c | 17 | ||||
-rw-r--r-- | gas/testsuite/gas/sparc/sparc5vis4.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/sparc/sparc5vis4.s | 2 |
3 files changed, 11 insertions, 10 deletions
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index aca60e6..e37189e 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -2593,13 +2593,6 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) break; } /* if not an 'f' register. */ - if (*args == '}' && mask != RS2 (opcode)) - { - error_message - = _(": Instruction requires frs2 and frsd must be the same register"); - goto error; - } - switch (*args) { case 'v': @@ -2628,10 +2621,18 @@ sparc_ip (char *str, const struct sparc_opcode **pinsn) case 'g': case 'H': case 'J': - case '}': case '^': opcode |= RD (mask); continue; + + case '}': + if (RD (mask) != (opcode & RD (0x1f))) + { + error_message = _(": Instruction requires frs2 and " + "frsd must be the same register"); + goto error; + } + continue; } /* Pack it in. */ know (0); diff --git a/gas/testsuite/gas/sparc/sparc5vis4.d b/gas/testsuite/gas/sparc/sparc5vis4.d index bf5c90b..7820c2a 100644 --- a/gas/testsuite/gas/sparc/sparc5vis4.d +++ b/gas/testsuite/gas/sparc/sparc5vis4.d @@ -35,4 +35,4 @@ Disassembly of section .text: 64: 95 b1 aa c8 fpsubs8 %f6, %f8, %f10 68: 9d b2 aa ec fpsubus8 %f10, %f12, %f14 6c: a5 b3 aa 70 fpsubus16 %f14, %f16, %f18 - 70: bf b0 09 3f faligndata %f0, %f62, %f4, %f62 + 70: bf b0 09 24 faligndata %g0, %f62, %f4, %f62 diff --git a/gas/testsuite/gas/sparc/sparc5vis4.s b/gas/testsuite/gas/sparc/sparc5vis4.s index 0a0155f..58ca2b5 100644 --- a/gas/testsuite/gas/sparc/sparc5vis4.s +++ b/gas/testsuite/gas/sparc/sparc5vis4.s @@ -28,4 +28,4 @@ fpsubs8 %f6, %f8, %f10 fpsubus8 %f10, %f12, %f14 fpsubus16 %f14, %f16, %f18 - faligndata %f0, %f62, %f4, %f62 + faligndata %g0, %f62, %f4, %f62 |