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/] [neg.cgs] - Rev 157

Compare with Previous | Blame | View Log

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

        .include "compact/testutils.inc"

        .macro signbit sign
        shlr16 r1
        shlr8 r1
        shlr r1
        shlr r1
        shlr r1
        shlr r1
        shlr r1
        shlr r1
        shlr r1
        assert r1, \sign
        .endm
        start

        .global neg
neg:
        mov #0, r0
        neg r0, r1
        signbit #0

        mov #42, r0
        neg r0, r1
        signbit #1

        mov #0, r0
        or #25, r0
        neg r0, r1
        signbit #1

        # neg(0) is 0.
        mov #0, r0
        neg r0, r1
        signbit #0

        # neg(neg(x)) = x.
        mov #42, r0
        neg r0, r1
        signbit #1
        mov #42, r0
        neg r0, r2
        neg r2, r1
        signbit #0

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.