URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 157 |
Rev 223 |
# sh testcase for muls.w $rm, $rn -*- Asm -*-
|
# sh testcase for muls.w $rm, $rn -*- Asm -*-
|
# 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
|
|
|
sts mach, r7
|
sts mach, r7
|
|
|
.global mulsw
|
.global mulsw
|
zero:
|
zero:
|
mov #0, r0
|
mov #0, r0
|
mov #1, r1
|
mov #1, r1
|
muls.w r0, r1
|
muls.w r0, r1
|
|
|
# Check the result.
|
# Check the result.
|
sts macl, r3
|
sts macl, r3
|
mov #0, r4
|
mov #0, r4
|
cmp/eq r3, r4
|
cmp/eq r3, r4
|
bf wrong
|
bf wrong
|
|
|
sxs:
|
sxs:
|
# Small * small.
|
# Small * small.
|
mov #1, r0
|
mov #1, r0
|
mov #2, r1
|
mov #2, r1
|
muls.w r0, r1
|
muls.w r0, r1
|
|
|
# Check the result.
|
# Check the result.
|
sts macl, r3
|
sts macl, r3
|
mov #2, r4
|
mov #2, r4
|
cmp/eq r3, r4
|
cmp/eq r3, r4
|
bf wrong
|
bf wrong
|
|
|
sxl:
|
sxl:
|
# Small * large.
|
# Small * large.
|
mov #1, r0
|
mov #1, r0
|
mov #255, r1
|
mov #255, r1
|
shll8 r1
|
shll8 r1
|
muls.w r0, r1
|
muls.w r0, r1
|
|
|
# Check the result.
|
# Check the result.
|
sts macl, r3
|
sts macl, r3
|
mov #0, r4
|
mov #0, r4
|
not r4, r4
|
not r4, r4
|
shll8 r4
|
shll8 r4
|
cmp/eq r3, r4
|
cmp/eq r3, r4
|
bf wrong
|
bf wrong
|
|
|
lxs:
|
lxs:
|
# Large * small.
|
# Large * small.
|
mov #255, r0
|
mov #255, r0
|
shll8 r0
|
shll8 r0
|
mov #1, r1
|
mov #1, r1
|
muls.w r0, r1
|
muls.w r0, r1
|
|
|
# Check the result.
|
# Check the result.
|
sts macl, r3
|
sts macl, r3
|
mov #0, r4
|
mov #0, r4
|
not r4, r4
|
not r4, r4
|
shll8 r4
|
shll8 r4
|
cmp/eq r3, r4
|
cmp/eq r3, r4
|
bf wrong
|
bf wrong
|
|
|
lxl:
|
lxl:
|
# Large * large.
|
# Large * large.
|
mov #255, r0
|
mov #255, r0
|
shll8 r0
|
shll8 r0
|
mov #255, r1
|
mov #255, r1
|
shll8 r1
|
shll8 r1
|
muls.w r0, r1
|
muls.w r0, r1
|
|
|
# Check the result.
|
# Check the result.
|
sts macl, r3
|
sts macl, r3
|
mov #1, r4
|
mov #1, r4
|
shll16 r4
|
shll16 r4
|
cmp/eq r3, r4
|
cmp/eq r3, r4
|
bf wrong
|
bf wrong
|
|
|
invariant:
|
invariant:
|
# Ensure MACH is invariant.
|
# Ensure MACH is invariant.
|
sts mach, r8
|
sts mach, r8
|
cmp/eq r7, r8
|
cmp/eq r7, r8
|
bf wrong
|
bf wrong
|
|
|
okay:
|
okay:
|
pass
|
pass
|
|
|
wrong:
|
wrong:
|
fail
|
fail
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.