This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
More fixes to the MN10300 relaxation table
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 23 Nov 2004 14:52:48 +0000
- Subject: More fixes to the MN10300 relaxation table
Hi Guys,
I am checking in the attached patch to add some more fixes to the
relaxation table for the MN10300 port. I think that this time I have
managed to cover all of the cases properly, so there should not need
to be any more updates. I have also added some more cases to the
relaxation test in the gas mn10300 testsuite.
Cheers
Nick
gas/ChangeLog
2004-11-23 Nick Clifton <nickc@redhat.com>
* config/tc-mn10300.c (md_relax_table): More fixes to the offsets
in this table. They should be correct now.
gas/testsuite/ChangeLog
2004-11-23 Nick Clifton <nickc@redhat.com>
* gas/mn10300/relax.s: Add further tests of the relaxing of branch
instructions.
* gas/mn10300/relax.d: Add expected relocations.
Index: gas/config/tc-mn10300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mn10300.c,v
retrieving revision 1.48
diff -c -3 -p -r1.48 tc-mn10300.c
*** gas/config/tc-mn10300.c 12 Nov 2004 12:27:05 -0000 1.48
--- gas/config/tc-mn10300.c 23 Nov 2004 14:46:04 -0000
*************** const char EXP_CHARS[] = "eE";
*** 54,68 ****
as in 0d1.0. */
const char FLT_CHARS[] = "dD";
! const relax_typeS md_relax_table[] = {
/* bCC relaxing */
{0x7f, -0x80, 2, 1},
! {0x7fff, -0x8000 + 1, 5, 2},
{0x7fffffff, -0x80000000, 7, 0},
! /* bCC relaxing (uncommon cases) */
{0x7f, -0x80, 3, 4},
! {0x7fff, -0x8000 + 1, 6, 5},
{0x7fffffff, -0x80000000, 8, 0},
/* call relaxing */
--- 54,73 ----
as in 0d1.0. */
const char FLT_CHARS[] = "dD";
! const relax_typeS md_relax_table[] =
! {
! /* The plus values for the bCC and fBCC instructions in the table below
! are because the branch instruction is translated into a jump
! instruction that is now +2 or +3 bytes further on in memory, and the
! correct size of jump instruction must be selected. */
/* bCC relaxing */
{0x7f, -0x80, 2, 1},
! {0x7fff + 2, -0x8000 + 2, 5, 2},
{0x7fffffff, -0x80000000, 7, 0},
! /* bCC relaxing (uncommon cases for 3byte length instructions) */
{0x7f, -0x80, 3, 4},
! {0x7fff + 3, -0x8000 + 3, 6, 5},
{0x7fffffff, -0x80000000, 8, 0},
/* call relaxing */
*************** const relax_typeS md_relax_table[] = {
*** 80,86 ****
/* fbCC relaxing */
{0x7f, -0x80, 3, 14},
! {0x7fff, -0x8000 + 1, 6, 15},
{0x7fffffff, -0x80000000, 8, 0},
};
--- 85,91 ----
/* fbCC relaxing */
{0x7f, -0x80, 3, 14},
! {0x7fff + 3, -0x8000 + 3, 6, 15},
{0x7fffffff, -0x80000000, 8, 0},
};
Index: gas/testsuite/gas/mn10300/relax.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mn10300/relax.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 relax.d
*** gas/testsuite/gas/mn10300/relax.d 12 Nov 2004 12:27:01 -0000 1.1
--- gas/testsuite/gas/mn10300/relax.d 23 Nov 2004 14:46:05 -0000
***************
*** 6,17 ****
RELOCATION RECORDS FOR \[.rlcb\]:
OFFSET TYPE VALUE
0+8003 R_MN10300_PCREL8 .L0._0\+0x00000001
! 0+8005 R_MN10300_PCREL32 .L2\+0x00000001
!
! RELOCATION RECORDS FOR \[.rsflb\]:
OFFSET TYPE VALUE
0+8004 R_MN10300_PCREL8 .L0._1\+0x00000002
! 0+8006 R_MN10300_PCREL32 .L4\+0x00000001
--- 6,36 ----
RELOCATION RECORDS FOR \[.rlcb\]:
OFFSET TYPE VALUE
0+8003 R_MN10300_PCREL8 .L0._0\+0x00000001
! 0+8005 R_MN10300_PCREL32 .L1\+0x00000001
! RELOCATION RECORDS FOR \[.rlfcb\]:
OFFSET TYPE VALUE
0+8004 R_MN10300_PCREL8 .L0._1\+0x00000002
! 0+8006 R_MN10300_PCREL32 .L2\+0x00000001
!
! RELOCATION RECORDS FOR \[.rscb\]:
! OFFSET TYPE VALUE
! 0+103 R_MN10300_PCREL8 .L0._2\+0x00000001
! 0+105 R_MN10300_PCREL16 .L3\+0x00000001
!
! RELOCATION RECORDS FOR \[.rsfcb\]:
! OFFSET TYPE VALUE
! 0+104 R_MN10300_PCREL8 .L0._3\+0x00000002
! 0+106 R_MN10300_PCREL16 .L4\+0x00000001
!
! RELOCATION RECORDS FOR \[.rsucb\]:
! OFFSET TYPE VALUE
! 0+104 R_MN10300_PCREL8 .L0._4\+0x00000002
! 0+106 R_MN10300_PCREL16 .L5\+0x00000001
!
! RELOCATION RECORDS FOR \[.rlucb\]:
! OFFSET TYPE VALUE
! 0+8004 R_MN10300_PCREL8 .L0._5\+0x00000002
! 0+8006 R_MN10300_PCREL32 .L6\+0x00000001
Index: gas/testsuite/gas/mn10300/relax.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mn10300/relax.s,v
retrieving revision 1.1
diff -c -3 -p -r1.1 relax.s
*** gas/testsuite/gas/mn10300/relax.s 12 Nov 2004 12:27:01 -0000 1.1
--- gas/testsuite/gas/mn10300/relax.s 23 Nov 2004 14:46:05 -0000
***************
*** 5,32 ****
relax_long_cond_branch:
clr d0
clr d1
! .L2:
add d1,d0
inc d1
.fill 32764, 1, 0xcb
cmp 9,d1
! ble .L2
rets
! .section .rsflb, "ax"
.global relax_long_float_cond_branch
relax_long_float_cond_branch:
clr d0
clr d1
! .L4:
add d1,d0
inc d1
.fill 32764, 1, 0xcb
cmp 9,d1
fble .L4
rets
--- 5,93 ----
relax_long_cond_branch:
clr d0
clr d1
! .L1:
add d1,d0
inc d1
.fill 32764, 1, 0xcb
cmp 9,d1
! ble .L1
rets
! .section .rlfcb, "ax"
.global relax_long_float_cond_branch
relax_long_float_cond_branch:
clr d0
clr d1
! .L2:
add d1,d0
inc d1
.fill 32764, 1, 0xcb
cmp 9,d1
+ fble .L2
+ rets
+
+ .section .rscb, "ax"
+ .global relax_short_cond_branch
+ relax_short_cond_branch:
+ clr d0
+ clr d1
+ .L3:
+ add d1,d0
+ inc d1
+
+ .fill 252, 1, 0xcb
+
+ cmp 9,d1
+ ble .L3
+ rets
+
+ .section .rsfcb, "ax"
+ .global relax_short_float_cond_branch
+ relax_short_float_cond_branch:
+ clr d0
+ clr d1
+ .L4:
+ add d1,d0
+ inc d1
+
+ .fill 252, 1, 0xcb
+
+ cmp 9,d1
fble .L4
rets
+
+ .section .rsucb, "ax"
+ .global relax_short_uncommon_cond_branch
+ relax_short_uncommon_cond_branch:
+ clr d0
+ clr d1
+ .L5:
+ add d1,d0
+ inc d1
+
+ .fill 252, 1, 0xcb
+
+ cmp 9,d1
+ bvc .L5
+ rets
+
+ .section .rlucb, "ax"
+ .global relax_long_uncommon_cond_branch
+ relax_long_uncommon_cond_branch:
+ clr d0
+ clr d1
+ .L6:
+ add d1,d0
+ inc d1
+
+ .fill 32764, 1, 0xcb
+
+ cmp 9,d1
+ bvc .L6
+ rets
+