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/] [sub.cgs] - Rev 24

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

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

        .include "compact/testutils.inc"

        start

        .global sub1
sub1:
        # 0 - x.
        mov #0, r0
        mov #3, r1
        sub r1, r0

        mov #2, r7
        not r7, r7
        cmp/eq r7, r0
        bf wrong

        .global sub2
sub2:
        # x - 0.
        mov #0, r0
        mov #3, r1
        sub r0, r1
        assert r1, #3

        .global sub3
sub3:
        # x - y.
        mov #4, r0
        mov #3, r1
        sub r0, r1

        mov #0, r7
        not r7, r7
        cmp/eq r7, r1
        bf wrong

        .global sub4
sub4:
        # y - x.
        mov #4, r0
        mov #3, r1
        sub r1, r0
        assert r0, #1
        
        .global sub5
sub5:
        # y - y == 0 (where y are in two distinct registers).
        mov #4, r0
        mov #4, r1
        sub r1, r0
        assert r0, #0

        .global sub6
sub6:
        # y - y = 0 (where y is the same register).
        mov #4, r1
        sub r1, r1
        assert r1, #0

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.