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

Subversion Repositories openrisc_me

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [sim/] [testsuite/] [sim/] [sh64/] [compact/] [macw.cgs] - Diff between revs 24 and 33

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

Rev 24 Rev 33
# sh testcase for mac.w @${rm}+, @${rn}+
# sh testcase for mac.w @${rm}+, @${rn}+
# mach: all
# mach: all
# as: -isa=shcompact
# as: -isa=shcompact
# ld: -m shelf32
# ld: -m shelf32
        .include "compact/testutils.inc"
        .include "compact/testutils.inc"
        start
        start
        # Store some magic numbers in memory.
        # Store some magic numbers in memory.
        mov #40, r1
        mov #40, r1
        shll8 r1
        shll8 r1
        mov #85, r0
        mov #85, r0
        mov.l r0, @r1
        mov.l r0, @r1
        # Keep for later.
        # Keep for later.
        mov r1, r10
        mov r1, r10
store2:
store2:
        mov #40, r1
        mov #40, r1
        shll8 r1
        shll8 r1
        add #12, r1
        add #12, r1
        mov #17, r0
        mov #17, r0
        mov.l r0, @r1
        mov.l r0, @r1
        # Keep for later.
        # Keep for later.
        mov r1, r11
        mov r1, r11
init:
init:
        # Set up addresses.
        # Set up addresses.
        mov #40, r1
        mov #40, r1
        shll8 r1
        shll8 r1
        mov #40, r2
        mov #40, r2
        shll8 r2
        shll8 r2
        add #12, r2
        add #12, r2
        # Prime {MACL, MACH} to #1.
        # Prime {MACL, MACH} to #1.
        mov #1, r3
        mov #1, r3
        dmulu.l r3, r3
        dmulu.l r3, r3
test:
test:
        mac.w @r1+, @r2+
        mac.w @r1+, @r2+
check:
check:
        # Check result.
        # Check result.
        sts mach, r5
        sts mach, r5
        assert r5, #0
        assert r5, #0
        sts macl, r6
        sts macl, r6
        assert r6, #1
        assert r6, #1
        # Ensure post-increment occurred.
        # Ensure post-increment occurred.
        add #2, r10
        add #2, r10
        cmp/eq r10, r1
        cmp/eq r10, r1
        bf wrong
        bf wrong
        add #2, r11
        add #2, r11
        cmp/eq r11, r2
        cmp/eq r11, r2
        bf wrong
        bf wrong
doubleinc:
doubleinc:
        mov #40, r0
        mov #40, r0
        shll8 r0
        shll8 r0
        mov r0, r1
        mov r0, r1
        mac.w @r0+, @r0+
        mac.w @r0+, @r0+
        add #8, r1
        add #8, r1
        cmp/eq r0, r1
        cmp/eq r0, r1
        bf wrong
        bf wrong
okay:
okay:
        pass
        pass
wrong:
wrong:
        fail
        fail
 
 

powered by: WebSVN 2.1.0

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