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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [testsuite/] [sim/] [sh64/] [compact/] [macl.cgs] - Rev 227

Compare with Previous | Blame | View Log

# sh testcase for mac.l @${rm}+, @${rn}+
# mach: all
# as: -isa=shcompact
# ld: -m shelf32

        .include "compact/testutils.inc"

        start
        # force S-bit clear
        clrs

        # Store some magic numbers in memory.
        mov #40, r1
        shll8 r1
        mov #85, r0
        mov.l r0, @r1
        # Keep for later.
        mov r1, r10
store2:
        mov #40, r1
        shll8 r1
        add #12, r1
        mov #17, r0
        mov.l r0, @r1
        # Keep for later.
        mov r1, r11

init:
        # Set up addresses.
        mov #40, r1
        shll8 r1
        mov #40, r2
        shll8 r2
        add #12, r2

        # Prime {MACL, MACH} to #1.
        mov #1, r3
        dmulu.l r3, r3

test:
        mac.l @r1+, @r2+

check:
        # Check result.
        sts mach, r5
        assert r5, #0

        mov #5, r0
        shll8 r0
        or #166, r0
        sts macl, r6
        cmp/eq r6, r0
        bf wrong

        # Ensure post-increment occurred.
        add #4, r10
        cmp/eq r10, r1
        bf wrong

        add #4, r11
        cmp/eq r11, r2
        bf wrong

doubleinc:
        mov #40, r0
        shll8 r0
        mov r0, r1
        mac.l @r0+, @r0+
        add #16, r1
        cmp/eq r0, r1
        bf wrong

okay:
        pass
wrong:
        fail

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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