aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-11-15 14:29:58 +0000
committerDaniel Jacobowitz <drow@false.org>2005-11-15 14:29:58 +0000
commit01ae4198c0fd51d14a5d05c9081436878773de83 (patch)
tree546e9b2872375c091f524a85ec239fdbaf880a51 /gas/config
parentb33a61905012ae5b46fdd3bd1545156a953dde44 (diff)
downloadgdb-01ae4198c0fd51d14a5d05c9081436878773de83.zip
gdb-01ae4198c0fd51d14a5d05c9081436878773de83.tar.gz
gdb-01ae4198c0fd51d14a5d05c9081436878773de83.tar.bz2
gas/
* config/tc-arm.c (s_arm_unwind_save_core): Don't emit an extra opcode if r4-r15 are not saved. gas/testsuite/ * gas/arm/unwind.s, gas/arm/unwind.d, gas/arm/unwind_vxworks.d: Add a test for saving only the low registers.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-arm.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 62ebd50..9f8e0e9 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -2249,30 +2249,34 @@ s_arm_unwind_save_core (void)
unwind.pending_offset = 0;
}
- /* See if we can use the short opcodes. These pop a block of upto 8
- registers starting with r4, plus maybe r14. */
- for (n = 0; n < 8; n++)
+ /* Pop r4-r15. */
+ if (range & 0xfff0)
{
- /* Break at the first non-saved register. */
- if ((range & (1 << (n + 4))) == 0)
- break;
- }
- /* See if there are any other bits set. */
- if (n == 0 || (range & (0xfff0 << n) & 0xbff0) != 0)
- {
- /* Use the long form. */
- op = 0x8000 | ((range >> 4) & 0xfff);
- add_unwind_opcode (op, 2);
- }
- else
- {
- /* Use the short form. */
- if (range & 0x4000)
- op = 0xa8; /* Pop r14. */
+ /* See if we can use the short opcodes. These pop a block of up to 8
+ registers starting with r4, plus maybe r14. */
+ for (n = 0; n < 8; n++)
+ {
+ /* Break at the first non-saved register. */
+ if ((range & (1 << (n + 4))) == 0)
+ break;
+ }
+ /* See if there are any other bits set. */
+ if (n == 0 || (range & (0xfff0 << n) & 0xbff0) != 0)
+ {
+ /* Use the long form. */
+ op = 0x8000 | ((range >> 4) & 0xfff);
+ add_unwind_opcode (op, 2);
+ }
else
- op = 0xa0; /* Do not pop r14. */
- op |= (n - 1);
- add_unwind_opcode (op, 1);
+ {
+ /* Use the short form. */
+ if (range & 0x4000)
+ op = 0xa8; /* Pop r14. */
+ else
+ op = 0xa0; /* Do not pop r14. */
+ op |= (n - 1);
+ add_unwind_opcode (op, 1);
+ }
}
/* Pop r0-r3. */