2003-05-14 Michael Snyder <msnyder@redhat.com>
* addb.s, addw.s, addl.s, addw.s, addx.s, andb.s, andw.s, andl.s, bfld.s, brabc.s, bra.s, bset.s, cmpb.s, cmpw.s, cmpl.s, daa.s, das.s, dec.s, extw.s, extl.s, inc.s, jmp.s, ldc.s, ldm.s, mac.s, mova.s, movb.s, movw.s, movl.s, movmd.s, movsd.s, neg.s, nop.s, not.s, orb.s, orw.s, orl.s, rotl.s, rotr.s, rotxl.s, rotxr.s, shal.s, shar.s, shll.s, shlr.s, stc.s, subb.s, subw.s, subl.s, xorb.s, xorw.s, xorl.s: New files. * allinsn.exp: New file.
This commit is contained in:
parent
105e800205
commit
32ebdc4ce3
35 changed files with 14758 additions and 121 deletions
778
sim/testsuite/sim/h8300/addb.s
Normal file
778
sim/testsuite/sim/h8300/addb.s
Normal file
|
@ -0,0 +1,778 @@
|
|||
# Hitachi H8 testcase 'add.b'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
# Instructions tested:
|
||||
# add.b #xx:8, rd ; 8 rd xxxxxxxx
|
||||
# add.b #xx:8, @erd ; 7 d rd ???? 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @erd+ ; 0 1 7 4 6 c rd 1??? 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @erd- ; 0 1 7 6 6 c rd 1??? 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @+erd ; 0 1 7 5 6 c rd 1??? 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @-erd ; 0 1 7 7 6 c rd 1??? 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @(d:16, erd) ; 0 1 7 4 6 e b30 | rd, b31, dd:16 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @(d:32, erd) ; 7 8 b30 | rd, 4 6 a 2 8 dd:32 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @aa:8 ; 7 f aaaaaaaa 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @aa:16 ; 6 a 1 1??? aa:16 8 ???? xxxxxxxx
|
||||
# add.b #xx:8, @aa:32 ; 6 a 3 1??? aa:32 8 ???? xxxxxxxx
|
||||
# add.b rs, rd ; 0 8 rs rd
|
||||
# add.b reg8, @erd ; 7 d rd ???? 0 8 rs ????
|
||||
# add.b reg8, @erd+ ; 0 1 7 9 8 rd 1 rs
|
||||
# add.b reg8, @erd- ; 0 1 7 9 a rd 1 rs
|
||||
# add.b reg8, @+erd ; 0 1 7 9 9 rd 1 rs
|
||||
# add.b reg8, @-erd ; 0 1 7 9 b rd 1 rs
|
||||
# add.b reg8, @(d:16, erd) ; 0 1 7 9 c b30 | rd32, 1 rs8 imm16
|
||||
# add.b reg8, @(d:32, erd) ; 0 1 7 9 d b31 | rd32, 1 rs8 imm32
|
||||
# add.b reg8, @aa:8 ; 7 f aaaaaaaa 0 8 rs ????
|
||||
# add.b reg8, @aa:16 ; 6 a 1 1??? aa:16 0 8 rs ????
|
||||
# add.b reg8, @aa:32 ; 6 a 3 1??? aa:32 0 8 rs ????
|
||||
#
|
||||
|
||||
# Coming soon:
|
||||
# add.b #xx:8, @(d:2, erd) ; 0 1 7 b30 | b21 | dd:2, 8 ???? xxxxxxxx
|
||||
# add.b reg8, @(d:2, erd) ; 0 1 7 9 dd:2 rd32 1 rs8
|
||||
# ...
|
||||
|
||||
.data
|
||||
pre_byte: .byte 0
|
||||
byte_dest: .byte 0
|
||||
post_byte: .byte 0
|
||||
|
||||
start
|
||||
|
||||
add_b_imm8_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; add.b #xx:8,Rd
|
||||
add.b #5:8, r0l ; Immediate 8-bit src, reg8 dst
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5aa r0 ; add result: a5 + 5
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a5aa er0 ; add result: a5 + 5
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
add_b_imm8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@eRd
|
||||
mov #byte_dest, er0
|
||||
add.b #5:8, @er0 ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 still contains address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #5, r0l
|
||||
beq .L1
|
||||
fail
|
||||
.L1:
|
||||
|
||||
add_b_imm8_rdpostinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@eRd+
|
||||
mov #byte_dest, er0
|
||||
add.b #5:8, @er0+ ; Immediate 8-bit src, reg post-inc dst
|
||||
;;; .word 0x0174
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 post_byte, er0 ; er0 contains address plus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #10, r0l
|
||||
beq .L2
|
||||
fail
|
||||
.L2:
|
||||
|
||||
add_b_imm8_rdpostdec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@eRd-
|
||||
mov #byte_dest, er0
|
||||
add.b #5:8, @er0- ; Immediate 8-bit src, reg post-dec dst
|
||||
;;; .word 0x0176
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 pre_byte, er0 ; er0 contains address minus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #15, r0l
|
||||
beq .L3
|
||||
fail
|
||||
.L3:
|
||||
|
||||
add_b_imm8_rdpreinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@+eRd
|
||||
mov #pre_byte, er0
|
||||
add.b #5:8, @+er0 ; Immediate 8-bit src, reg pre-inc dst
|
||||
;;; .word 0x0175
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 contains destination address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #20, r0l
|
||||
beq .L4
|
||||
fail
|
||||
.L4:
|
||||
|
||||
add_b_imm8_rdpredec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@-eRd
|
||||
mov #post_byte, er0
|
||||
add.b #5:8, @-er0 ; Immediate 8-bit src, reg pre-dec dst
|
||||
;;; .word 0x0177
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 contains destination address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #25, r0l
|
||||
beq .L5
|
||||
fail
|
||||
.L5:
|
||||
|
||||
add_b_imm8_disp16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@(dd:16, eRd)
|
||||
mov #post_byte, er0
|
||||
add.b #5:8, @(-1:16, er0) ; Immediate 8-bit src, 16-bit reg disp dest.
|
||||
;;; .word 0x0174
|
||||
;;; .word 0x6e08
|
||||
;;; .word 0xffff
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 post_byte, er0 ; er0 contains address plus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #30, r0l
|
||||
beq .L6
|
||||
fail
|
||||
.L6:
|
||||
|
||||
add_b_imm8_disp32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@(dd:32, eRd)
|
||||
mov #pre_byte, er0
|
||||
add.b #5:8, @(1:32, er0) ; Immediate 8-bit src, 32-bit reg disp. dest.
|
||||
;;; .word 0x7804
|
||||
;;; .word 0x6a28
|
||||
;;; .word 0x0000
|
||||
;;; .word 0x0001
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 pre_byte, er0 ; er0 contains address minus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #35, r0l
|
||||
beq .L7
|
||||
fail
|
||||
.L7:
|
||||
|
||||
add_b_imm8_abs8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b reg8,@aa:8
|
||||
;; NOTE: for abs8, we will use the SBR register as a base,
|
||||
;; since otherwise we would have to make sure that the destination
|
||||
;; was in the zero page.
|
||||
;;
|
||||
mov #byte_dest-100, er0
|
||||
ldc er0, sbr
|
||||
add.b #5, @100:8 ; 8-bit reg src, 8-bit absolute dest
|
||||
;;; .word 0x7f64
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest-100, er0 ; reg 0 has base address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #40, r0l
|
||||
beq .L8
|
||||
fail
|
||||
.L8:
|
||||
|
||||
add_b_imm8_abs16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@aa:16
|
||||
add.b #5:8, @byte_dest:16 ; Immediate 8-bit src, 16-bit absolute dest
|
||||
;;; .word 0x6a18
|
||||
;;; .word byte_dest
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #45, r0l
|
||||
beq .L9
|
||||
fail
|
||||
.L9:
|
||||
|
||||
add_b_imm8_abs32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b #xx:8,@aa:32
|
||||
add.b #5:8, @byte_dest:32 ; Immediate 8-bit src, 32-bit absolute dest
|
||||
;;; .word 0x6a38
|
||||
;;; .long byte_dest
|
||||
;;; .word 0x8005
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #50, r0l
|
||||
beq .L10
|
||||
fail
|
||||
.L10:
|
||||
|
||||
.endif
|
||||
|
||||
add_b_reg8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; add.b Rs,Rd
|
||||
mov.b #5, r0h
|
||||
add.b r0h, r0l ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0x05aa r0 ; add result: a5 + 5
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a505aa er0 ; add result: a5 + 5
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
add_b_reg8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@eRd ; Add to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @er0 ; reg8 src, reg indirect dest
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0x0890
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 still contains address
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #55, r0l
|
||||
beq .L11
|
||||
fail
|
||||
.L11:
|
||||
|
||||
add_b_reg8_rdpostinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@eRd+ ; Add to register post-increment
|
||||
mov #byte_dest, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @er0+ ; reg8 src, reg post-incr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x8019
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 post_byte er0 ; er0 contains address plus one
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #60, r0l
|
||||
beq .L12
|
||||
fail
|
||||
.L12:
|
||||
|
||||
add_b_reg8_rdpostdec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@eRd- ; Add to register post-decrement
|
||||
mov #byte_dest, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @er0- ; reg8 src, reg post-decr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xa019
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 pre_byte er0 ; er0 contains address minus one
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #65, r0l
|
||||
beq .L13
|
||||
fail
|
||||
.L13:
|
||||
|
||||
add_b_reg8_rdpreinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@+eRd ; Add to register pre-increment
|
||||
mov #pre_byte, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @+er0 ; reg8 src, reg pre-incr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x9019
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 contains destination address
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #70, r0l
|
||||
beq .L14
|
||||
fail
|
||||
.L14:
|
||||
|
||||
add_b_reg8_rdpredec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@-eRd ; Add to register pre-decrement
|
||||
mov #post_byte, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @-er0 ; reg8 src, reg pre-decr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xb019
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 contains destination address
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #75, r0l
|
||||
beq .L15
|
||||
fail
|
||||
.L15:
|
||||
|
||||
add_b_reg8_disp16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@(dd:16, eRd) ; Add to register + 16-bit displacement
|
||||
mov #pre_byte, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @(1:16, er0) ; reg8 src, 16-bit reg disp dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xc019
|
||||
;;; .word 0x0001
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 pre_byte er0 ; er0 contains address minus one
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #80, r0l
|
||||
beq .L16
|
||||
fail
|
||||
.L16:
|
||||
|
||||
add_b_reg8_disp32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b rs8,@-eRd ; Add to register plus 32-bit displacement
|
||||
mov #post_byte, er0
|
||||
mov #5, r1l
|
||||
add.b r1l, @(-1:32, er0) ; reg8 src, 32-bit reg disp dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xd819
|
||||
;;; .word 0xffff
|
||||
;;; .word 0xffff
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 post_byte er0 ; er0 contains address plus one
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #85, r0l
|
||||
beq .L17
|
||||
fail
|
||||
.L17:
|
||||
|
||||
add_b_reg8_abs8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b reg8,@aa:8
|
||||
;; NOTE: for abs8, we will use the SBR register as a base,
|
||||
;; since otherwise we would have to make sure that the destination
|
||||
;; was in the zero page.
|
||||
;;
|
||||
mov #byte_dest-100, er0
|
||||
ldc er0, sbr
|
||||
mov #5, r1l
|
||||
add.b r1l, @100:8 ; 8-bit reg src, 8-bit absolute dest
|
||||
;;; .word 0x7f64
|
||||
;;; .word 0x0890
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest-100, er0 ; reg 0 has base address
|
||||
test_h_gr32 0xa5a5a505 er1 ; reg 1 has test load
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #90, r0l
|
||||
beq .L18
|
||||
fail
|
||||
.L18:
|
||||
|
||||
add_b_reg8_abs16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b reg8,@aa:16
|
||||
mov #5, r0l
|
||||
add.b r0l, @byte_dest:16 ; 8-bit reg src, 16-bit absolute dest
|
||||
;;; .word 0x6a18
|
||||
;;; .word byte_dest
|
||||
;;; .word 0x0880
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 0xa5a5a505 er0 ; reg 0 has test load
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #95, r0l
|
||||
beq .L19
|
||||
fail
|
||||
.L19:
|
||||
|
||||
add_b_reg8_abs32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; add.b reg8,@aa:32
|
||||
mov #5, r0l
|
||||
add.b r0l, @byte_dest:32 ; 8-bit reg src, 32-bit absolute dest
|
||||
;;; .word 0x6a38
|
||||
;;; .long byte_dest
|
||||
;;; .word 0x0880
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 0xa5a5a505 er0 ; reg 0 has test load
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the add to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #100, r0l
|
||||
beq .L20
|
||||
fail
|
||||
.L20:
|
||||
|
||||
.endif
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
1865
sim/testsuite/sim/h8300/addl.s
Normal file
1865
sim/testsuite/sim/h8300/addl.s
Normal file
File diff suppressed because it is too large
Load diff
87
sim/testsuite/sim/h8300/addw.s
Normal file
87
sim/testsuite/sim/h8300/addw.s
Normal file
|
@ -0,0 +1,87 @@
|
|||
# Hitachi H8 testcase 'add.w'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
# Instructions tested:
|
||||
# add.w xx:3, rd ; 0 a 0xxx rd (sx only)
|
||||
# add.w xx:16, rd ; 7 9 1 rd imm16
|
||||
# add.w rs, rd ; 0 9 rs rd
|
||||
#
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ; 3-bit immediate mode only for h8sx
|
||||
add_w_imm3:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; add.w #xx:3,Rd ; Immediate 3-bit operand
|
||||
add.w #7, r0 ; FIXME will not assemble yet
|
||||
; .word 0x0a70 ; Fake it until assembler will take it.
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5ac r0 ; add result: a5a5 + 7
|
||||
test_h_gr32 0xa5a5a5ac er0 ; add result: a5a5 + 7
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
add_w_imm16:
|
||||
;; add.w immediate not available in h8300 mode.
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; add.w #xx:16,Rd
|
||||
add.w #0x111, r0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa6b6 r0 ; add result: a5a5 + 111
|
||||
test_h_gr32 0xa5a5a6b6 er0 ; add result: a5a5 + 111
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
add_w_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; add.w Rs,Rd
|
||||
mov.w #0x111, r1
|
||||
add.w r1, r0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa6b6 r0 ; add result: a5a5 + 111
|
||||
test_h_gr16 0x0111 r1
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a6b6 er0 ; add result: a5a5 + 111
|
||||
test_h_gr32 0xa5a50111 er1
|
||||
.endif
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
|
@ -3,40 +3,43 @@
|
|||
set all "h8300 h8300h h8300s h8sx"
|
||||
|
||||
if {[istarget h8300*-*-*] || [istarget h8sx*-*-*]} then {
|
||||
run_sim_test add.b.s $all
|
||||
run_sim_test add.w.s $all
|
||||
run_sim_test add.l.s $all
|
||||
run_sim_test addb.s $all
|
||||
run_sim_test addw.s $all
|
||||
run_sim_test addl.s $all
|
||||
run_sim_test adds.s $all
|
||||
run_sim_test addx.s $all
|
||||
run_sim_test and.b.s $all
|
||||
run_sim_test and.w.s $all
|
||||
run_sim_test and.l.s $all
|
||||
run_sim_test andb.s $all
|
||||
run_sim_test andw.s $all
|
||||
run_sim_test andl.s $all
|
||||
run_sim_test bfld.s h8sx
|
||||
run_sim_test brabc.s h8sx
|
||||
run_sim_test bra.s $all
|
||||
run_sim_test bset.s $all
|
||||
run_sim_test cmp.b.s $all
|
||||
run_sim_test cmp.w.s $all
|
||||
run_sim_test cmp.l.s $all
|
||||
run_sim_test cmpb.s $all
|
||||
run_sim_test cmpw.s $all
|
||||
run_sim_test cmpl.s $all
|
||||
run_sim_test daa.s $all
|
||||
run_sim_test das.s $all
|
||||
run_sim_test dec.s $all
|
||||
run_sim_test ext.w.s $all
|
||||
run_sim_test ext.l.s $all
|
||||
run_sim_test extw.s $all
|
||||
run_sim_test extl.s $all
|
||||
run_sim_test inc.s $all
|
||||
run_sim_test jmp.s $all
|
||||
run_sim_test ldc.s $all
|
||||
run_sim_test ldm.s $all
|
||||
run_sim_test mac.s $all
|
||||
run_sim_test mov.b.s $all
|
||||
run_sim_test mov.w.s $all
|
||||
run_sim_test mov.l.s $all
|
||||
run_sim_test mova.s h8sx
|
||||
run_sim_test movb.s $all
|
||||
run_sim_test movw.s $all
|
||||
run_sim_test movl.s $all
|
||||
run_sim_test movmd.s h8sx
|
||||
run_sim_test movsd.s h8sx
|
||||
run_sim_test neg.s $all
|
||||
run_sim_test nop.s $all
|
||||
run_sim_test not.s $all
|
||||
run_sim_test or.b.s $all
|
||||
run_sim_test or.w.s $all
|
||||
run_sim_test or.l.s $all
|
||||
run_sim_test orb.s $all
|
||||
run_sim_test orw.s $all
|
||||
run_sim_test orl.s $all
|
||||
run_sim_test rotl.s $all
|
||||
run_sim_test rotr.s $all
|
||||
run_sim_test rotxl.s $all
|
||||
|
@ -46,10 +49,10 @@ if {[istarget h8300*-*-*] || [istarget h8sx*-*-*]} then {
|
|||
run_sim_test shll.s $all
|
||||
run_sim_test shlr.s $all
|
||||
run_sim_test stc.s $all
|
||||
run_sim_test sub.b.s $all
|
||||
run_sim_test sub.w.s $all
|
||||
run_sim_test sub.l.s $all
|
||||
run_sim_test xor.b.s $all
|
||||
run_sim_test xor.w.s $all
|
||||
run_sim_test xor.l.s $all
|
||||
run_sim_test subb.s $all
|
||||
run_sim_test subw.s $all
|
||||
run_sim_test subl.s $all
|
||||
run_sim_test xorb.s $all
|
||||
run_sim_test xorw.s $all
|
||||
run_sim_test xorl.s $all
|
||||
}
|
||||
|
|
491
sim/testsuite/sim/h8300/andb.s
Normal file
491
sim/testsuite/sim/h8300/andb.s
Normal file
|
@ -0,0 +1,491 @@
|
|||
# Hitachi H8 testcase 'and.b'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
# Instructions tested:
|
||||
# and.b #xx:8, rd ; e rd xxxxxxxx
|
||||
# and.b #xx:8, @erd ; 7 d rd ???? e ???? xxxxxxxx
|
||||
# and.b #xx:8, @erd+ ; 0 1 7 4 6 c rd 1??? e ???? xxxxxxxx
|
||||
# and.b #xx:8, @erd- ; 0 1 7 6 6 c rd 1??? e ???? xxxxxxxx
|
||||
# and.b #xx:8, @+erd ; 0 1 7 5 6 c rd 1??? e ???? xxxxxxxx
|
||||
# and.b #xx:8, @-erd ; 0 1 7 7 6 c rd 1??? e ???? xxxxxxxx
|
||||
# and.b rs, rd ; 1 6 rs rd
|
||||
# and.b reg8, @erd ; 7 d rd ???? 1 6 rs ????
|
||||
# and.b reg8, @erd+ ; 0 1 7 9 8 rd 6 rs
|
||||
# and.b reg8, @erd- ; 0 1 7 9 a rd 6 rs
|
||||
# and.b reg8, @+erd ; 0 1 7 9 9 rd 6 rs
|
||||
# and.b reg8, @-erd ; 0 1 7 9 b rd 6 rs
|
||||
#
|
||||
# andc #xx:8, ccr ; 0 6 xxxxxxxx
|
||||
# andc #xx:8, exr ; 0 1 4 1 0 6 xxxxxxxx
|
||||
|
||||
# Coming soon:
|
||||
# ...
|
||||
|
||||
.data
|
||||
pre_byte: .byte 0
|
||||
byte_dest: .byte 0xa5
|
||||
post_byte: .byte 0
|
||||
|
||||
start
|
||||
|
||||
and_b_imm8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.b #xx:8,Rd
|
||||
and.b #0xaa, r0l ; Immediate 8-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5a0 r0 ; and result: a5 & aa
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a5a0 er0 ; and result: a5 & aa
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
and_b_imm8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b #xx:8,@eRd
|
||||
mov #byte_dest, er0
|
||||
and.b #0xaa:8, @er0 ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0xe0aa
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 still contains address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa0, r0l
|
||||
beq .L1
|
||||
fail
|
||||
.L1:
|
||||
|
||||
and_b_imm8_rdpostinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b #xx:8,@eRd+
|
||||
mov #byte_dest, er0
|
||||
and.b #0x55:8, @er0+ ; Immediate 8-bit src, reg post-incr dest
|
||||
;;; .word 0x0174
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xe055
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 post_byte, er0 ; er0 contains address plus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x05, r0l
|
||||
beq .L2
|
||||
fail
|
||||
.L2:
|
||||
|
||||
and_b_imm8_rdpostdec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b #xx:8,@eRd-
|
||||
mov #byte_dest, er0
|
||||
and.b #0xaa:8, @er0- ; Immediate 8-bit src, reg post-decr dest
|
||||
;;; .word 0x0176
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xe0aa
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 pre_byte, er0 ; er0 contains address minus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa0, r0l
|
||||
beq .L3
|
||||
fail
|
||||
.L3:
|
||||
|
||||
and_b_imm8_rdpreinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b #xx:8,@+eRd
|
||||
mov #pre_byte, er0
|
||||
and.b #0x55:8, @+er0 ; Immediate 8-bit src, reg pre-incr dest
|
||||
;;; .word 0x0175
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xe055
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 contains destination address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x05, r0l
|
||||
beq .L4
|
||||
fail
|
||||
.L4:
|
||||
|
||||
and_b_imm8_rdpredec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b #xx:8,@-eRd
|
||||
mov #post_byte, er0
|
||||
and.b #0xaa:8, @-er0 ; Immediate 8-bit src, reg pre-decr dest
|
||||
;;; .word 0x0177
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xe0aa
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 contains destination address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa0, r0l
|
||||
beq .L5
|
||||
fail
|
||||
.L5:
|
||||
|
||||
|
||||
.endif
|
||||
|
||||
and_b_reg8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.b Rs,Rd
|
||||
mov.b #0xaa, r0h
|
||||
and.b r0h, r0l ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xaaa0 r0 ; and result: a5 & aa
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5aaa0 er0 ; and result: a5 & aa
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
and_b_reg8_rdind:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b rs8,@eRd ; And to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #0x55, r1l
|
||||
and.b r1l, @er0 ; reg8 src, reg indirect dest
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0x1690
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 still contains address
|
||||
test_h_gr32 0xa5a5a555 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x05, r0l
|
||||
beq .L6
|
||||
fail
|
||||
.L6:
|
||||
|
||||
and_b_reg8_rdpostinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b rs8,@eRd+ ; And to register post-incr
|
||||
mov #byte_dest, er0
|
||||
mov #0xaa, r1l
|
||||
and.b r1l, @er0+ ; reg8 src, reg post-incr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x8069
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 post_byte er0 ; er0 contains address plus one
|
||||
test_h_gr32 0xa5a5a5aa er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa0, r0l
|
||||
beq .L7
|
||||
fail
|
||||
.L7:
|
||||
|
||||
and_b_reg8_rdpostdec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b rs8,@eRd- ; And to register post-decr
|
||||
mov #byte_dest, er0
|
||||
mov #0x55, r1l
|
||||
and.b r1l, @er0- ; reg8 src, reg post-decr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xa069
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 pre_byte er0 ; er0 contains address minus one
|
||||
test_h_gr32 0xa5a5a555 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x05, r0l
|
||||
beq .L8
|
||||
fail
|
||||
.L8:
|
||||
|
||||
and_b_reg8_rdpreinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b rs8,@+eRd ; And to register post-incr
|
||||
mov #pre_byte, er0
|
||||
mov #0xaa, r1l
|
||||
and.b r1l, @+er0 ; reg8 src, reg post-incr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x9069
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 contains destination address
|
||||
test_h_gr32 0xa5a5a5aa er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa0, r0l
|
||||
beq .L9
|
||||
fail
|
||||
.L9:
|
||||
|
||||
and_b_reg8_rdpredec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; and.b rs8,@-eRd ; And to register post-decr
|
||||
mov #post_byte, er0
|
||||
mov #0x55, r1l
|
||||
and.b r1l, @-er0 ; reg8 src, reg post-decr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xb069
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 contains destination address
|
||||
test_h_gr32 0xa5a5a555 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the and to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x05, r0l
|
||||
beq .L10
|
||||
fail
|
||||
.L10:
|
||||
|
||||
andc_imm8_ccr:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; andc #xx:8,ccr
|
||||
set_ccr 0xff
|
||||
|
||||
test_neg_set
|
||||
andc #0xf7, ccr ; Immediate 8-bit operand (neg flag)
|
||||
test_neg_clear
|
||||
|
||||
test_zero_set
|
||||
andc #0xfb, ccr ; Immediate 8-bit operand (zero flag)
|
||||
test_zero_clear
|
||||
|
||||
test_ovf_set
|
||||
andc #0xfd, ccr ; Immediate 8-bit operand (overflow flag)
|
||||
test_ovf_clear
|
||||
|
||||
test_carry_set
|
||||
andc #0xfe, ccr ; Immediate 8-bit operand (carry flag)
|
||||
test_carry_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.endif
|
||||
pass
|
||||
|
||||
exit 0
|
77
sim/testsuite/sim/h8300/andl.s
Normal file
77
sim/testsuite/sim/h8300/andl.s
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Hitachi H8 testcase 'and.l'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ; 16-bit immediate is only available on sx.
|
||||
and_l_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.l #xx:16,Rd
|
||||
and.l #0xaaaa:16, er0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0x0000a0a0 er0 ; and result: a5a5a5a5 & aaaa
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
and_l_imm32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.l #xx:32,Rd
|
||||
and.l #0xaaaaaaaa, er0 ; Immediate 32-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xa0a0a0a0 er0 ; and result: a5a5a5a5 & aaaaaaaa
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
and_l_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.l Rs,Rd
|
||||
mov.l #0xaaaaaaaa, er1
|
||||
and.l er1, er0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xa0a0a0a0 er0 ; and result: a5a5a5a5 & aaaaaaaa
|
||||
test_h_gr32 0xaaaaaaaa er1 ; Make sure er1 is unchanged
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
61
sim/testsuite/sim/h8300/andw.s
Normal file
61
sim/testsuite/sim/h8300/andw.s
Normal file
|
@ -0,0 +1,61 @@
|
|||
# Hitachi H8 testcase 'and.w'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
and_w_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.w #xx:16,Rd
|
||||
and.w #0xaaaa, r0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa0a0 r0 ; and result: a5a5 & aaaa
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a0a0 er0 ; and result: a5a5 & aaaa
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
and_w_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; and.w Rs,Rd
|
||||
mov.w #0xaaaa, r1
|
||||
and.w r1, r0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa0a0 r0 ; and result: a5a5 & aaaa
|
||||
test_h_gr16 0xaaaa r1 ; Make sure r1 is unchanged
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a0a0 er0 ; and result: a5a5 & aaaa
|
||||
test_h_gr32 0xa5a5aaaa er1 ; Make sure er1 is unchanged
|
||||
.endif
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
|
@ -72,8 +72,8 @@ bra_reg8:
|
|||
;; bra rn.b ; 8-bit register indirect
|
||||
sub.l #src8, @disp8
|
||||
mov.l @disp8, er5
|
||||
;;; bra er5.b
|
||||
.word 0x5955
|
||||
bra r5l.b
|
||||
;;; .word 0x5955
|
||||
src8: fail
|
||||
|
||||
tgt_reg8:
|
||||
|
@ -94,8 +94,8 @@ bra_reg16:
|
|||
;; bra rn.w ; 16-bit register indirect
|
||||
sub.l #src16, @disp16
|
||||
mov.l @disp16, er5
|
||||
;;; bra er5.w
|
||||
.word 0x5956
|
||||
bra r5.w
|
||||
;;; .word 0x5956
|
||||
src16: fail
|
||||
|
||||
tgt_reg16:
|
||||
|
@ -116,8 +116,8 @@ bra_reg32:
|
|||
;; bra ern ; 32-bit register indirect
|
||||
sub.l #src32, @disp32
|
||||
mov.l @disp32, er5
|
||||
;;; bra er5.l
|
||||
.word 0x5957
|
||||
bra er5.l
|
||||
;;; .word 0x5957
|
||||
src32: fail
|
||||
|
||||
tgt_reg32:
|
||||
|
@ -134,8 +134,8 @@ tgt_reg32:
|
|||
bra_s: set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
;;; bra/s tgt_post_delay
|
||||
.word 0x4017
|
||||
bra/s tgt_post_delay
|
||||
;;; .word 0x4017
|
||||
;; The following instruction is in the delay slot, and should execute.
|
||||
mov.b #1, @dslot
|
||||
;; After this, the next instructions should not execute.
|
||||
|
|
1086
sim/testsuite/sim/h8300/cmpb.s
Normal file
1086
sim/testsuite/sim/h8300/cmpb.s
Normal file
File diff suppressed because it is too large
Load diff
106
sim/testsuite/sim/h8300/cmpl.s
Normal file
106
sim/testsuite/sim/h8300/cmpl.s
Normal file
|
@ -0,0 +1,106 @@
|
|||
# Hitachi H8 testcase 'cmp.w'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ; 3-bit immediate mode only for h8sx
|
||||
cmp_l_imm3: ;
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; cmp.l #xx:3,eRd ; Immediate 3-bit operand
|
||||
mov.l #5, er0
|
||||
cmp.l #5, er0
|
||||
beq eq3
|
||||
fail
|
||||
eq3:
|
||||
cmp.l #6, er0
|
||||
blt lt3
|
||||
fail
|
||||
lt3:
|
||||
cmp.l #4, er0
|
||||
bgt gt3
|
||||
fail
|
||||
gt3:
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0x00000005 er0 ; er0 unchanged
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
cmp_l_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; cmp.l #xx:8,Rd
|
||||
cmp.l #0xa5a5a5a5, er0 ; Immediate 16-bit operand
|
||||
beq eqi
|
||||
fail
|
||||
eqi: cmp.l #0xa5a5a5a6, er0
|
||||
blt lti
|
||||
fail
|
||||
lti: cmp.l #0xa5a5a5a4, er0
|
||||
bgt gti
|
||||
fail
|
||||
gti:
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xa5a5a5a5 er0 ; er0 unchanged
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
cmp_w_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; cmp.l Rs,Rd
|
||||
mov.l #0xa5a5a5a5, er1
|
||||
cmp.l er1, er0 ; Register operand
|
||||
beq eqr
|
||||
fail
|
||||
eqr: mov.l #0xa5a5a5a6, er1
|
||||
cmp.l er1, er0
|
||||
blt ltr
|
||||
fail
|
||||
ltr: mov.l #0xa5a5a5a4, er1
|
||||
cmp.l er1, er0
|
||||
bgt gtr
|
||||
fail
|
||||
gtr:
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xa5a5a5a5 er0 ; r0 unchanged
|
||||
test_h_gr32 0xa5a5a5a4 er1 ; r1 unchanged
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
110
sim/testsuite/sim/h8300/cmpw.s
Normal file
110
sim/testsuite/sim/h8300/cmpw.s
Normal file
|
@ -0,0 +1,110 @@
|
|||
# Hitachi H8 testcase 'cmp.w'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ; 3-bit immediate mode only for h8sx
|
||||
cmp_w_imm3: ;
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; cmp.w #xx:3,Rd ; Immediate 3-bit operand
|
||||
mov.w #5, r0
|
||||
cmp.w #5, r0
|
||||
beq eq3
|
||||
fail
|
||||
eq3:
|
||||
cmp.w #6, r0
|
||||
blt lt3
|
||||
fail
|
||||
lt3:
|
||||
cmp.w #4, r0
|
||||
bgt gt3
|
||||
fail
|
||||
gt3:
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr32 0xa5a50005 er0 ; er0 unchanged
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
cmp_w_imm16: ; cmp.w immediate not available in h8300 mode.
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; cmp.w #xx:8,Rd
|
||||
cmp.w #0xa5a5, r0 ; Immediate 16-bit operand
|
||||
beq eqi
|
||||
fail
|
||||
eqi: cmp.w #0xa5a6, r0
|
||||
blt lti
|
||||
fail
|
||||
lti: cmp.w #0xa5a4, r0
|
||||
bgt gti
|
||||
fail
|
||||
gti:
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5a5 r0 ; r0 unchanged
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a5a5 er0 ; er0 unchanged
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
cmp_w_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; cmp.w Rs,Rd
|
||||
mov.w #0xa5a5, r1
|
||||
cmp.w r1, r0 ; Register operand
|
||||
beq eqr
|
||||
fail
|
||||
eqr: mov.w #0xa5a6, r1
|
||||
cmp.w r1, r0
|
||||
blt ltr
|
||||
fail
|
||||
ltr: mov.w #0xa5a4, r1
|
||||
cmp.w r1, r0
|
||||
bgt gtr
|
||||
fail
|
||||
gtr:
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5a5 r0 ; r0 unchanged.
|
||||
test_h_gr16 0xa5a4 r1 ; r1 unchanged.
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a5a5 er0 ; r0 unchanged
|
||||
test_h_gr32 0xa5a5a5a4 er1 ; r1 unchanged
|
||||
.endif
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
1146
sim/testsuite/sim/h8300/extl.s
Normal file
1146
sim/testsuite/sim/h8300/extl.s
Normal file
File diff suppressed because it is too large
Load diff
580
sim/testsuite/sim/h8300/extw.s
Normal file
580
sim/testsuite/sim/h8300/extw.s
Normal file
|
@ -0,0 +1,580 @@
|
|||
# Hitachi H8 testcase 'exts.w, extu.w'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.data
|
||||
.align 2
|
||||
pos: .word 0xff01
|
||||
neg: .word 0x0080
|
||||
|
||||
.text
|
||||
|
||||
exts_w_reg16_p:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w rn16
|
||||
mov.b #1, r0l
|
||||
exts.w r0
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 0xa5a50001 er0 ; result of sign extend
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
exts_w_reg16_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w rn16
|
||||
mov.b #0xff, r0l
|
||||
exts.w r0
|
||||
|
||||
;; Test ccr H=0 N=1 Z=0 V=0 C=0
|
||||
test_neg_set
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_carry_clear
|
||||
|
||||
test_h_gr32 0xa5a5ffff er0 ; result of sign extend
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
extu_w_reg16_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w rn16
|
||||
mov.b #0xff, r0l
|
||||
extu.w r0
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 0xa5a500ff er0 ; result of zero extend
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
exts_w_ind_p:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @ern
|
||||
mov.l #pos, er1
|
||||
exts.w @er1
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 pos er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0001, @pos
|
||||
beq .Lswindp
|
||||
fail
|
||||
.Lswindp:
|
||||
mov.w #0xff01, @pos ; Restore initial value
|
||||
|
||||
exts_w_ind_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @ern
|
||||
mov.l #neg, er1
|
||||
exts.w @er1
|
||||
|
||||
;; Test ccr H=0 N=1 Z=0 V=0 C=0
|
||||
test_neg_set
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_carry_clear
|
||||
|
||||
test_h_gr32 neg er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0xff80, @neg
|
||||
beq .Lswindn
|
||||
fail
|
||||
.Lswindn:
|
||||
;; Note: leave the value as 0xff80, so that extu has work to do.
|
||||
|
||||
extu_w_ind_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @ern
|
||||
mov.l #neg, er1
|
||||
extu.w @er1
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 neg er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwindn
|
||||
fail
|
||||
.Luwindn:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
exts_w_postinc_p:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @ern+
|
||||
mov.l #pos, er1
|
||||
exts.w @er1+
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0001, @pos
|
||||
beq .Lswpostincp
|
||||
fail
|
||||
.Lswpostincp:
|
||||
mov.w #0xff01, @pos ; Restore initial value
|
||||
|
||||
exts_w_postinc_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @ern+
|
||||
mov.l #neg, er1
|
||||
exts.w @er1+
|
||||
|
||||
;; Test ccr H=0 N=1 Z=0 V=0 C=0
|
||||
test_neg_set
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_carry_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0xff80, @neg
|
||||
beq .Lswpostincn
|
||||
fail
|
||||
.Lswpostincn:
|
||||
;; Note: leave the value as 0xff80, so that extu has work to do.
|
||||
|
||||
extu_w_postinc_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @ern+
|
||||
mov.l #neg, er1
|
||||
extu.w @er1+
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwpostincn
|
||||
fail
|
||||
.Luwpostincn:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
exts_w_postdec_p:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @ern-
|
||||
mov.l #pos, er1
|
||||
exts.w @er1-
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0001, @pos
|
||||
beq .Lswpostdecp
|
||||
fail
|
||||
.Lswpostdecp:
|
||||
mov.w #0xff01, @pos ; Restore initial value
|
||||
|
||||
exts_w_postdec_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @ern-
|
||||
mov.l #neg, er1
|
||||
exts.w @er1-
|
||||
|
||||
;; Test ccr H=0 N=1 Z=0 V=0 C=0
|
||||
test_neg_set
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_carry_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0xff80, @neg
|
||||
beq .Lswpostdecn
|
||||
fail
|
||||
.Lswpostdecn:
|
||||
;; Note: leave the value as 0xff80, so that extu has work to do.
|
||||
|
||||
extu_w_postdec_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @ern-
|
||||
mov.l #neg, er1
|
||||
extu.w @er1-
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwpostdecn
|
||||
fail
|
||||
.Luwpostdecn:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
exts_w_preinc_p:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @+ern
|
||||
mov.l #pos-2, er1
|
||||
exts.w @+er1
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0001, @pos
|
||||
beq .Lswpreincp
|
||||
fail
|
||||
.Lswpreincp:
|
||||
mov.w #0xff01, @pos ; Restore initial value
|
||||
|
||||
exts_w_preinc_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @+ern
|
||||
mov.l #neg-2, er1
|
||||
exts.w @+er1
|
||||
|
||||
;; Test ccr H=0 N=1 Z=0 V=0 C=0
|
||||
test_neg_set
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_carry_clear
|
||||
|
||||
test_h_gr32 neg er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0xff80, @neg
|
||||
beq .Lswpreincn
|
||||
fail
|
||||
.Lswpreincn:
|
||||
;; Note: leave the value as 0xff80, so that extu has work to do.
|
||||
|
||||
extu_w_preinc_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @+ern
|
||||
mov.l #neg-2, er1
|
||||
extu.w @+er1
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 neg er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwpreincn
|
||||
fail
|
||||
.Luwpreincn:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
exts_w_predec_p:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @-ern
|
||||
mov.l #pos+2, er1
|
||||
exts.w @-er1
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0001, @pos
|
||||
beq .Lswpredecp
|
||||
fail
|
||||
.Lswpredecp:
|
||||
mov.w #0xff01, @pos ; Restore initial value
|
||||
|
||||
exts_w_predec_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; exts.w @-ern
|
||||
mov.l #neg+2, er1
|
||||
exts.w @-er1
|
||||
|
||||
;; Test ccr H=0 N=1 Z=0 V=0 C=0
|
||||
test_neg_set
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_carry_clear
|
||||
|
||||
test_h_gr32 neg er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0xff80, @neg
|
||||
beq .Lswpredecn
|
||||
fail
|
||||
.Lswpredecn:
|
||||
;; Note: leave the value as 0xff80, so that extu has work to do.
|
||||
|
||||
extu_w_predec_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @-ern
|
||||
mov.l #neg+2, er1
|
||||
extu.w @-er1
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 neg er1 ; er1 still contains target address
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwpredecn
|
||||
fail
|
||||
.Luwpredecn:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
extu_w_disp2_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @(dd:2, ern)
|
||||
mov.l #neg-2, er1
|
||||
extu.w @(2:2, er1)
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwdisp2n
|
||||
fail
|
||||
.Luwdisp2n:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
extu_w_disp16_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @(dd:16, ern)
|
||||
mov.l #neg-44, er1
|
||||
extu.w @(44:16, er1)
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwdisp16n
|
||||
fail
|
||||
.Luwdisp16n:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
extu_w_disp32_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @(dd:32, ern)
|
||||
mov.l #neg+444, er1
|
||||
extu.w @(-444:32, er1)
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
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 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwdisp32n
|
||||
fail
|
||||
.Luwdisp32n:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
extu_w_abs16_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @aa:16
|
||||
extu.w @neg:16
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwabs16n
|
||||
fail
|
||||
.Luwabs16n:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
extu_w_abs32_n:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
;; extu.w @aa:32
|
||||
extu.w @neg:32
|
||||
|
||||
;; Test ccr H=0 N=0 Z=0 V=0 C=0
|
||||
test_cc_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
cmp.w #0x0080, @neg
|
||||
beq .Luwabs32n
|
||||
fail
|
||||
.Luwabs32n:
|
||||
;; Note: leave the value as 0x0080, like it started out.
|
||||
|
||||
.endif
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
|
@ -270,8 +270,8 @@ ldc_postinc_ccr:
|
|||
ldc @er1+, ccr ; postinc src
|
||||
stc ccr, r0l ; copy into general reg
|
||||
|
||||
test_h_gr32 0xa5a5a5ff er0 ; ff in r0l, a5 elsewhere.
|
||||
test_h_gr32 byte_post, er1 ; er1 still contains address
|
||||
test_h_gr32 0xa5a5a5ff er0 ; ff in r0l, a5 elsewhere.
|
||||
test_h_gr32 byte_src+2, er1 ; er1 still contains address
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
|
@ -288,8 +288,8 @@ ldc_postinc_exr:
|
|||
ldc @er1+, exr ; postinc src
|
||||
stc exr, r0l ; copy into general reg
|
||||
|
||||
test_h_gr32 0xa5a5a587 er0 ; 87 in r0l, a5 elsewhere.
|
||||
test_h_gr32 byte_post, er1 ; er1 still contains address
|
||||
test_h_gr32 0xa5a5a587 er0 ; 87 in r0l, a5 elsewhere.
|
||||
test_h_gr32 byte_src+2, er1 ; er1 still contains address
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
|
|
234
sim/testsuite/sim/h8300/ldm.s
Normal file
234
sim/testsuite/sim/h8300/ldm.s
Normal file
|
@ -0,0 +1,234 @@
|
|||
# Hitachi H8 testcase 'ldm', 'stm'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
.data
|
||||
.align 4
|
||||
_stack: .long 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0
|
||||
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
.long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
_stack_top:
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8300s || sim_cpu == h8sx) ; Earlier versions, no exr
|
||||
stm_2reg:
|
||||
set_grs_a5a5
|
||||
mov #_stack_top, er7
|
||||
mov #2, er2
|
||||
mov #3, er3
|
||||
|
||||
set_ccr_zero
|
||||
stm er2-er3, @-sp
|
||||
test_cc_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_h_gr32 2 er2
|
||||
test_h_gr32 3 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_h_gr32 _stack_top-8, er7
|
||||
|
||||
mov @_stack_top-4, er0
|
||||
cmp #2, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-8, er0
|
||||
cmp #3, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-12, er0
|
||||
cmp #0, er0
|
||||
bne fail1
|
||||
|
||||
stm_3reg:
|
||||
set_grs_a5a5
|
||||
mov #_stack_top, er7
|
||||
mov #4, er4
|
||||
mov #5, er5
|
||||
mov #6, er6
|
||||
|
||||
set_ccr_zero
|
||||
stm er4-er6, @-sp
|
||||
test_cc_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_h_gr32 4 er4
|
||||
test_h_gr32 5 er5
|
||||
test_h_gr32 6 er6
|
||||
test_h_gr32 _stack_top-12, er7
|
||||
|
||||
mov @_stack_top-4, er0
|
||||
cmp #4, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-8, er0
|
||||
cmp #5, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-12, er0
|
||||
cmp #6, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-16, er0
|
||||
cmp #0, er0
|
||||
bne fail1
|
||||
|
||||
stm_4reg:
|
||||
set_grs_a5a5
|
||||
mov #_stack_top, er7
|
||||
mov #1, er0
|
||||
mov #2, er1
|
||||
mov #3, er2
|
||||
mov #4, er3
|
||||
|
||||
set_ccr_zero
|
||||
stm er0-er3, @-sp
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 1 er0
|
||||
test_h_gr32 2 er1
|
||||
test_h_gr32 3 er2
|
||||
test_h_gr32 4 er3
|
||||
test_gr_a5a5 4 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_h_gr32 _stack_top-16, er7
|
||||
|
||||
mov @_stack_top-4, er0
|
||||
cmp #1, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-8, er0
|
||||
cmp #2, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-12, er0
|
||||
cmp #3, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-16, er0
|
||||
cmp #4, er0
|
||||
bne fail1
|
||||
|
||||
mov @_stack_top-20, er0
|
||||
cmp #0, er0
|
||||
bne fail1
|
||||
|
||||
ldm_2reg:
|
||||
set_grs_a5a5
|
||||
mov #_stack, er7
|
||||
|
||||
set_ccr_zero
|
||||
ldm @sp+, er2-er3
|
||||
test_cc_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_h_gr32 1 er2
|
||||
test_h_gr32 0 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_h_gr32 _stack+8, er7
|
||||
|
||||
ldm_3reg:
|
||||
set_grs_a5a5
|
||||
mov #_stack+4, er7
|
||||
|
||||
set_ccr_zero
|
||||
ldm @sp+, er4-er6
|
||||
test_cc_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_h_gr32 3 er4
|
||||
test_h_gr32 2 er5
|
||||
test_h_gr32 1 er6
|
||||
test_h_gr32 _stack+16, er7
|
||||
|
||||
ldm_4reg:
|
||||
set_grs_a5a5
|
||||
mov #_stack+4, er7
|
||||
|
||||
set_ccr_zero
|
||||
ldm @sp+, er0-er3
|
||||
test_cc_clear
|
||||
|
||||
test_h_gr32 4 er0
|
||||
test_h_gr32 3 er1
|
||||
test_h_gr32 2 er2
|
||||
test_h_gr32 1 er3
|
||||
test_gr_a5a5 4 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_h_gr32 _stack+20, er7
|
||||
.endif
|
||||
|
||||
.if (sim_cpu == h8300)
|
||||
set_grs_a5a5
|
||||
mov #_stack_top, r7
|
||||
mov #12, r1
|
||||
mov #34, r2
|
||||
mov #56, r3
|
||||
push r1
|
||||
push r2
|
||||
push r3
|
||||
pop r4
|
||||
pop r5
|
||||
pop r6
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general _reg_ not disturbed
|
||||
test_h_gr16 12 r1
|
||||
test_h_gr16 34 r2
|
||||
test_h_gr16 56 r3
|
||||
test_h_gr16 56 r4
|
||||
test_h_gr16 34 r5
|
||||
test_h_gr16 12 r6
|
||||
mov #_stack_top, r0
|
||||
cmp.w r0, r7
|
||||
bne fail1
|
||||
.else
|
||||
pushpop:
|
||||
set_grs_a5a5
|
||||
mov #_stack_top, er7
|
||||
mov #12, er1
|
||||
mov #34, er2
|
||||
mov #56, er3
|
||||
push er1
|
||||
push er2
|
||||
push er3
|
||||
pop er4
|
||||
pop er5
|
||||
pop er6
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general _reg_ not disturbed
|
||||
test_h_gr32 12 er1
|
||||
test_h_gr32 34 er2
|
||||
test_h_gr32 56 er3
|
||||
test_h_gr32 56 er4
|
||||
test_h_gr32 34 er5
|
||||
test_h_gr32 12 er6
|
||||
test_h_gr32 _stack_top, er7
|
||||
.endif
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
||||
|
||||
fail1: fail
|
209
sim/testsuite/sim/h8300/mova.s
Normal file
209
sim/testsuite/sim/h8300/mova.s
Normal file
|
@ -0,0 +1,209 @@
|
|||
# Hitachi H8 testcase 'mova'
|
||||
# mach(): h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
movabl16_reg8:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/b.l @(1:16, r2l.b), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0xa6 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movabl16_reg16:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/b.l @(1:16, r2.w), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0xa5a6 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movabl32_reg8:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/b.l @(1:32, r2l.b), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0xa6 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movabl32_reg16:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/b.l @(1:32, r2.w), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0xa5a6 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movawl16_reg8:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/w.l @(1:16, r2l.b), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x14b er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movawl16_reg16:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/w.l @(1:16, r2.w), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x14b4b er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movawl32_reg8:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/w.l @(1:32, r2l.b), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x14b er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movawl32_reg16:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/w.l @(1:32, r2.w), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x14b4b er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movall16_reg8:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/l.l @(1:16, r2l.b), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x295 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movall16_reg16:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/l.l @(1:16, r2.w), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x29695 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movall32_reg8:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/l.l @(1:32, r2l.b), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x295 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
movall32_reg16:
|
||||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mova/l.l @(1:32, r2.w), er3
|
||||
|
||||
test_cc_clear
|
||||
test_gr_a5a5 0 ; Make sure other regs not affected
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_h_gr32 0x29695 er3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
2221
sim/testsuite/sim/h8300/movb.s
Normal file
2221
sim/testsuite/sim/h8300/movb.s
Normal file
File diff suppressed because it is too large
Load diff
2160
sim/testsuite/sim/h8300/movl.s
Normal file
2160
sim/testsuite/sim/h8300/movl.s
Normal file
File diff suppressed because it is too large
Load diff
1857
sim/testsuite/sim/h8300/movw.s
Normal file
1857
sim/testsuite/sim/h8300/movw.s
Normal file
File diff suppressed because it is too large
Load diff
|
@ -547,8 +547,8 @@ neg_w_disp2dst:
|
|||
set_ccr_zero
|
||||
|
||||
;; neg.w @(dd:2, erd)
|
||||
mov #word_dest-1, er1
|
||||
neg.w @(1:2, er1) ; reg plus 2-bit displacement
|
||||
mov #word_dest-2, er1
|
||||
neg.w @(2:2, er1) ; reg plus 2-bit displacement
|
||||
;;; .word 0x0155
|
||||
;;; .word 0x6918
|
||||
;;; .word 0x1790
|
||||
|
@ -562,7 +562,7 @@ neg_w_disp2dst:
|
|||
beq .Lwdisp2
|
||||
fail
|
||||
.Lwdisp2:
|
||||
test_h_gr32 word_dest-1 er1 ; er1 contains address minus one
|
||||
test_h_gr32 word_dest-2 er1 ; er1 contains address minus one
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -872,8 +872,8 @@ neg_l_disp2dst:
|
|||
set_ccr_zero
|
||||
|
||||
;; neg.l @(dd:2, erd)
|
||||
mov #long_dest-1, er1
|
||||
neg.l @(1:2, er1) ; reg plus 2-bit displacement
|
||||
mov #long_dest-4, er1
|
||||
neg.l @(4:2, er1) ; reg plus 2-bit displacement
|
||||
;;; .word 0x0105
|
||||
;;; .word 0x6918
|
||||
;;; .word 0x17b0
|
||||
|
@ -887,7 +887,7 @@ neg_l_disp2dst:
|
|||
beq .Lldisp2
|
||||
fail
|
||||
.Lldisp2:
|
||||
test_h_gr32 long_dest-1 er1 ; er1 contains address minus one
|
||||
test_h_gr32 long_dest-4 er1 ; er1 contains address minus one
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
|
|
@ -538,8 +538,8 @@ not_w_disp2dst:
|
|||
set_ccr_zero
|
||||
|
||||
;; not.w @(dd:2, erd)
|
||||
mov #word_dest-1, er1
|
||||
not.w @(1:2, er1) ; reg plus 2-bit displacement
|
||||
mov #word_dest-2, er1
|
||||
not.w @(2:2, er1) ; reg plus 2-bit displacement
|
||||
;;; .word 0x0155
|
||||
;;; .word 0x6918
|
||||
;;; .word 0x1710
|
||||
|
@ -553,7 +553,7 @@ not_w_disp2dst:
|
|||
beq .Lwdisp2
|
||||
fail
|
||||
.Lwdisp2:
|
||||
test_h_gr32 word_dest-1 er1 ; er1 contains address minus one
|
||||
test_h_gr32 word_dest-2 er1 ; er1 contains address minus one
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -859,8 +859,8 @@ not_l_disp2dst:
|
|||
set_ccr_zero
|
||||
|
||||
;; not.l @(dd:2, erd)
|
||||
mov #long_dest-1, er1
|
||||
not.l @(1:2, er1) ; reg plus 2-bit displacement
|
||||
mov #long_dest-4, er1
|
||||
not.l @(4:2, er1) ; reg plus 2-bit displacement
|
||||
;;; .word 0x0105
|
||||
;;; .word 0x6918
|
||||
;;; .word 0x1730
|
||||
|
@ -874,7 +874,7 @@ not_l_disp2dst:
|
|||
beq .Lldisp2
|
||||
fail
|
||||
.Lldisp2:
|
||||
test_h_gr32 long_dest-1 er1 ; er1 contains address minus one
|
||||
test_h_gr32 long_dest-4 er1 ; er1 contains address minus one
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
|
493
sim/testsuite/sim/h8300/orb.s
Normal file
493
sim/testsuite/sim/h8300/orb.s
Normal file
|
@ -0,0 +1,493 @@
|
|||
# Hitachi H8 testcase 'or.b'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
# Instructions tested:
|
||||
# or.b #xx:8, rd ; c rd xxxxxxxx
|
||||
# or.b #xx:8, @erd ; 7 d rd ???? c ???? xxxxxxxx
|
||||
# or.b #xx:8, @erd+ ; 0 1 7 4 6 c rd 1??? c ???? xxxxxxxx
|
||||
# or.b #xx:8, @erd- ; 0 1 7 6 6 c rd 1??? c ???? xxxxxxxx
|
||||
# or.b #xx:8, @+erd ; 0 1 7 5 6 c rd 1??? c ???? xxxxxxxx
|
||||
# or.b #xx:8, @-erd ; 0 1 7 7 6 c rd 1??? c ???? xxxxxxxx
|
||||
# or.b rs, rd ; 1 4 rs rd
|
||||
# or.b reg8, @erd ; 7 d rd ???? 1 4 rs ????
|
||||
# or.b reg8, @erd+ ; 0 1 7 9 8 rd 4 rs
|
||||
# or.b reg8, @erd- ; 0 1 7 9 a rd 4 rs
|
||||
# or.b reg8, @+erd ; 0 1 7 9 9 rd 4 rs
|
||||
# or.b reg8, @-erd ; 0 1 7 9 b rd 4 rs
|
||||
#
|
||||
|
||||
# Coming soon:
|
||||
# ...
|
||||
|
||||
.data
|
||||
pre_byte: .byte 0
|
||||
byte_dest: .byte 0xa5
|
||||
post_byte: .byte 0
|
||||
|
||||
start
|
||||
|
||||
or_b_imm8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.b #xx:8,Rd
|
||||
or.b #0xaa, r0l ; Immediate 8-bit src, reg8 dest
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5af r0 ; or result: a5 | aa
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a5af er0 ; or result: a5 | aa
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
or_b_imm8_rdind:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b #xx:8,@eRd
|
||||
mov #byte_dest, er0
|
||||
or.b #0xaa:8, @er0 ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0xc0aa
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 still contains address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xaf, r0l
|
||||
beq .L1
|
||||
fail
|
||||
.L1:
|
||||
|
||||
or_b_imm8_rdpostinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b #xx:8,@eRd+
|
||||
mov #byte_dest, er0
|
||||
or.b #0x55:8, @er0+ ; Immediate 8-bit src, reg post-incr dest
|
||||
;;; .word 0x0174
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xc055
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 post_byte, er0 ; er0 contains address plus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xf5, r0l
|
||||
beq .L2
|
||||
fail
|
||||
.L2:
|
||||
|
||||
or_b_imm8_rdpostdec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b #xx:8,@eRd-
|
||||
mov #byte_dest, er0
|
||||
or.b #0xaa:8, @er0- ; Immediate 8-bit src, reg post-decr dest
|
||||
;;; .word 0x0176
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xc0aa
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 pre_byte, er0 ; er0 contains address minus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xaf, r0l
|
||||
beq .L3
|
||||
fail
|
||||
.L3:
|
||||
|
||||
or_b_imm8_rdpreinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b #xx:8,@+eRd
|
||||
mov #pre_byte, er0
|
||||
or.b #0x55:8, @+er0 ; Immediate 8-bit src, reg pre-incr dest
|
||||
;;; .word 0x0175
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xc055
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 contains destination address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xf5, r0l
|
||||
beq .L4
|
||||
fail
|
||||
.L4:
|
||||
|
||||
or_b_imm8_rdpredec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b #xx:8,@-eRd
|
||||
mov #post_byte, er0
|
||||
or.b #0xaa:8, @-er0 ; Immediate 8-bit src, reg pre-decr dest
|
||||
;;; .word 0x0177
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xc0aa
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 contains destination address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xaf, r0l
|
||||
beq .L5
|
||||
fail
|
||||
.L5:
|
||||
|
||||
|
||||
.endif
|
||||
|
||||
or_b_reg8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.b Rs,Rd
|
||||
mov.b #0xaa, r0h
|
||||
or.b r0h, r0l ; Reg8 src, reg8 dest
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xaaaf r0 ; or result: a5 | aa
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5aaaf er0 ; or result: a5 | aa
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
or_b_reg8_rdind:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b rs8,@eRd ; or reg8 to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #0xaa, r1l
|
||||
or.b r1l, @er0 ; reg8 src, reg indirect dest
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0x1490
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 still contains address
|
||||
test_h_gr32 0xa5a5a5aa er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xaf, r0l
|
||||
beq .L6
|
||||
fail
|
||||
.L6:
|
||||
|
||||
or_b_reg8_rdpostinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b rs8,@eRd+ ; or reg8 to register indirect post-increment
|
||||
mov #byte_dest, er0
|
||||
mov #0x55, r1l
|
||||
or.b r1l, @er0+ ; reg8 src, reg post-incr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x8049
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 post_byte er0 ; er0 contains address plus one
|
||||
test_h_gr32 0xa5a5a555 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xf5, r0l
|
||||
beq .L7
|
||||
fail
|
||||
.L7:
|
||||
|
||||
or_b_reg8_rdpostdec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b rs8,@eRd- ; or reg8 to register indirect post-decrement
|
||||
mov #byte_dest, er0
|
||||
mov #0xaa, r1l
|
||||
or.b r1l, @er0- ; reg8 src, reg post-decr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xa049
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 pre_byte er0 ; er0 contains address minus one
|
||||
test_h_gr32 0xa5a5a5aa er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xaf, r0l
|
||||
beq .L8
|
||||
fail
|
||||
.L8:
|
||||
|
||||
or_b_reg8_rdpreinc:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b rs8,@+eRd ; or reg8 to register indirect pre-increment
|
||||
mov #pre_byte, er0
|
||||
mov #0x55, r1l
|
||||
or.b r1l, @+er0 ; reg8 src, reg pre-incr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x9049
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 contains destination address
|
||||
test_h_gr32 0xa5a5a555 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xf5, r0l
|
||||
beq .L9
|
||||
fail
|
||||
.L9:
|
||||
|
||||
or_b_reg8_rdpredec:
|
||||
mov #byte_dest, er0
|
||||
mov.b #0xa5, r1l
|
||||
mov.b r1l, @er0
|
||||
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; or.b rs8,@-eRd ; or reg8 to register indirect pre-decrement
|
||||
mov #post_byte, er0
|
||||
mov #0xaa, r1l
|
||||
or.b r1l, @-er0 ; reg8 src, reg pre-decr dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xb049
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 contains destination address
|
||||
test_h_gr32 0xa5a5a5aa er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xaf, r0l
|
||||
beq .L10
|
||||
fail
|
||||
.L10:
|
||||
|
||||
orc_imm8_ccr:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; orc #xx:8,ccr
|
||||
|
||||
test_neg_clear
|
||||
orc #0x8, ccr ; Immediate 8-bit operand (neg flag)
|
||||
test_neg_set
|
||||
|
||||
test_zero_clear
|
||||
orc #0x4, ccr ; Immediate 8-bit operand (zero flag)
|
||||
test_zero_set
|
||||
|
||||
test_ovf_clear
|
||||
orc #0x2, ccr ; Immediate 8-bit operand (overflow flag)
|
||||
test_ovf_set
|
||||
|
||||
test_carry_clear
|
||||
orc #0x1, ccr ; Immediate 8-bit operand (carry flag)
|
||||
test_carry_set
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.endif
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
77
sim/testsuite/sim/h8300/orl.s
Normal file
77
sim/testsuite/sim/h8300/orl.s
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Hitachi H8 testcase 'or.l'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ; 16-bit immediate is only available on sx.
|
||||
or_l_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.l #xx:16,Rd
|
||||
or.l #0xaaaa, er0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xa5a5afaf er0 ; or result: a5a5a5a5 | aaaa
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
or_l_imm32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.l #xx:32,Rd
|
||||
or.l #0xaaaaaaaa, er0 ; Immediate 32-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xafafafaf er0 ; or result: a5a5a5a5 | aaaaaaaa
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
or_l_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.l Rs,Rd
|
||||
mov.l #0xaaaaaaaa, er1
|
||||
or.l er1, er0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xafafafaf er0 ; or result: a5a5a5a5 | aaaaaaaa
|
||||
test_h_gr32 0xaaaaaaaa er1 ; Make sure er1 is unchanged
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
61
sim/testsuite/sim/h8300/orw.s
Normal file
61
sim/testsuite/sim/h8300/orw.s
Normal file
|
@ -0,0 +1,61 @@
|
|||
# Hitachi H8 testcase 'or.w'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
or_w_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.w #xx:16,Rd
|
||||
or.w #0xaaaa, r0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xafaf r0 ; or result: a5a5 | aaaa
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5afaf er0 ; or result: a5a5 | aaaa
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
or_w_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; or.w Rs,Rd
|
||||
mov.w #0xaaaa, r1
|
||||
or.w r1, r0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xafaf r0 ; or result: a5a5 | aaaa
|
||||
test_h_gr16 0xaaaa r1 ; Make sure r1 is unchanged
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5afaf er0 ; or result: a5a5 | aaaa
|
||||
test_h_gr32 0xa5a5aaaa er1 ; Make sure er1 is unchanged
|
||||
.endif
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
|
@ -768,15 +768,15 @@ rotr_w_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
rotr.w @(2:2, er0) ; shift right arithmetic by one, disp2
|
||||
mov #word_dest-4, er0
|
||||
rotr.w @(4:2, er0) ; shift right arithmetic by one, disp2
|
||||
|
||||
test_carry_set ; H=0 N=1 Z=0 V=0 C=1
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1059,15 +1059,15 @@ rotr_w_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
rotr.w #2, @(2:2, er0) ; shift right arithmetic by two, disp2
|
||||
mov #word_dest-4, er0
|
||||
rotr.w #2, @(4:2, er0) ; shift right arithmetic by two, disp2
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1357,15 +1357,15 @@ rotr_l_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
rotr.l @(2:2, er0) ; shift right arithmetic by one, disp2
|
||||
mov #long_dest-8, er0
|
||||
rotr.l @(8:2, er0) ; shift right arithmetic by one, disp2
|
||||
|
||||
test_carry_set ; H=0 N=1 Z=0 V=0 C=1
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1660,15 +1660,15 @@ rotr_l_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
rotr.l #2, @(2:2, er0) ; shift right arithmetic by two, disp2
|
||||
mov #long_dest-8, er0
|
||||
rotr.l #2, @(8:2, er0) ; shift right arithmetic by two, disp2
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_zero_clear
|
||||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
|
|
@ -849,8 +849,8 @@ rotxr_w_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
rotxr.w @(2:2, er0) ; shift right arithmetic by one, disp2
|
||||
mov #word_dest-4, er0
|
||||
rotxr.w @(4:2, er0) ; shift right arithmetic by one, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0xa908
|
||||
;;; .word 0x1310
|
||||
|
@ -860,7 +860,7 @@ rotxr_w_disp2_1:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1172,8 +1172,8 @@ rotxr_w_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
rotxr.w #2, @(2:2, er0) ; shift right arithmetic by two, disp2
|
||||
mov #word_dest-4, er0
|
||||
rotxr.w #2, @(4:2, er0) ; shift right arithmetic by two, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0xa908
|
||||
;;; .word 0x1350
|
||||
|
@ -1183,7 +1183,7 @@ rotxr_w_disp2_2:
|
|||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1503,8 +1503,8 @@ rotxr_l_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
rotxr.l @(2:2, er0) ; shift right arithmetic by one, disp2
|
||||
mov #long_dest-8, er0
|
||||
rotxr.l @(8:2, er0) ; shift right arithmetic by one, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0xa908
|
||||
;;; .word 0x1330
|
||||
|
@ -1514,7 +1514,7 @@ rotxr_l_disp2_1:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1841,8 +1841,8 @@ rotxr_l_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
rotxr.l #2, @(2:2, er0) ; shift right arithmetic by two, disp2
|
||||
mov #long_dest-8, er0
|
||||
rotxr.l #2, @(8:2, er0) ; shift right arithmetic by two, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0xa908
|
||||
;;; .word 0x1370
|
||||
|
@ -1852,7 +1852,7 @@ rotxr_l_disp2_2:
|
|||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
|
|
@ -847,8 +847,8 @@ shar_w_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
shar.w @(2:2, er0) ; shift right arithmetic by one, disp2
|
||||
mov #word_dest-4, er0
|
||||
shar.w @(4:2, er0) ; shift right arithmetic by one, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1190
|
||||
|
@ -858,7 +858,7 @@ shar_w_disp2_1:
|
|||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1170,8 +1170,8 @@ shar_w_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
shar.w #2, @(2:2, er0) ; shift right arithmetic by two, disp2
|
||||
mov #word_dest-4, er0
|
||||
shar.w #2, @(4:2, er0) ; shift right arithmetic by two, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x11d0
|
||||
|
@ -1181,7 +1181,7 @@ shar_w_disp2_2:
|
|||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1501,8 +1501,8 @@ shar_l_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shar.l @(2:2, er0) ; shift right arithmetic by one, disp2
|
||||
mov #long_dest-8, er0
|
||||
shar.l @(8:2, er0) ; shift right arithmetic by one, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x11b0
|
||||
|
@ -1512,7 +1512,7 @@ shar_l_disp2_1:
|
|||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1839,8 +1839,8 @@ shar_l_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shar.l #2, @(2:2, er0) ; shift right arithmetic by two, disp2
|
||||
mov #long_dest-8, er0
|
||||
shar.l #2, @(8:2, er0) ; shift right arithmetic by two, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x11f0
|
||||
|
@ -1850,7 +1850,7 @@ shar_l_disp2_2:
|
|||
test_ovf_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
|
|
@ -1194,8 +1194,8 @@ shlr_w_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
shlr.w @(2:2, er0) ; shift right logical by one, disp2
|
||||
mov #word_dest-4, er0
|
||||
shlr.w @(4:2, er0) ; shift right logical by one, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1110
|
||||
|
@ -1205,7 +1205,7 @@ shlr_w_disp2_1:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1517,8 +1517,8 @@ shlr_w_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
shlr.w #2, @(2:2, er0) ; shift right logical by two, disp2
|
||||
mov #word_dest-4, er0
|
||||
shlr.w #2, @(4:2, er0) ; shift right logical by two, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1150
|
||||
|
@ -1528,7 +1528,7 @@ shlr_w_disp2_2:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -1838,8 +1838,8 @@ shlr_w_disp2_4:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
shlr.w #4, @(2:2, er0) ; shift right logical by four, disp2
|
||||
mov #word_dest-4, er0
|
||||
shlr.w #4, @(4:2, er0) ; shift right logical by four, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1120
|
||||
|
@ -1849,7 +1849,7 @@ shlr_w_disp2_4:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -2159,8 +2159,8 @@ shlr_w_disp2_8:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #word_dest-2, er0
|
||||
shlr.w #8, @(2:2, er0) ; shift right logical by eight, disp2
|
||||
mov #word_dest-4, er0
|
||||
shlr.w #8, @(4:2, er0) ; shift right logical by eight, disp2
|
||||
;;; .word 0x0156
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1160
|
||||
|
@ -2170,7 +2170,7 @@ shlr_w_disp2_8:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 word_dest-2 er0
|
||||
test_h_gr32 word_dest-4 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -2515,8 +2515,8 @@ shlr_l_disp2_1:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shlr.l @(2:2, er0) ; shift right logical by one, disp2
|
||||
mov #long_dest-8, er0
|
||||
shlr.l @(8:2, er0) ; shift right logical by one, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1130
|
||||
|
@ -2526,7 +2526,7 @@ shlr_l_disp2_1:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -2853,8 +2853,8 @@ shlr_l_disp2_2:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shlr.l #2, @(2:2, er0) ; shift right logical by two, disp2
|
||||
mov #long_dest-8, er0
|
||||
shlr.l #2, @(8:2, er0) ; shift right logical by two, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1170
|
||||
|
@ -2864,7 +2864,7 @@ shlr_l_disp2_2:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -3188,8 +3188,8 @@ shlr_l_disp2_4:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shlr.l #4, @(2:2, er0) ; shift right logical by four, disp2
|
||||
mov #long_dest-8, er0
|
||||
shlr.l #4, @(8:2, er0) ; shift right logical by four, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1138
|
||||
|
@ -3199,7 +3199,7 @@ shlr_l_disp2_4:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -3523,8 +3523,8 @@ shlr_l_disp2_8:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shlr.l #8, @(2:2, er0) ; shift right logical by eight, disp2
|
||||
mov #long_dest-8, er0
|
||||
shlr.l #8, @(8:2, er0) ; shift right logical by eight, disp2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x1178
|
||||
|
@ -3534,7 +3534,7 @@ shlr_l_disp2_8:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
@ -3858,8 +3858,8 @@ shlr_l_disp2_16:
|
|||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
mov #long_dest-2, er0
|
||||
shlr.l #16, @(2:2, er0) ; shift right logical by 16, dest2
|
||||
mov #long_dest-8, er0
|
||||
shlr.l #16, @(8:2, er0) ; shift right logical by 16, dest2
|
||||
;;; .word 0x0106
|
||||
;;; .word 0x6908
|
||||
;;; .word 0x11f8
|
||||
|
@ -3869,7 +3869,7 @@ shlr_l_disp2_16:
|
|||
test_ovf_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 long_dest-2 er0
|
||||
test_h_gr32 long_dest-8 er0
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
|
|
|
@ -12,28 +12,40 @@
|
|||
.data
|
||||
byte_dest1:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest2:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest3:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest4:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest5:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest6:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest7:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest8:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest9:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest10:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest11:
|
||||
.byte 0
|
||||
.byte 0
|
||||
byte_dest12:
|
||||
.byte 0
|
||||
.byte 0
|
||||
|
||||
start
|
||||
|
||||
|
@ -144,11 +156,11 @@ stc_ccr_disp16:
|
|||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mov #byte_dest4, er1
|
||||
mov #byte_dest5-1, er1
|
||||
ldc #0xff, ccr
|
||||
stc ccr, @(1:16,er1) ; disp16 dest (5)
|
||||
|
||||
test_h_gr32 byte_dest4, er1 ; er1 still contains address
|
||||
test_h_gr32 byte_dest5-1, er1 ; er1 still contains address
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
|
@ -162,11 +174,11 @@ stc_exr_disp16:
|
|||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mov #byte_dest7, er1
|
||||
mov #byte_dest6+1, er1
|
||||
ldc #0x87, exr
|
||||
stc exr, @(-1:16,er1) ; disp16 dest (6)
|
||||
|
||||
test_h_gr32 byte_dest7, er1 ; er1 still contains address
|
||||
test_h_gr32 byte_dest6+1, er1 ; er1 still contains address
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
|
@ -180,11 +192,11 @@ stc_ccr_disp32:
|
|||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mov #byte_dest6, er1
|
||||
mov #byte_dest7-1, er1
|
||||
ldc #0xff, ccr
|
||||
stc ccr, @(1:32,er1) ; disp32 dest (7)
|
||||
|
||||
test_h_gr32 byte_dest6, er1 ; er1 still contains address
|
||||
test_h_gr32 byte_dest7-1, er1 ; er1 still contains address
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
|
@ -198,11 +210,11 @@ stc_exr_disp32:
|
|||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mov #byte_dest9, er1
|
||||
mov #byte_dest8+1, er1
|
||||
ldc #0x87, exr
|
||||
stc exr, @(-1:32,er1) ; disp16 dest (8)
|
||||
|
||||
test_h_gr32 byte_dest9, er1 ; er1 still contains address
|
||||
test_h_gr32 byte_dest8+1, er1 ; er1 still contains address
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
|
@ -215,11 +227,11 @@ stc_ccr_predecr:
|
|||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mov #byte_dest10, er1
|
||||
mov #byte_dest9+2, er1
|
||||
ldc #0xff, ccr
|
||||
stc ccr, @-er1 ; predecr dest (9)
|
||||
|
||||
test_h_gr32 byte_dest9, er1 ; er1 still contains address
|
||||
test_h_gr32 byte_dest9 er1 ; er1 still contains address
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
|
@ -233,7 +245,7 @@ stc_exr_predecr:
|
|||
set_grs_a5a5
|
||||
set_ccr_zero
|
||||
|
||||
mov #byte_dest11, er1
|
||||
mov #byte_dest10+2, er1
|
||||
ldc #0x87, exr
|
||||
stc exr, @-er1 ; predecr dest (10)
|
||||
|
||||
|
|
289
sim/testsuite/sim/h8300/subb.s
Normal file
289
sim/testsuite/sim/h8300/subb.s
Normal file
|
@ -0,0 +1,289 @@
|
|||
# Hitachi H8 testcase 'sub.b'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
# Instructions tested:
|
||||
# sub.b #xx:8, rd ; <illegal>
|
||||
# sub.b #xx:8, @erd ; 7 d rd ???? a ???? xxxxxxxx
|
||||
# sub.b #xx:8, @erd+ ; 0 1 7 4 6 c rd 1??? a ???? xxxxxxxx
|
||||
# sub.b #xx:8, @erd- ; 0 1 7 6 6 c rd 1??? a ???? xxxxxxxx
|
||||
# sub.b rs, rd ; 1 8 rs rd
|
||||
# sub.b reg8, @erd ; 7 d rd ???? 1 8 rs ????
|
||||
# sub.b reg8, @erd+ ; 0 1 7 9 8 rd 3 rs
|
||||
# sub.b reg8, @erd- ; 0 1 7 9 a rd 3 rs
|
||||
#
|
||||
|
||||
# Coming soon:
|
||||
# sub.b #xx:8, @+erd ; 0 1 7 5 6 c rd 1??? a ???? xxxxxxxx
|
||||
# sub.b #xx:8, @-erd ; 0 1 7 7 6 c rd 1??? a ???? xxxxxxxx
|
||||
# sub.b reg8, @+erd ; 0 1 7 9 9 rd 3 rs
|
||||
# sub.b reg8, @-erd ; 0 1 7 9 b rd 3 rs
|
||||
# ...
|
||||
|
||||
.data
|
||||
pre_byte: .byte 0
|
||||
byte_dest: .byte 0xa5
|
||||
post_byte: .byte 0
|
||||
|
||||
start
|
||||
|
||||
.if (0) ; Guess what? Sub.b immediate reg8 is illegal!
|
||||
sub_b_imm8_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.b #xx:8,Rd
|
||||
sub.b #5, r0l ; Immediate 8-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa5a0 r0 ; sub result: a5 - 5
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a5a0 er0 ; sub result: a5 - 5
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
sub_b_imm8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; sub.b #xx:8,@eRd
|
||||
mov #byte_dest, er0
|
||||
sub.b #5:8, @er0 ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0xa105
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 still contains address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the sub to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa0, r0l
|
||||
beq .L1
|
||||
fail
|
||||
.L1:
|
||||
|
||||
sub_b_imm8_rdpostinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; sub.b #xx:8,@eRd+
|
||||
mov #byte_dest, er0
|
||||
sub.b #5:8, @er0+ ; Immediate 8-bit src, reg post-incr dest
|
||||
;;; .word 0x0174
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xa105
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 post_byte, er0 ; er0 still contains address plus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the sub to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x9b, r0l
|
||||
beq .L2
|
||||
fail
|
||||
.L2:
|
||||
|
||||
sub_b_imm8_rdpostdec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; sub.b #xx:8,@eRd-
|
||||
mov #byte_dest, er0
|
||||
sub.b #5:8, @er0- ; Immediate 8-bit src, reg post-decr dest
|
||||
;;; .word 0x0176
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xa105
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 pre_byte, er0 ; er0 still contains address minus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the sub to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x96, r0l
|
||||
beq .L3
|
||||
fail
|
||||
.L3:
|
||||
|
||||
.endif
|
||||
|
||||
sub_b_reg8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.b Rs,Rd
|
||||
mov.b #5, r0h
|
||||
sub.b r0h, r0l ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0x05a0 r0 ; sub result: a5 - 5
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a505a0 er0 ; sub result: a5 - 5
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
sub_b_reg8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; sub.b rs8,@eRd ; Subx to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #5, r1l
|
||||
sub.b r1l, @er0 ; reg8 src, reg indirect dest
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0x1890
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 still contains address
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the sub to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x91, r0l
|
||||
beq .L4
|
||||
fail
|
||||
.L4:
|
||||
|
||||
sub_b_reg8_rdpostinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; sub.b rs8,@eRd+ ; Subx to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #5, r1l
|
||||
sub.b r1l, @er0+ ; reg8 src, reg indirect dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x8039
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 post_byte er0 ; er0 still contains address plus one
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the sub to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x8c, r0l
|
||||
beq .L5
|
||||
fail
|
||||
.L5:
|
||||
|
||||
sub_b_reg8_rdpostdec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; sub.b rs8,@eRd- ; Subx to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #5, r1l
|
||||
sub.b r1l, @er0- ; reg8 src, reg indirect dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xa039
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 pre_byte er0 ; er0 still contains address minus one
|
||||
test_h_gr32 0xa5a5a505 er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the sub to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x87, r0l
|
||||
beq .L6
|
||||
fail
|
||||
.L6:
|
||||
|
||||
.endif
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
91
sim/testsuite/sim/h8300/subl.s
Normal file
91
sim/testsuite/sim/h8300/subl.s
Normal file
|
@ -0,0 +1,91 @@
|
|||
# Hitachi H8 testcase 'sub.l'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ;
|
||||
sub_l_imm3: ; 3-bit immediate mode only for h8sx
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.l #xx:3,eRd ; Immediate 3-bit operand
|
||||
sub.l #7:3, er0
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr32 0xa5a5a59e er0 ; sub result: a5a5 - 7
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
sub_l_imm16: ; sub immediate 16-bit value
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.l #xx:16,eRd ; Immediate 16-bit operand
|
||||
sub.l #0x1111:16, er0
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0x9494 r0 ; sub result: a5a5 - 1111
|
||||
test_h_gr32 0xa5a59494 er0 ; sub result: a5a5 - 1111
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.endif
|
||||
|
||||
sub_l_imm32:
|
||||
;; sub.l immediate not available in h8300 mode.
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.l #xx:32,Rd
|
||||
sub.l #0x11111111, er0 ; Immediate 32-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr32 0x94949494 er0 ; sub result: a5a5a5a5 - 11111111
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
sub.l.reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; add.l Rs,Rd
|
||||
mov.l #0x11111111, er1
|
||||
sub.l er1, er0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr32 0x94949494 er0 ; sub result: a5a5a5a5 - 11111111
|
||||
test_h_gr32 0x11111111 er1
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
78
sim/testsuite/sim/h8300/subw.s
Normal file
78
sim/testsuite/sim/h8300/subw.s
Normal file
|
@ -0,0 +1,78 @@
|
|||
# Hitachi H8 testcase 'sub.w'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
.if (sim_cpu == h8sx) ; 3-bit immediate mode only for h8sx
|
||||
sub_w_imm3: ; sub.w immediate not available in h8300 mode.
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.w #xx:3,Rd ; Immediate 3-bit operand
|
||||
sub.w #7:3, r0
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa59e r0 ; sub result: a5a5 - 7
|
||||
test_h_gr32 0xa5a5a59e er0 ; sub result: a5a5 - 7
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
sub_w_imm16: ; sub.w immediate not available in h8300 mode.
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.w #xx:16,Rd
|
||||
sub.w #0x111, r0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa494 r0 ; sub result: a5a5 - 111
|
||||
test_h_gr32 0xa5a5a494 er0 ; sub result: a5a5 - 111
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
sub.w.reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; sub.w Rs,Rd
|
||||
mov.w #0x111, r1
|
||||
sub.w r1, r0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa494 r0 ; sub result: a5a5 - 111
|
||||
test_h_gr16 0x0111 r1
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a494 er0 ; sub result: a5a5 - 111
|
||||
test_h_gr32 0xa5a50111 er1
|
||||
.endif
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
327
sim/testsuite/sim/h8300/xorb.s
Normal file
327
sim/testsuite/sim/h8300/xorb.s
Normal file
|
@ -0,0 +1,327 @@
|
|||
# Hitachi H8 testcase 'xor.b'
|
||||
# mach(): all
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
# Instructions tested:
|
||||
# xor.b #xx:8, rd ; d rd xxxxxxxx
|
||||
# xor.b #xx:8, @erd ; 7 d rd ???? d ???? xxxxxxxx
|
||||
# xor.b #xx:8, @erd+ ; 0 1 7 4 6 c rd 1??? d ???? xxxxxxxx
|
||||
# xor.b #xx:8, @erd- ; 0 1 7 6 6 c rd 1??? d ???? xxxxxxxx
|
||||
# xor.b #xx:8, @+erd ; 0 1 7 5 6 c rd 1??? d ???? xxxxxxxx
|
||||
# xor.b #xx:8, @-erd ; 0 1 7 7 6 c rd 1??? d ???? xxxxxxxx
|
||||
# xor.b rs, rd ; 1 5 rs rd
|
||||
# xor.b reg8, @erd ; 7 d rd ???? 1 5 rs ????
|
||||
# xor.b reg8, @erd+ ; 0 1 7 9 8 rd 5 rs
|
||||
# xor.b reg8, @erd- ; 0 1 7 9 a rd 5 rs
|
||||
# xor.b reg8, @+erd ; 0 1 7 9 9 rd 5 rs
|
||||
# xor.b reg8, @-erd ; 0 1 7 9 b rd 5 rs
|
||||
#
|
||||
|
||||
# Coming soon:
|
||||
# ...
|
||||
|
||||
.data
|
||||
pre_byte: .byte 0
|
||||
byte_dest: .byte 0xa5
|
||||
post_byte: .byte 0
|
||||
|
||||
start
|
||||
|
||||
xor_b_imm8_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.b #xx:8,Rd
|
||||
xor.b #0xff, r0l ; Immediate 8-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xa55a r0 ; xor result: a5 ^ ff
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5a55a er0 ; xor result: a5 ^ ff
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
xor_b_imm8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xor.b #xx:8,@eRd
|
||||
mov #byte_dest, er0
|
||||
xor.b #0xff:8, @er0 ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0xd0ff
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 byte_dest, er0 ; er0 still contains address
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the xor to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x5a, r0l
|
||||
beq .L1
|
||||
fail
|
||||
.L1:
|
||||
|
||||
xor_b_imm8_postinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xor.b #xx:8,@eRd+
|
||||
mov #byte_dest, er0
|
||||
xor.b #0xff:8, @er0+ ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x0174
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xd0ff
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 post_byte, er0 ; er0 contains address plus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the xor to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa5, r0l
|
||||
beq .L2
|
||||
fail
|
||||
.L2:
|
||||
|
||||
xor_b_imm8_rdpostdec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xor.b #xx:8,@eRd-
|
||||
mov #byte_dest, er0
|
||||
xor.b #0xff:8, @er0- ; Immediate 8-bit src, reg indirect dst
|
||||
;;; .word 0x0176
|
||||
;;; .word 0x6c08
|
||||
;;; .word 0xd0ff
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 pre_byte, er0 ; er0 contains address minus one
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the xor to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x5a, r0l
|
||||
beq .L3
|
||||
fail
|
||||
.L3:
|
||||
|
||||
|
||||
.endif
|
||||
|
||||
xor_b_reg8_reg8:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.b Rs,Rd
|
||||
mov.b #0xff, r0h
|
||||
xor.b r0h, r0l ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0xff5a r0 ; xor result: a5 ^ ff
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a5ff5a er0 ; xor result: a5 ^ ff
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.if (sim_cpu == h8sx)
|
||||
xor_b_reg8_rdind:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xor.b rs8,@eRd ; xor reg8 to register indirect
|
||||
mov #byte_dest, er0
|
||||
mov #0xff, r1l
|
||||
xor.b r1l, @er0 ; reg8 src, reg indirect dest
|
||||
;;; .word 0x7d00
|
||||
;;; .word 0x1590
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 byte_dest er0 ; er0 still contains address
|
||||
test_h_gr32 0xa5a5a5ff er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa5, r0l
|
||||
beq .L4
|
||||
fail
|
||||
.L4:
|
||||
|
||||
xor_b_reg8_rdpostinc:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xor.b rs8,@eRd+ ; xor reg8 to register post-increment
|
||||
mov #byte_dest, er0
|
||||
mov #0xff, r1l
|
||||
xor.b r1l, @er0+ ; reg8 src, reg post-increment dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0x8059
|
||||
|
||||
test_carry_clear ; H=0 N=0 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_clear
|
||||
|
||||
test_h_gr32 post_byte er0 ; er0 contains address plus one
|
||||
test_h_gr32 0xa5a5a5ff er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0x5a, r0l
|
||||
beq .L5
|
||||
fail
|
||||
.L5:
|
||||
|
||||
xor_b_reg8_rdpostdec:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xor.b rs8,@eRd- ; xor reg8 to register post-decrement
|
||||
mov #byte_dest, er0
|
||||
mov #0xff, r1l
|
||||
xor.b r1l, @er0- ; reg8 src, reg indirect dest
|
||||
;;; .word 0x0179
|
||||
;;; .word 0xa059
|
||||
|
||||
test_carry_clear ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_ovf_clear
|
||||
test_zero_clear
|
||||
test_neg_set
|
||||
|
||||
test_h_gr32 pre_byte er0 ; er0 contains address minus one
|
||||
test_h_gr32 0xa5a5a5ff er1 ; er1 has the test load
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
;; Now check the result of the or to memory.
|
||||
sub.b r0l, r0l
|
||||
mov.b @byte_dest, r0l
|
||||
cmp.b #0xa5, r0l
|
||||
beq .L6
|
||||
fail
|
||||
.L6:
|
||||
|
||||
xorc_imm8_ccr:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
set_ccr_zero
|
||||
|
||||
;; xorc #xx:8,ccr
|
||||
|
||||
test_neg_clear
|
||||
xorc #0x8, ccr ; Immediate 8-bit operand (neg flag)
|
||||
test_neg_set
|
||||
xorc #0x8, ccr
|
||||
test_neg_clear
|
||||
|
||||
test_zero_clear
|
||||
xorc #0x4, ccr ; Immediate 8-bit operand (zero flag)
|
||||
test_zero_set
|
||||
xorc #0x4, ccr
|
||||
test_zero_clear
|
||||
|
||||
test_ovf_clear
|
||||
xorc #0x2, ccr ; Immediate 8-bit operand (overflow flag)
|
||||
test_ovf_set
|
||||
xorc #0x2, ccr
|
||||
test_ovf_clear
|
||||
|
||||
test_carry_clear
|
||||
xorc #0x1, ccr ; Immediate 8-bit operand (carry flag)
|
||||
test_carry_set
|
||||
xorc #0x1, ccr
|
||||
test_carry_clear
|
||||
|
||||
test_gr_a5a5 0 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 1
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
.endif
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
77
sim/testsuite/sim/h8300/xorl.s
Normal file
77
sim/testsuite/sim/h8300/xorl.s
Normal file
|
@ -0,0 +1,77 @@
|
|||
# Hitachi H8 testcase 'xor.l'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu == h8sx) ; 16-bit immediate is only available on sx.
|
||||
xor_l_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.l #xx:16,Rd
|
||||
xor.l #0xffff:16, er0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0xa5a55a5a er0 ; xor result: a5a5a5a5 | ffff
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
xor_l_imm32:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.l #xx:32,Rd
|
||||
xor.l #0xffffffff, er0 ; Immediate 32-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0x5a5a5a5a er0 ; xor result: a5a5a5a5 ^ ffffffff
|
||||
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
xor_l_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.l Rs,Rd
|
||||
mov.l #0xffffffff, er1
|
||||
xor.l er1, er0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
|
||||
test_h_gr32 0x5a5a5a5a er0 ; xor result: a5a5a5a5 ^ ffffffff
|
||||
test_h_gr32 0xffffffff er1 ; Make sure er1 is unchanged
|
||||
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
61
sim/testsuite/sim/h8300/xorw.s
Normal file
61
sim/testsuite/sim/h8300/xorw.s
Normal file
|
@ -0,0 +1,61 @@
|
|||
# Hitachi H8 testcase 'xor.w'
|
||||
# mach(): h8300h h8300s h8sx
|
||||
# as(h8300): --defsym sim_cpu=0
|
||||
# as(h8300h): --defsym sim_cpu=1
|
||||
# as(h8300s): --defsym sim_cpu=2
|
||||
# as(h8sx): --defsym sim_cpu=3
|
||||
# ld(h8300h): -m h8300helf
|
||||
# ld(h8300s): -m h8300self
|
||||
# ld(h8sx): -m h8300sxelf
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
xor_w_imm16:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.w #xx:16,Rd
|
||||
xor.w #0xffff, r0 ; Immediate 16-bit operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0x5a5a r0 ; xor result: a5a5 ^ ffff
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a55a5a er0 ; xor result: a5a5 ^ ffff
|
||||
.endif
|
||||
test_gr_a5a5 1 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 2
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
.endif
|
||||
|
||||
xor_w_reg:
|
||||
set_grs_a5a5 ; Fill all general regs with a fixed pattern
|
||||
;; fixme set ccr
|
||||
|
||||
;; xor.w Rs,Rd
|
||||
mov.w #0xffff, r1
|
||||
xor.w r1, r0 ; Register operand
|
||||
|
||||
;; fixme test ccr ; H=0 N=1 Z=0 V=0 C=0
|
||||
test_h_gr16 0x5a5a r0 ; xor result: a5a5 ^ ffff
|
||||
test_h_gr16 0xffff r1 ; Make sure r1 is unchanged
|
||||
.if (sim_cpu) ; non-zero means h8300h, s, or sx
|
||||
test_h_gr32 0xa5a55a5a er0 ; xor result: a5a5 ^ ffff
|
||||
test_h_gr32 0xa5a5ffff er1 ; Make sure er1 is unchanged
|
||||
.endif
|
||||
test_gr_a5a5 2 ; Make sure other general regs not disturbed
|
||||
test_gr_a5a5 3
|
||||
test_gr_a5a5 4
|
||||
test_gr_a5a5 5
|
||||
test_gr_a5a5 6
|
||||
test_gr_a5a5 7
|
||||
|
||||
pass
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue