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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [h8300/] [extw.s] - Diff between revs 24 and 157

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

Rev 24 Rev 157
# Hitachi H8 testcase 'exts.w, extu.w'
# Hitachi H8 testcase 'exts.w, extu.w'
# mach(): h8300h h8300s h8sx
# mach(): h8300h h8300s h8sx
# as(h8300):    --defsym sim_cpu=0
# as(h8300):    --defsym sim_cpu=0
# as(h8300h):   --defsym sim_cpu=1
# as(h8300h):   --defsym sim_cpu=1
# as(h8300s):   --defsym sim_cpu=2
# as(h8300s):   --defsym sim_cpu=2
# as(h8sx):     --defsym sim_cpu=3
# as(h8sx):     --defsym sim_cpu=3
# ld(h8300h):   -m h8300helf
# ld(h8300h):   -m h8300helf
# ld(h8300s):   -m h8300self
# ld(h8300s):   -m h8300self
# ld(h8sx):     -m h8300sxelf
# ld(h8sx):     -m h8300sxelf
 
 
        .include "testutils.inc"
        .include "testutils.inc"
 
 
        start
        start
 
 
        .data
        .data
        .align 2
        .align 2
pos:    .word   0xff01
pos:    .word   0xff01
neg:    .word   0x0080
neg:    .word   0x0080
 
 
        .text
        .text
 
 
exts_w_reg16_p:
exts_w_reg16_p:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w rn16
        ;; exts.w rn16
        mov.b   #1, r0l
        mov.b   #1, r0l
        exts.w  r0
        exts.w  r0
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  0xa5a50001 er0     ; result of sign extend
        test_h_gr32  0xa5a50001 er0     ; result of sign extend
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
exts_w_reg16_n:
exts_w_reg16_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w rn16
        ;; exts.w rn16
        mov.b   #0xff, r0l
        mov.b   #0xff, r0l
        exts.w  r0
        exts.w  r0
 
 
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        test_neg_set
        test_neg_set
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_carry_clear
        test_carry_clear
 
 
        test_h_gr32  0xa5a5ffff er0     ; result of sign extend
        test_h_gr32  0xa5a5ffff er0     ; result of sign extend
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
extu_w_reg16_n:
extu_w_reg16_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w rn16
        ;; extu.w rn16
        mov.b   #0xff, r0l
        mov.b   #0xff, r0l
        extu.w  r0
        extu.w  r0
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  0xa5a500ff er0     ; result of zero extend
        test_h_gr32  0xa5a500ff er0     ; result of zero extend
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 1          ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
 
 
.if (sim_cpu == h8sx)
.if (sim_cpu == h8sx)
exts_w_ind_p:
exts_w_ind_p:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @ern
        ;; exts.w @ern
        mov.l   #pos, er1
        mov.l   #pos, er1
        exts.w  @er1
        exts.w  @er1
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  pos er1    ; er1 still contains target address
        test_h_gr32  pos er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0001, @pos
        cmp.w   #0x0001, @pos
        beq     .Lswindp
        beq     .Lswindp
        fail
        fail
.Lswindp:
.Lswindp:
        mov.w   #0xff01, @pos   ; Restore initial value
        mov.w   #0xff01, @pos   ; Restore initial value
 
 
exts_w_ind_n:
exts_w_ind_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @ern
        ;; exts.w @ern
        mov.l   #neg, er1
        mov.l   #neg, er1
        exts.w  @er1
        exts.w  @er1
 
 
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        test_neg_set
        test_neg_set
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_carry_clear
        test_carry_clear
 
 
        test_h_gr32  neg er1    ; er1 still contains target address
        test_h_gr32  neg er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0xff80, @neg
        cmp.w   #0xff80, @neg
        beq     .Lswindn
        beq     .Lswindn
        fail
        fail
.Lswindn:
.Lswindn:
        ;; Note: leave the value as 0xff80, so that extu has work to do.
        ;; Note: leave the value as 0xff80, so that extu has work to do.
 
 
extu_w_ind_n:
extu_w_ind_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @ern
        ;; extu.w @ern
        mov.l   #neg, er1
        mov.l   #neg, er1
        extu.w  @er1
        extu.w  @er1
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg er1    ; er1 still contains target address
        test_h_gr32  neg er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwindn
        beq     .Luwindn
        fail
        fail
.Luwindn:
.Luwindn:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
exts_w_postinc_p:
exts_w_postinc_p:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @ern+
        ;; exts.w @ern+
        mov.l   #pos, er1
        mov.l   #pos, er1
        exts.w  @er1+
        exts.w  @er1+
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  pos+2 er1  ; er1 still contains target address plus 2
        test_h_gr32  pos+2 er1  ; er1 still contains target address plus 2
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0001, @pos
        cmp.w   #0x0001, @pos
        beq     .Lswpostincp
        beq     .Lswpostincp
        fail
        fail
.Lswpostincp:
.Lswpostincp:
        mov.w   #0xff01, @pos   ; Restore initial value
        mov.w   #0xff01, @pos   ; Restore initial value
 
 
exts_w_postinc_n:
exts_w_postinc_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @ern+
        ;; exts.w @ern+
        mov.l   #neg, er1
        mov.l   #neg, er1
        exts.w  @er1+
        exts.w  @er1+
 
 
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        test_neg_set
        test_neg_set
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_carry_clear
        test_carry_clear
 
 
        test_h_gr32  neg+2 er1  ; er1 still contains target address
        test_h_gr32  neg+2 er1  ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0xff80, @neg
        cmp.w   #0xff80, @neg
        beq     .Lswpostincn
        beq     .Lswpostincn
        fail
        fail
.Lswpostincn:
.Lswpostincn:
        ;; Note: leave the value as 0xff80, so that extu has work to do.
        ;; Note: leave the value as 0xff80, so that extu has work to do.
 
 
extu_w_postinc_n:
extu_w_postinc_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @ern+
        ;; extu.w @ern+
        mov.l   #neg, er1
        mov.l   #neg, er1
        extu.w  @er1+
        extu.w  @er1+
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg+2 er1  ; er1 still contains target address
        test_h_gr32  neg+2 er1  ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwpostincn
        beq     .Luwpostincn
        fail
        fail
.Luwpostincn:
.Luwpostincn:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
exts_w_postdec_p:
exts_w_postdec_p:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @ern-
        ;; exts.w @ern-
        mov.l   #pos, er1
        mov.l   #pos, er1
        exts.w  @er1-
        exts.w  @er1-
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  pos-2 er1  ; er1 still contains target address plus 2
        test_h_gr32  pos-2 er1  ; er1 still contains target address plus 2
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0001, @pos
        cmp.w   #0x0001, @pos
        beq     .Lswpostdecp
        beq     .Lswpostdecp
        fail
        fail
.Lswpostdecp:
.Lswpostdecp:
        mov.w   #0xff01, @pos   ; Restore initial value
        mov.w   #0xff01, @pos   ; Restore initial value
 
 
exts_w_postdec_n:
exts_w_postdec_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @ern-
        ;; exts.w @ern-
        mov.l   #neg, er1
        mov.l   #neg, er1
        exts.w  @er1-
        exts.w  @er1-
 
 
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        test_neg_set
        test_neg_set
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_carry_clear
        test_carry_clear
 
 
        test_h_gr32  neg-2 er1  ; er1 still contains target address
        test_h_gr32  neg-2 er1  ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0xff80, @neg
        cmp.w   #0xff80, @neg
        beq     .Lswpostdecn
        beq     .Lswpostdecn
        fail
        fail
.Lswpostdecn:
.Lswpostdecn:
        ;; Note: leave the value as 0xff80, so that extu has work to do.
        ;; Note: leave the value as 0xff80, so that extu has work to do.
 
 
extu_w_postdec_n:
extu_w_postdec_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @ern-
        ;; extu.w @ern-
        mov.l   #neg, er1
        mov.l   #neg, er1
        extu.w  @er1-
        extu.w  @er1-
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg-2 er1  ; er1 still contains target address
        test_h_gr32  neg-2 er1  ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwpostdecn
        beq     .Luwpostdecn
        fail
        fail
.Luwpostdecn:
.Luwpostdecn:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
exts_w_preinc_p:
exts_w_preinc_p:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @+ern
        ;; exts.w @+ern
        mov.l   #pos-2, er1
        mov.l   #pos-2, er1
        exts.w  @+er1
        exts.w  @+er1
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  pos er1    ; er1 still contains target address plus 2
        test_h_gr32  pos er1    ; er1 still contains target address plus 2
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0001, @pos
        cmp.w   #0x0001, @pos
        beq     .Lswpreincp
        beq     .Lswpreincp
        fail
        fail
.Lswpreincp:
.Lswpreincp:
        mov.w   #0xff01, @pos   ; Restore initial value
        mov.w   #0xff01, @pos   ; Restore initial value
 
 
exts_w_preinc_n:
exts_w_preinc_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @+ern
        ;; exts.w @+ern
        mov.l   #neg-2, er1
        mov.l   #neg-2, er1
        exts.w  @+er1
        exts.w  @+er1
 
 
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        test_neg_set
        test_neg_set
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_carry_clear
        test_carry_clear
 
 
        test_h_gr32  neg er1    ; er1 still contains target address
        test_h_gr32  neg er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0xff80, @neg
        cmp.w   #0xff80, @neg
        beq     .Lswpreincn
        beq     .Lswpreincn
        fail
        fail
.Lswpreincn:
.Lswpreincn:
        ;; Note: leave the value as 0xff80, so that extu has work to do.
        ;; Note: leave the value as 0xff80, so that extu has work to do.
 
 
extu_w_preinc_n:
extu_w_preinc_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @+ern
        ;; extu.w @+ern
        mov.l   #neg-2, er1
        mov.l   #neg-2, er1
        extu.w  @+er1
        extu.w  @+er1
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg er1    ; er1 still contains target address
        test_h_gr32  neg er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwpreincn
        beq     .Luwpreincn
        fail
        fail
.Luwpreincn:
.Luwpreincn:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
exts_w_predec_p:
exts_w_predec_p:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @-ern
        ;; exts.w @-ern
        mov.l   #pos+2, er1
        mov.l   #pos+2, er1
        exts.w  @-er1
        exts.w  @-er1
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  pos er1    ; er1 still contains target address plus 2
        test_h_gr32  pos er1    ; er1 still contains target address plus 2
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0001, @pos
        cmp.w   #0x0001, @pos
        beq     .Lswpredecp
        beq     .Lswpredecp
        fail
        fail
.Lswpredecp:
.Lswpredecp:
        mov.w   #0xff01, @pos   ; Restore initial value
        mov.w   #0xff01, @pos   ; Restore initial value
 
 
exts_w_predec_n:
exts_w_predec_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; exts.w @-ern
        ;; exts.w @-ern
        mov.l   #neg+2, er1
        mov.l   #neg+2, er1
        exts.w  @-er1
        exts.w  @-er1
 
 
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=1 Z=0 V=0 C=0
        test_neg_set
        test_neg_set
        test_zero_clear
        test_zero_clear
        test_ovf_clear
        test_ovf_clear
        test_carry_clear
        test_carry_clear
 
 
        test_h_gr32  neg er1    ; er1 still contains target address
        test_h_gr32  neg er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0xff80, @neg
        cmp.w   #0xff80, @neg
        beq     .Lswpredecn
        beq     .Lswpredecn
        fail
        fail
.Lswpredecn:
.Lswpredecn:
        ;; Note: leave the value as 0xff80, so that extu has work to do.
        ;; Note: leave the value as 0xff80, so that extu has work to do.
 
 
extu_w_predec_n:
extu_w_predec_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @-ern
        ;; extu.w @-ern
        mov.l   #neg+2, er1
        mov.l   #neg+2, er1
        extu.w  @-er1
        extu.w  @-er1
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg er1    ; er1 still contains target address
        test_h_gr32  neg er1    ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwpredecn
        beq     .Luwpredecn
        fail
        fail
.Luwpredecn:
.Luwpredecn:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
extu_w_disp2_n:
extu_w_disp2_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @(dd:2, ern)
        ;; extu.w @(dd:2, ern)
        mov.l   #neg-2, er1
        mov.l   #neg-2, er1
        extu.w  @(2:2, er1)
        extu.w  @(2:2, er1)
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg-2 er1  ; er1 still contains target address
        test_h_gr32  neg-2 er1  ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwdisp2n
        beq     .Luwdisp2n
        fail
        fail
.Luwdisp2n:
.Luwdisp2n:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
extu_w_disp16_n:
extu_w_disp16_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @(dd:16, ern)
        ;; extu.w @(dd:16, ern)
        mov.l   #neg-44, er1
        mov.l   #neg-44, er1
        extu.w  @(44:16, er1)
        extu.w  @(44:16, er1)
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg-44 er1 ; er1 still contains target address
        test_h_gr32  neg-44 er1 ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwdisp16n
        beq     .Luwdisp16n
        fail
        fail
.Luwdisp16n:
.Luwdisp16n:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
extu_w_disp32_n:
extu_w_disp32_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @(dd:32, ern)
        ;; extu.w @(dd:32, ern)
        mov.l   #neg+444, er1
        mov.l   #neg+444, er1
        extu.w  @(-444:32, er1)
        extu.w  @(-444:32, er1)
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_h_gr32  neg+444 er1        ; er1 still contains target address
        test_h_gr32  neg+444 er1        ; er1 still contains target address
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwdisp32n
        beq     .Luwdisp32n
        fail
        fail
.Luwdisp32n:
.Luwdisp32n:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
extu_w_abs16_n:
extu_w_abs16_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @aa:16
        ;; extu.w @aa:16
        extu.w  @neg:16
        extu.w  @neg:16
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwabs16n
        beq     .Luwabs16n
        fail
        fail
.Luwabs16n:
.Luwabs16n:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
extu_w_abs32_n:
extu_w_abs32_n:
        set_grs_a5a5
        set_grs_a5a5
        set_ccr_zero
        set_ccr_zero
        ;; extu.w @aa:32
        ;; extu.w @aa:32
        extu.w  @neg:32
        extu.w  @neg:32
 
 
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        ;; Test ccr             H=0 N=0 Z=0 V=0 C=0
        test_cc_clear
        test_cc_clear
 
 
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 0           ; Make sure other general regs not disturbed
        test_gr_a5a5 1
        test_gr_a5a5 1
        test_gr_a5a5 2
        test_gr_a5a5 2
        test_gr_a5a5 3
        test_gr_a5a5 3
        test_gr_a5a5 4
        test_gr_a5a5 4
        test_gr_a5a5 5
        test_gr_a5a5 5
        test_gr_a5a5 6
        test_gr_a5a5 6
        test_gr_a5a5 7
        test_gr_a5a5 7
        cmp.w   #0x0080, @neg
        cmp.w   #0x0080, @neg
        beq     .Luwabs32n
        beq     .Luwabs32n
        fail
        fail
.Luwabs32n:
.Luwabs32n:
        ;; Note: leave the value as 0x0080, like it started out.
        ;; Note: leave the value as 0x0080, like it started out.
 
 
.endif
.endif
 
 
        pass
        pass
 
 
        exit 0
        exit 0
 
 

powered by: WebSVN 2.1.0

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