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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [sim/] [testsuite/] [sim/] [sh64/] [compact/] [muluw.cgs] - Rev 437

Go to most recent revision | Compare with Previous | Blame | View Log

# sh testcase for mulu.w $rm, $rn -*- Asm -*-
# mach: all
# as: -isa=shcompact
# ld: -m shelf32

        .include "compact/testutils.inc"

        start

        sts mach, r7

        .global mulsw
zero:
        mov #0, r0
        mov #1, r1
        mulu.w r0, r1

        # Check the result.
        sts macl, r1
        mov #0, r0
        cmp/eq r0, r1
        bf wrong

sxs:
        # Small * small.
        mov #1, r0
        mov #2, r1
        mulu.w r0, r1

        # Check the result.
        sts macl, r1
        mov #2, r0
        cmp/eq r0, r1
        bf wrong

sxl:
        # Small * large.
        mov #1, r1
        mov #0, r0
        or #255, r0
        shll8 r0
        mulu.w r1, r0

        # Check the result.
        sts macl, r1
        mov #0, r0
        or #255, r0
        shll8 r0
        cmp/eq r0, r1
        bf wrong

lxs:
        # Large * small.
        mov #0, r0
        or #255, r0
        shll8 r0
        mov #1, r1
        mulu.w r0, r1

        # Check the result.
        sts macl, r1
        mov #0, r0
        or #255, r0
        shll8 r0
        cmp/eq r0, r1
        bf wrong

lxl:
        # Large * large.
        mov #0, r0
        or #255, r0
        shll8 r0
        mov r0, r1
        mulu.w r0, r1

        # Check the result.
        sts macl, r1
        mov #0, r0
        or #254, r0
        shll8 r0
        or #1, r0
        shll16 r0
        cmp/eq r0, r1
        bf wrong

invariant:
        # Ensure MACH is invariant.
        sts mach, r8
        cmp/eq r7, r8
        bf wrong

okay:
        pass

wrong:
        fail

Go to most recent revision | 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.