OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.18.50/] [ld/] [testsuite/] [ld-m68hc11/] [relax-group.s] - Diff between revs 38 and 156

Only display areas with differences | Details | Blame | View Log

Rev 38 Rev 156
;;; Test 68HC11 linker relaxation (group relax)
;;; Test 68HC11 linker relaxation (group relax)
;;; 
;;; 
        .sect .text
        .sect .text
        .globl _start
        .globl _start
_start:
_start:
;;;
;;;
;;; The following group of instructions are adjusted.
;;; The following group of instructions are adjusted.
;;;
;;;
        .relax  L1x
        .relax  L1x
        ldx     #table
        ldx     #table
        bset    0,x #4
        bset    0,x #4
L1x:
L1x:
        .relax  L1y
        .relax  L1y
        ldy     #table
        ldy     #table
        bset    0,y #4
        bset    0,y #4
L1y:
L1y:
        .relax  L2x
        .relax  L2x
        ldx     #table+3
        ldx     #table+3
        bset    0,x #4
        bset    0,x #4
        bset    1,x #8
        bset    1,x #8
L2x:
L2x:
        .relax  L2y
        .relax  L2y
        ldy     #table+3
        ldy     #table+3
        bset    0,y #4
        bset    0,y #4
        bset    1,y #8
        bset    1,y #8
L2y:
L2y:
        .relax  L3x
        .relax  L3x
        ldx     #table+6
        ldx     #table+6
        bset    0,x #4
        bset    0,x #4
        bset    1,x #8
        bset    1,x #8
        bset    2,x #12
        bset    2,x #12
        bset    3,x #12
        bset    3,x #12
        bset    4,x #12
        bset    4,x #12
        bset    5,x #12
        bset    5,x #12
L3x:
L3x:
        .relax  L3y
        .relax  L3y
        ldy     #table+6
        ldy     #table+6
        bset    0,y #4
        bset    0,y #4
        bset    1,y #8
        bset    1,y #8
        bset    2,y #12
        bset    2,y #12
        bset    3,y #12
        bset    3,y #12
        bset    4,y #12
        bset    4,y #12
        bset    5,y #12
        bset    5,y #12
L3y:
L3y:
        ;; Next branch is always relative.  It must be adjusted while
        ;; Next branch is always relative.  It must be adjusted while
        ;; above instructions are relaxed.
        ;; above instructions are relaxed.
        bra     _start
        bra     _start
;;;
;;;
;;; This group has the first two bset insn relaxable while the
;;; This group has the first two bset insn relaxable while the
;;; others are not.  The ldx/ldy must not be removed.
;;; others are not.  The ldx/ldy must not be removed.
;;; 
;;; 
        .relax  L4x
        .relax  L4x
        ldx     #table+0xfe
        ldx     #table+0xfe
        bset    0,x #4
        bset    0,x #4
        bset    1,x #8
        bset    1,x #8
        bset    2,x #12
        bset    2,x #12
        bset    3,x #12
        bset    3,x #12
        bset    4,x #12
        bset    4,x #12
        bset    5,x #12
        bset    5,x #12
L4x:
L4x:
        .relax  L4y
        .relax  L4y
        ldy     #table+0xfe
        ldy     #table+0xfe
        bset    0,y #4
        bset    0,y #4
        bset    1,y #8
        bset    1,y #8
        bset    2,y #12
        bset    2,y #12
        bset    3,y #12
        bset    3,y #12
        bset    4,y #12
        bset    4,y #12
        bset    5,y #12
        bset    5,y #12
L4y:
L4y:
;;;
;;;
;;; Relax group for bclr
;;; Relax group for bclr
;;; 
;;; 
        .relax  L5x
        .relax  L5x
        ldx     #table+10
        ldx     #table+10
        bclr    0,x #4
        bclr    0,x #4
        bclr    1,x #8
        bclr    1,x #8
L5x:
L5x:
        .relax  L5y
        .relax  L5y
        ldy     #table+16
        ldy     #table+16
        bclr    10,y #4
        bclr    10,y #4
        bclr    11,y #8
        bclr    11,y #8
L5y:
L5y:
;;;
;;;
;;; Relax group for brset (with backward branch)
;;; Relax group for brset (with backward branch)
;;; 
;;; 
        .relax  L6x
        .relax  L6x
        ldx     #table+8
        ldx     #table+8
        brset   0,x #4 L5y
        brset   0,x #4 L5y
L6x:
L6x:
        .relax  L7x
        .relax  L7x
        ldy     #table+8
        ldy     #table+8
        brset   0,y #4 L6x
        brset   0,y #4 L6x
L7x:
L7x:
;;;
;;;
;;; Relax group for brset (with forward branch)
;;; Relax group for brset (with forward branch)
;;; 
;;; 
        .relax  L8x
        .relax  L8x
        ldx     #table+8
        ldx     #table+8
        brset   0,x #4 brend
        brset   0,x #4 brend
L8x:
L8x:
        .relax  L8y
        .relax  L8y
        ldy     #table+8
        ldy     #table+8
        brset   0,y #4 brend
        brset   0,y #4 brend
L8y:
L8y:
;;;
;;;
;;; Relax group for brclr (with backward branch)
;;; Relax group for brclr (with backward branch)
;;; 
;;; 
        .relax  L9x
        .relax  L9x
        ldx     #table+8
        ldx     #table+8
        brclr   0,x #4 L8y
        brclr   0,x #4 L8y
L9x:
L9x:
        .relax  L9y
        .relax  L9y
        ldy     #table+8
        ldy     #table+8
        brclr   0,y #4 L9x
        brclr   0,y #4 L9x
L9y:
L9y:
;;;
;;;
;;; Relax group for brclr (with forward branch)
;;; Relax group for brclr (with forward branch)
;;; 
;;; 
        .relax  L10x
        .relax  L10x
        ldx     #table+8
        ldx     #table+8
        brclr   0,x #4 brend
        brclr   0,x #4 brend
L10x:
L10x:
        .relax  L10y
        .relax  L10y
        ldy     #table+8
        ldy     #table+8
        brclr   0,y #4 brend
        brclr   0,y #4 brend
L10y:
L10y:
        nop
        nop
brend:
brend:
;;;
;;;
;;; The following are wrong use of .relax groups.
;;; The following are wrong use of .relax groups.
;;;
;;;
        .relax  w1
        .relax  w1
w1:
w1:
        .relax  w2
        .relax  w2
        bset    0,x #4
        bset    0,x #4
w2:
w2:
        .relax w3
        .relax w3
        ldx     #table
        ldx     #table
w3:
w3:
        .relax w4
        .relax w4
        ldy     #table+8
        ldy     #table+8
w4:
w4:
        .relax w5
        .relax w5
        rts
        rts
w5:
w5:
;;;
;;;
;;; Next insn is not in a .relax group
;;; Next insn is not in a .relax group
        ldx     #table
        ldx     #table
        bset    0,x #5
        bset    0,x #5
        bra     _start
        bra     _start
        rts
        rts
 
 
        .sect .page0
        .sect .page0
        .globl table
        .globl table
table:  .long 0
table:  .long 0
table4: .long 0
table4: .long 0
table8: .long 0
table8: .long 0
        .skip   10
        .skip   10
end_table:
end_table:
        .long 0
        .long 0
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.