URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc
- from Rev 115 to Rev 116
- ↔ Reverse comparison
Rev 115 → Rev 116
/trunk/or1ksim/cpu/or32/or32.c
304,7 → 304,7
EF (l_jr), OR32_IF_DELAY, it_jump}, |
{"l.jalr", "rB", "01 0x2 ----- ----- BBBB B--- ---- ----", |
EF (l_jalr), OR32_IF_DELAY, it_jump}, |
{"l.maci", "rA,I", "01 0x3 IIIII AAAAA ---- -III IIII IIII", |
{"l.maci", "rA,I", "01 0x3 ----- AAAAA IIII IIII IIII IIII", |
EF (l_mac), 0, it_mac}, |
{"l.cust1", "", "01 0xC ----- ----- ---- ---- ---- ----", |
EF (l_cust1), 0, it_unknown}, |
/trunk/or1ksim/cpu/or32/insnset.c
553,7 → 553,7
INSTRUCTION (l_mac) { |
uorreg_t lo, hi; |
LONGEST l; |
orreg_t x, y; |
orreg_t x, y, t; |
|
lo = cpu_state.sprs[SPR_MACLO]; |
hi = cpu_state.sprs[SPR_MACHI]; |
560,8 → 560,12
x = PARAM0; |
y = PARAM1; |
/* PRINTF ("[%"PRIxREG",%"PRIxREG"]\t", x, y); */ |
|
/* Compute the temporary as (signed) 32-bits, then sign-extend to 64 when |
adding in. */ |
l = (ULONGEST)lo | ((LONGEST)hi << 32); |
l += (LONGEST) x * (LONGEST) y; |
t = x * y; |
l += (LONGEST) t; |
|
/* This implementation is very fast - it needs only one cycle for mac. */ |
lo = ((ULONGEST)l) & 0xFFFFFFFF; |
593,15 → 597,11
/* PRINTF ("(%"PRIxREG",%"PRIxREG")\n", hi, lo); */ |
} |
INSTRUCTION (l_macrc) { |
uorreg_t lo, hi; |
LONGEST l; |
orreg_t lo; |
/* No need for synchronization here -- all MAC instructions are 1 cycle long. */ |
lo = cpu_state.sprs[SPR_MACLO]; |
hi = cpu_state.sprs[SPR_MACHI]; |
l = (ULONGEST) lo | ((LONGEST)hi << 32); |
l >>= 28; |
//PRINTF ("<%08x>\n", (unsigned long)l); |
SET_PARAM0((orreg_t)l); |
SET_PARAM0(lo); |
cpu_state.sprs[SPR_MACLO] = 0; |
cpu_state.sprs[SPR_MACHI] = 0; |
} |
/trunk/or1ksim/configure.ac
28,7 → 28,7
|
# Use a full version number (x.y.z, possibly with "rcn" as a suffix) when |
# preparing a release, otherwise use a the date version (yyyy-mm-dd). |
AC_INIT([or1ksim], [2010-06-09], [openrisc@opencores.org]) |
AC_INIT([or1ksim], [2010-06-11], [openrisc@opencores.org]) |
AC_CONFIG_MACRO_DIR([m4]) |
|
# Generically use extensions such as _GNU_SOURCE if available. |
/trunk/or1ksim/doc/or1ksim.info
64,7 → 64,7
Unpack the software and create a _separate_ directory in which to build |
it: |
|
tar jxf or1ksim-2010-06-09.tar.bz2 |
tar jxf or1ksim-2010-06-11.tar.bz2 |
mkdir builddir_or1ksim |
cd builddir_or1ksim |
|
81,7 → 81,7
OpenRISC 1000 32-bit architecture. If this argument is omitted, it will |
default to OpenRISC 1000 32-bit with a warning |
|
../or1ksim-2010-06-09/configure --target=or32-uclinux ... |
../or1ksim-2010-06-11/configure --target=or32-uclinux ... |
|
There are several other options available, many of which are standard |
to GNU `configure' scripts. Use `configure --help' to see all the |
248,7 → 248,7
============================= |
|
The following problems and issues are known about with Or1ksim |
2010-06-09. The OpenRISC tracker may be used to see the current state |
2010-06-11. The OpenRISC tracker may be used to see the current state |
of these issues and to raise new problems and feature requests. It may |
be found at `http://www.opencores.org/ptracker.cgi/view/or1k/398'. |
|
/trunk/or1ksim/doc/version.texi
1,4 → 1,4
@set UPDATED 9 June 2010 |
@set UPDATED-MONTH June 2010 |
@set EDITION 2010-06-09 |
@set VERSION 2010-06-09 |
@set EDITION 2010-06-11 |
@set VERSION 2010-06-11 |
/trunk/or1ksim/NEWS
11,6 → 11,7
* Bug 1770: l.div does not set carry or give correct exception. |
* Bug 1771: l.add* do not correctly set the overflow flag. |
* Bug 1772: l.fl1 not implemented. |
* Bug 1773: l.maci not correctly implemented. |
* Bug 1776: l.addic is not implemented. |
|
The following bugs are either cannot be reproduced or will not be fixed. |
/trunk/or1ksim/ChangeLog
1,5 → 1,11
2010-06-11 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* cpu/or32/insnset.c <l_maci>: Intermediate result computed as 32 |
bits, then sign extended. |
<l_macrc>: Computation corrected. |
* cpu/or32/or32.c <or32_opcodes>: l.maci bit pattern corrected. |
* NEWS: Updated with new bugs fixed. |
|
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* peripheral/Makefile.am: mc-defines.h added to sources. |
* cpu/or32/insnset.c <l_fl1>: New entry. |
* cpu/or32/or32.c <or32_opcodes>: l.fl1 enabled. |
* NEWS: Updated with new bugs fixed. |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/is-add-test.S
23,22 → 23,7
*/ |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions |
* |
* A simple rising stack is provided starting at _stack and pointed to by |
* r1. r1 points to the next free word. Only 32-bit registers may be pushed |
* onto the stack. |
* |
* Local labels up to 49 are reserved for macros. Each is used only once in |
* all macros. You can get in a serious mess if you get local label clashing |
* in macros. |
* |
* Arguments to functions are passed in r3 through r8. |
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* Coding conventions are described in inst-set-test.S |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/Makefile.in
59,7 → 59,8
build_triplet = @build@ |
host_triplet = @host@ |
check_PROGRAMS = is-add-test$(EXEEXT) is-div-test$(EXEEXT) \ |
is-find-test$(EXEEXT) is-lws-test$(EXEEXT) $(am__EXEEXT_1) |
is-find-test$(EXEEXT) is-mac-test$(EXEEXT) \ |
is-lws-test$(EXEEXT) $(am__EXEEXT_1) |
subdir = inst-set-test |
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in |
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
108,6 → 109,12
is_lws_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ |
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ |
$(is_lws_test_LDFLAGS) $(LDFLAGS) -o $@ |
am_is_mac_test_OBJECTS = is-mac-test.$(OBJEXT) |
is_mac_test_OBJECTS = $(am_is_mac_test_OBJECTS) |
is_mac_test_DEPENDENCIES = inst-set-test.lo |
is_mac_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ |
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ |
$(is_mac_test_LDFLAGS) $(LDFLAGS) -o $@ |
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) |
depcomp = $(SHELL) $(top_srcdir)/../../depcomp |
am__depfiles_maybe = depfiles |
128,11 → 135,12
$(LDFLAGS) -o $@ |
SOURCES = $(libinst_set_test_la_SOURCES) $(inst_set_test_old_SOURCES) \ |
$(is_add_test_SOURCES) $(is_div_test_SOURCES) \ |
$(is_find_test_SOURCES) $(is_lws_test_SOURCES) |
$(is_find_test_SOURCES) $(is_lws_test_SOURCES) \ |
$(is_mac_test_SOURCES) |
DIST_SOURCES = $(libinst_set_test_la_SOURCES) \ |
$(inst_set_test_old_SOURCES) $(is_add_test_SOURCES) \ |
$(is_div_test_SOURCES) $(is_find_test_SOURCES) \ |
$(is_lws_test_SOURCES) |
$(is_lws_test_SOURCES) $(is_mac_test_SOURCES) |
ETAGS = etags |
CTAGS = ctags |
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) |
278,6 → 286,11
|
is_find_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld |
is_find_test_LDADD = inst-set-test.lo |
is_mac_test_SOURCES = inst-set-test.h \ |
is-mac-test.S |
|
is_mac_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld |
is_mac_test_LDADD = inst-set-test.lo |
is_lws_test_SOURCES = inst-set-test.h \ |
is-lws-test.S |
|
359,6 → 372,9
is-lws-test$(EXEEXT): $(is_lws_test_OBJECTS) $(is_lws_test_DEPENDENCIES) |
@rm -f is-lws-test$(EXEEXT) |
$(is_lws_test_LINK) $(is_lws_test_OBJECTS) $(is_lws_test_LDADD) $(LIBS) |
is-mac-test$(EXEEXT): $(is_mac_test_OBJECTS) $(is_mac_test_DEPENDENCIES) |
@rm -f is-mac-test$(EXEEXT) |
$(is_mac_test_LINK) $(is_mac_test_OBJECTS) $(is_mac_test_LDADD) $(LIBS) |
|
mostlyclean-compile: |
-rm -f *.$(OBJEXT) |
372,6 → 388,7
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-div-test.Po@am__quote@ |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-find-test.Po@am__quote@ |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-lws-test.Po@am__quote@ |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is-mac-test.Po@am__quote@ |
|
.S.o: |
@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/inst-set-test.S
37,8 → 37,7
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* All registers apart from r2, r9 and r11 are preserved across function calls. |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
151,6 → 150,7
* ------------------------------------------------------------------------- */ |
.global _puts |
_puts: |
PUSH (r3) |
l.add r2,r0,r3 /* Copy the string pointer */ |
|
/* Loop getting and printing each char until end of string */ |
162,10 → 162,80
l.j 60b /* Repeat */ |
l.nop NOP_PUTC /* Delay slot */ |
|
61: l.jr r9 /* Return */ |
61: POP (r3) |
l.jr r9 /* Return */ |
l.nop |
|
/* ---------------------------------------------------------------------------- |
* Subroutine to print out a register in hex |
* |
* Parameters: |
* r3 The value to print |
* ------------------------------------------------------------------------- */ |
.section .rodata |
62: .string "0123456789abcdef" |
.section .text |
|
.global _puth |
_puth: |
PUSH (r3) |
PUSH (r4) |
|
l.add r2,r0,r3 /* Copy the value pointer */ |
LOAD_CONST (r4,62b) /* Ptr to digit chars */ |
|
l.srli r3,r2,28 /* Print each digit in turn. */ |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.srli r3,r2,24 |
l.andi r3,r3,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.srli r3,r2,20 |
l.andi r3,r3,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.srli r3,r2,16 |
l.andi r3,r3,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.srli r3,r2,12 |
l.andi r3,r3,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.srli r3,r2,8 |
l.andi r3,r3,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.srli r3,r2,4 |
l.andi r3,r3,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
l.andi r3,r2,0xf |
l.add r3,r4,r3 |
l.lbz r3,0(r3) |
l.nop NOP_PUTC |
|
POP (r4) /* Return */ |
POP (r3) |
l.jr r9 |
l.nop |
|
/* ---------------------------------------------------------------------------- |
* Subroutine to print out a test name prompt |
* |
* The string is preceded by two spaces |
175,10 → 245,10
* ------------------------------------------------------------------------- */ |
.global _ptest |
_ptest: |
PUSH(r9) /* Save the return address */ |
PUSH(r3) /* Save the test name for later */ |
PUSH (r9) /* Save the return address */ |
PUSH (r3) /* Save the test name for later */ |
|
LOAD_STR(r3, " ") /* Prefix */ |
LOAD_STR (r3, " ") /* Prefix */ |
l.jal _puts |
l.nop |
|
197,12 → 267,14
* ------------------------------------------------------------------------- */ |
.global _pok |
_pok: |
PUSH(r9) /* Save the return address */ |
PUSH (r9) /* Save the return address */ |
PUSH (r3) |
|
LOAD_STR(r3, "OK\n") |
LOAD_STR (r3, "OK\n") |
l.jal _puts |
l.nop |
|
POP (r3) |
POP (r9) |
l.jr r9 |
l.nop |
214,12 → 286,14
* ------------------------------------------------------------------------- */ |
.global _pfail |
_pfail: |
PUSH(r9) /* Save the return address */ |
PUSH (r9) /* Save the return address */ |
PUSH (r3) |
|
LOAD_STR(r3, "Failed: ") |
LOAD_STR (r3, "Failed: ") |
l.jal _puts |
l.nop |
|
POP (r3) |
POP (r9) |
l.jr r9 |
l.nop |
229,12 → 303,14
* ------------------------------------------------------------------------- */ |
.global _ptrue |
_ptrue: |
PUSH(r9) /* Save the return address */ |
PUSH (r9) /* Save the return address */ |
PUSH (r3) |
|
LOAD_STR(r3, "TRUE") |
LOAD_STR (r3, "TRUE") |
l.jal _puts |
l.nop |
|
POP (r3) |
POP (r9) |
l.jr r9 |
l.nop |
244,12 → 320,14
* ------------------------------------------------------------------------- */ |
.global _pfalse |
_pfalse: |
PUSH(r9) /* Save the return address */ |
PUSH (r9) /* Save the return address */ |
PUSH (r3) |
|
LOAD_STR(r3, "FALSE") |
LOAD_STR (r3, "FALSE") |
l.jal _puts |
l.nop |
|
POP (r3) |
POP (r9) |
l.jr r9 |
l.nop |
261,12 → 339,14
* ------------------------------------------------------------------------- */ |
.global _punexpected |
_punexpected: |
PUSH(r9) /* Save the return address */ |
PUSH (r9) /* Save the return address */ |
PUSH (r3) |
|
LOAD_STR(r3, " unexpected\n") |
LOAD_STR (r3, " unexpected\n") |
l.jal _puts |
l.nop |
|
POP (r3) |
POP (r9) |
l.jr r9 |
l.nop |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/is-find-test.S
23,22 → 23,7
*/ |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions |
* |
* A simple rising stack is provided starting at _stack and pointed to by |
* r1. r1 points to the next free word. Only 32-bit registers may be pushed |
* onto the stack. |
* |
* Local labels up to 49 are reserved for macros. Each is used only once in |
* all macros. You can get in a serious mess if you get local label clashing |
* in macros. |
* |
* Arguments to functions are passed in r3 through r8. |
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* Coding conventions are described in inst-set-test.S |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/is-mac-test.S
0,0 → 1,987
/* is-mac-test.S. l.mac, l.maci, l.macrc and l.msb instruction test of Or1ksim |
* |
* Copyright (C) 1999-2006 OpenCores |
* Copyright (C) 2010 Embecosm Limited |
* |
* Contributors various OpenCores participants |
* Contributor Jeremy Bennett <jeremy.bennett@embecosm.com> |
* |
* This file is part of OpenRISC 1000 Architectural Simulator. |
* |
* This program is free software; you can redistribute it and/or modify it |
* under the terms of the GNU General Public License as published by the Free |
* Software Foundation; either version 3 of the License, or (at your option) |
* any later version. |
* |
* This program is distributed in the hope that it will be useful, but WITHOUT |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
* more details. |
* |
* You should have received a copy of the GNU General Public License along |
* with this program. If not, see <http: www.gnu.org/licenses/>. |
*/ |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions are described in inst-set-test.S |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
* Test coverage |
* |
* The l.add, l.addc, l.addi and l.addic instructions should set the carry and |
* overflow flags. |
* |
* In addition the l.addc and l.addic instructions should add in the carry |
* bit. |
* |
* Problems in this area were reported in Bugs 1771 and 1776. Having fixed the |
* problem, this is (in good software engineering style), a regression test |
* to go with the fix. |
* |
* This is not a comprehensive test of any instruction (yet). |
* |
* Of course what is really needed is a comprehensive instruction test... |
* ------------------------------------------------------------------------- */ |
|
|
#include "inst-set-test.h" |
|
/* ---------------------------------------------------------------------------- |
* A macro to carry out a test of multiply accumulate read and clear |
* |
* Arguments |
* machi: Inital value of MACHI |
* maclo: Inital value of MACLO |
* op1: First operand value |
* op2: Second operand value |
* res: Expected result |
* ------------------------------------------------------------------------- */ |
#define TEST_MACRC(machi, maclo, op1, op2, res) \ |
LOAD_CONST (r2,maclo) ;\ |
l.mtspr r0,r2,SPR_MACLO ;\ |
LOAD_CONST (r2,machi) ;\ |
l.mtspr r0,r2,SPR_MACHI ;\ |
;\ |
LOAD_CONST (r5,op1) /* Load numbers to add */ ;\ |
LOAD_CONST (r6,op2) ;\ |
l.mac r5,r6 ;\ |
l.macrc r4 ;\ |
PUSH (r4) /* Save for later */ ;\ |
PUTS (" 0x") ;\ |
PUTH (machi) ;\ |
PUTS (" ") ;\ |
PUTH (maclo) ;\ |
PUTS (" + 0x") ;\ |
PUTH (op1) ;\ |
PUTS (" * 0x") ;\ |
PUTH (op2) ;\ |
PUTS (" = 0x") ;\ |
PUTH (res) ;\ |
PUTS (": ") ;\ |
POP (r4) ;\ |
CHECK_RES ("", r4, res) ;\ |
;\ |
l.mfspr r5,r0,SPR_MACHI ;\ |
l.sfne r5,r0 ;\ |
l.bf 50f ;\ |
;\ |
PUTS (" - MACHI cleared\n") ;\ |
;\ |
50: l.mfspr r6,r0,SPR_MACLO ;\ |
l.sfne r6,r0 ;\ |
l.bf 51f ;\ |
;\ |
PUTS (" - MACLO cleared\n") ;\ |
51: |
|
/* ---------------------------------------------------------------------------- |
* A macro to carry out a test of multiply accumulate in registers |
* |
* Arguments |
* machi: Inital value of MACHI |
* maclo: Inital value of MACLO |
* op1: First operand value |
* op2: Second operand value |
* reshi: Expected result |
* reslo: Expected result |
* ------------------------------------------------------------------------- */ |
#define TEST_MAC(machi, maclo, op1, op2, reshi, reslo) \ |
LOAD_CONST (r2,maclo) ;\ |
l.mtspr r0,r2,SPR_MACLO ;\ |
LOAD_CONST (r2,machi) ;\ |
l.mtspr r0,r2,SPR_MACHI ;\ |
;\ |
LOAD_CONST (r5,op1) /* Load numbers to add */ ;\ |
LOAD_CONST (r6,op2) ;\ |
l.mac r5,r6 ;\ |
l.mfspr r5,r0,SPR_MACHI ;\ |
l.mfspr r6,r0,SPR_MACLO ;\ |
PUSH (r5) /* Save for later */ ;\ |
PUSH (r6) ;\ |
PUTS (" 0x") ;\ |
PUTH (machi) ;\ |
PUTS (" ") ;\ |
PUTH (maclo) ;\ |
PUTS (" + 0x") ;\ |
PUTH (op1) ;\ |
PUTS (" * 0x") ;\ |
PUTH (op2) ;\ |
PUTS (" = 0x") ;\ |
PUTH (reshi) ;\ |
PUTS (" ") ;\ |
PUTH (reslo) ;\ |
PUTS (": ") ;\ |
POP (r6) ;\ |
POP (r5) ;\ |
CHECK_RES2 (r5, r6, reshi, reslo) |
|
|
/* ---------------------------------------------------------------------------- |
* A macro to carry out a test of multiply accumulate with immediate arg |
* |
* There is currently a bug in the assembler, so we must hand construct |
* l.maci r5,op1. |
* |
* Arguments |
* machi: Inital value of MACHI |
* maclo: Inital value of MACLO |
* op1: First operand value |
* op2: Second operand value |
* reshi: Expected result |
* reslo: Expected result |
* ------------------------------------------------------------------------- */ |
#define TEST_MACI(machi, maclo, op1, op2, reshi, reslo) \ |
LOAD_CONST (r2,maclo) ;\ |
l.mtspr r0,r2,SPR_MACLO ;\ |
LOAD_CONST (r2,machi) ;\ |
l.mtspr r0,r2,SPR_MACHI ;\ |
;\ |
LOAD_CONST (r5,op1) /* Load number to add */ ;\ |
.word (0x4c050000|op2) /* l.maci r5,op2 */ ;\ |
/* l.maci r5,op2 */ ;\ |
l.mfspr r5,r0,SPR_MACHI ;\ |
l.mfspr r6,r0,SPR_MACLO ;\ |
PUSH (r5) /* Save for later */ ;\ |
PUSH (r6) ;\ |
PUTS (" 0x") ;\ |
PUTH (machi) ;\ |
PUTS (" ") ;\ |
PUTH (maclo) ;\ |
PUTS (" + 0x") ;\ |
PUTH (op1) ;\ |
PUTS (" * 0x") ;\ |
PUTH (op2) ;\ |
PUTS (" = 0x") ;\ |
PUTH (reshi) ;\ |
PUTS (" ") ;\ |
PUTH (reslo) ;\ |
PUTS (": ") ;\ |
POP (r6) ;\ |
POP (r5) ;\ |
CHECK_RES2 (r5, r6, reshi, reslo) |
|
|
/* ---------------------------------------------------------------------------- |
* A macro to carry out a test of multiply and subract |
* |
* Arguments |
* machi: Inital value of MACHI |
* maclo: Inital value of MACLO |
* op1: First operand value |
* op2: Second operand value |
* reshi: Expected result |
* reslo: Expected result |
* ------------------------------------------------------------------------- */ |
#define TEST_MSB(machi, maclo, op1, op2, reshi, reslo) \ |
LOAD_CONST (r2,maclo) ;\ |
l.mtspr r0,r2,SPR_MACLO ;\ |
LOAD_CONST (r2,machi) ;\ |
l.mtspr r0,r2,SPR_MACHI ;\ |
;\ |
LOAD_CONST (r5,op1) /* Load numbers to add */ ;\ |
LOAD_CONST (r6,op2) ;\ |
l.msb r5,r6 ;\ |
l.mfspr r5,r0,SPR_MACHI ;\ |
l.mfspr r6,r0,SPR_MACLO ;\ |
PUSH (r5) /* Save for later */ ;\ |
PUSH (r6) ;\ |
PUTS (" 0x") ;\ |
PUTH (machi) ;\ |
PUTS (" ") ;\ |
PUTH (maclo) ;\ |
PUTS (" - 0x") ;\ |
PUTH (op1) ;\ |
PUTS (" * 0x") ;\ |
PUTH (op2) ;\ |
PUTS (" = 0x") ;\ |
PUTH (reshi) ;\ |
PUTS (" ") ;\ |
PUTH (reslo) ;\ |
PUTS (": ") ;\ |
POP (r6) ;\ |
POP (r5) ;\ |
CHECK_RES2 (r5, r6, reshi, reslo) |
|
|
.section .text |
.global _start |
_start: |
|
/* ---------------------------------------------------------------------------- |
* Test of multiply signed and accumulate, l.mac |
* ------------------------------------------------------------------------- */ |
_mac: |
LOAD_STR (r3, "l.mac\n") |
l.jal _puts |
l.nop |
|
/* MAC two small positive numbers on a zero total */ |
TEST_MAC (0x00000000, 0x00000000, |
0x00000002, 0x00000003, |
0x00000000, 0x00000006) |
|
/* MAC two small positive numbers on a small positive total */ |
TEST_MAC (0x00000000, 0x00000006, |
0x00000002, 0x00000003, |
0x00000000, 0x0000000c) |
|
/* MAC two small positive numbers on a moderate positive total */ |
TEST_MAC (0x00000000, 0xfffffffa, |
0x00000002, 0x00000003, |
0x00000001, 0x00000000) |
|
/* MAC two small positive numbers on a large positive total */ |
TEST_MAC (0x3fffffff, 0xfffffffa, |
0x00000002, 0x00000003, |
0x40000000, 0x00000000) |
|
/* MAC two small positive numbers on a small negative total */ |
TEST_MAC (0xffffffff, 0xfffffffa, |
0x00000002, 0x00000003, |
0x00000000, 0x00000000) |
|
/* MAC two small positive numbers on a moderate negative total */ |
TEST_MAC (0xffffffff, 0x00000000, |
0x00000002, 0x00000003, |
0xffffffff, 0x00000006) |
|
/* MAC two small positive numbers on a large negative total */ |
TEST_MAC (0x80000000, 0x00000000, |
0x00000002, 0x00000003, |
0x80000000, 0x00000006) |
|
PUTC ('\n') |
|
/* MAC two moderate positive numbers on a zero total */ |
TEST_MAC (0x00000000, 0x00000000, |
0x00008001, 0x0000fffe, |
0x00000000, 0x7ffffffe) |
|
/* MAC two moderate positive numbers on a small positive total */ |
TEST_MAC (0x00000000, 0x00000002, |
0x00008001, 0x0000fffe, |
0x00000000, 0x80000000) |
|
/* MAC two moderate positive numbers on a moderate positive total */ |
TEST_MAC (0x00000000, 0x80000002, |
0x00008001, 0x0000fffe, |
0x00000001, 0x00000000) |
|
/* MAC two moderate positive numbers on a large positive total */ |
TEST_MAC (0x7fffffff, 0x80000001, |
0x00008001, 0x0000fffe, |
0x7fffffff, 0xffffffff) |
|
/* MAC two moderate positive numbers on a small negative total */ |
TEST_MAC (0xffffffff, 0xffffffff, |
0x00008001, 0x0000fffe, |
0x00000000, 0x7ffffffd) |
|
/* MAC two moderate positive numbers on a moderate negative total */ |
TEST_MAC (0xffffffff, 0x80000002, |
0x00008001, 0x0000fffe, |
0x00000000, 0x00000000) |
|
/* MAC two moderate positive numbers on a large negative total */ |
TEST_MAC (0xfffffffe, 0x80000002, |
0x00008001, 0x0000fffe, |
0xffffffff, 0x00000000) |
|
PUTC ('\n') |
|
/* MAC two small negative numbers on a zero total */ |
TEST_MAC (0x00000000, 0x00000000, |
0xfffffffe, 0xfffffffd, |
0x00000000, 0x00000006) |
|
/* MAC two small negative numbers on a small positive total */ |
TEST_MAC (0x00000000, 0x00000006, |
0xfffffffe, 0xfffffffd, |
0x00000000, 0x0000000c) |
|
/* MAC two small negative numbers on a small negative total */ |
TEST_MAC (0xffffffff, 0xffffffff, |
0xfffffffe, 0xfffffffd, |
0x00000000, 0x00000005) |
|
PUTC ('\n') |
|
/* MAC one small positive and one small negative number on a zero |
total */ |
TEST_MAC (0x00000000, 0x00000000, |
0x00000002, 0xfffffffd, |
0xffffffff, 0xfffffffa) |
|
/* MAC one small positive and one small negative number on a small |
positive total */ |
TEST_MAC (0x00000000, 0x0000000c, |
0x00000002, 0xfffffffd, |
0x00000000, 0x00000006) |
|
/* MAC one small positive and one small negative number on a moderate |
positive total */ |
TEST_MAC (0x00000001, 0x00000005, |
0x00000002, 0xfffffffd, |
0x00000000, 0xffffffff) |
|
/* MAC one small positive and one small negative number on a large |
positive total */ |
TEST_MAC (0x7fffffff, 0xffffffff, |
0x00000002, 0xfffffffd, |
0x7fffffff, 0xfffffff9) |
|
/* MAC one small positive and one small negative number on a small |
negative total */ |
TEST_MAC (0xffffffff, 0xffffffff, |
0x00000002, 0xfffffffd, |
0xffffffff, 0xfffffff9) |
|
/* MAC one small positive and one small negative number on a moderate |
negative total */ |
TEST_MAC (0xffffffff, 0x00000005, |
0x00000002, 0xfffffffd, |
0xfffffffe, 0xffffffff) |
|
/* MAC one small positive and one small negative number on a large |
negative total */ |
TEST_MAC (0x80000000, 0x00000006, |
0x00000002, 0xfffffffd, |
0x80000000, 0x00000000) |
|
PUTC ('\n') |
|
/* MAC one moderate positive and one moderate negative number on a |
zero total */ |
TEST_MAC (0x00000000, 0x00000000, |
0x00008000, 0xffff0000, |
0xffffffff, 0x80000000) |
|
/* MAC one moderate positive and one moderate negative number on a |
small positive total */ |
TEST_MAC (0x00000000, 0x00000006, |
0x00008000, 0xffff0000, |
0xffffffff, 0x80000006) |
|
/* MAC one moderate positive and one moderate negative number on a |
moderate positive total */ |
TEST_MAC (0x00000000, 0x80000000, |
0x00008000, 0xffff0000, |
0x00000000, 0x00000000) |
|
/* MAC one moderate positive and one moderate negative number on a |
large positive total */ |
TEST_MAC (0x7fffffff, 0xffffffff, |
0x00008000, 0xffff0000, |
0x7fffffff, 0x7fffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
small negative total */ |
TEST_MAC (0xffffffff, 0xffffffff, |
0x00008000, 0xffff0000, |
0xffffffff, 0x7fffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
moderate negative total */ |
TEST_MAC (0xffffffff, 0x7fffffff, |
0x00008000, 0xffff0000, |
0xfffffffe, 0xffffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
large negative total */ |
TEST_MAC (0x80000000, 0x80000000, |
0x00008000, 0xffff0000, |
0x80000000, 0x00000000) |
|
PUTC ('\n') |
|
/* ---------------------------------------------------------------------------- |
* Test of multiply signed and accumulate, l.maci |
* ------------------------------------------------------------------------- */ |
_maci: |
LOAD_STR (r3, "l.maci\n") |
l.jal _puts |
l.nop |
|
/* MAC two small positive numbers on a zero total */ |
TEST_MACI (0x00000000, 0x00000000, |
0x00000002, 0x0003, |
0x00000000, 0x00000006) |
|
/* MAC two small positive numbers on a small positive total */ |
TEST_MACI (0x00000000, 0x00000006, |
0x00000002, 0x0003, |
0x00000000, 0x0000000c) |
|
/* MAC two small positive numbers on a moderate positive total */ |
TEST_MACI (0x00000000, 0xfffffffa, |
0x00000002, 0x0003, |
0x00000001, 0x00000000) |
|
/* MAC two small positive numbers on a large positive total */ |
TEST_MACI (0x3fffffff, 0xfffffffa, |
0x00000002, 0x0003, |
0x40000000, 0x00000000) |
|
/* MAC two small positive numbers on a small negative total */ |
TEST_MACI (0xffffffff, 0xfffffffa, |
0x00000002, 0x0003, |
0x00000000, 0x00000000) |
|
/* MAC two small positive numbers on a moderate negative total */ |
TEST_MACI (0xffffffff, 0x00000000, |
0x00000002, 0x0003, |
0xffffffff, 0x00000006) |
|
/* MAC two small positive numbers on a large negative total */ |
TEST_MACI (0x80000000, 0x00000000, |
0x00000002, 0x0003, |
0x80000000, 0x00000006) |
|
PUTC ('\n') |
tmp: |
/* MAC two moderate positive numbers on a zero total */ |
TEST_MACI (0x00000000, 0x00000000, |
0x00010002, 0x7fff, |
0x00000000, 0x7ffffffe) |
|
/* MAC two moderate positive numbers on a small positive total */ |
TEST_MACI (0x00000000, 0x00000002, |
0x00010002, 0x7fff, |
0x00000000, 0x80000000) |
|
/* MAC two moderate positive numbers on a moderate positive total */ |
TEST_MACI (0x00000000, 0x80000002, |
0x00010002, 0x7fff, |
0x00000001, 0x00000000) |
|
/* MAC two moderate positive numbers on a large positive total */ |
TEST_MACI (0x7fffffff, 0x80000001, |
0x00010002, 0x7fff, |
0x7fffffff, 0xffffffff) |
|
/* MAC two moderate positive numbers on a small negative total */ |
TEST_MACI (0xffffffff, 0xffffffff, |
0x00010002, 0x7fff, |
0x00000000, 0x7ffffffd) |
|
/* MAC two moderate positive numbers on a moderate negative total */ |
TEST_MACI (0xffffffff, 0x80000002, |
0x00010002, 0x7fff, |
0x00000000, 0x00000000) |
|
/* MAC two moderate positive numbers on a large negative total */ |
TEST_MACI (0xfffffffe, 0x80000002, |
0x00010002, 0x7fff, |
0xffffffff, 0x00000000) |
|
PUTC ('\n') |
|
/* MAC two small negative numbers on a zero total */ |
TEST_MACI (0x00000000, 0x00000000, |
0xfffffffe, 0xfffd, |
0x00000000, 0x00000006) |
|
/* MAC two small negative numbers on a small positive total */ |
TEST_MACI (0x00000000, 0x00000006, |
0xfffffffe, 0xfffd, |
0x00000000, 0x0000000c) |
|
/* MAC two small negative numbers on a small negative total */ |
TEST_MACI (0xffffffff, 0xffffffff, |
0xfffffffe, 0xfffd, |
0x00000000, 0x00000005) |
|
PUTC ('\n') |
|
/* MAC one small positive and one small negative number on a zero |
total */ |
TEST_MACI (0x00000000, 0x00000000, |
0x00000002, 0xfffd, |
0xffffffff, 0xfffffffa) |
|
/* MAC one small positive and one small negative number on a small |
positive total */ |
TEST_MACI (0x00000000, 0x0000000c, |
0x00000002, 0xfffd, |
0x00000000, 0x00000006) |
|
/* MAC one small positive and one small negative number on a moderate |
positive total */ |
TEST_MACI (0x00000001, 0x00000005, |
0x00000002, 0xfffd, |
0x00000000, 0xffffffff) |
|
/* MAC one small positive and one small negative number on a large |
positive total */ |
TEST_MACI (0x7fffffff, 0xffffffff, |
0x00000002, 0xfffd, |
0x7fffffff, 0xfffffff9) |
|
/* MAC one small positive and one small negative number on a small |
negative total */ |
TEST_MACI (0xffffffff, 0xffffffff, |
0x00000002, 0xfffd, |
0xffffffff, 0xfffffff9) |
|
/* MAC one small positive and one small negative number on a moderate |
negative total */ |
TEST_MACI (0xffffffff, 0x00000005, |
0x00000002, 0xfffd, |
0xfffffffe, 0xffffffff) |
|
/* MAC one small positive and one small negative number on a large |
negative total */ |
TEST_MACI (0x80000000, 0x00000006, |
0x00000002, 0xfffd, |
0x80000000, 0x00000000) |
|
PUTC ('\n') |
|
/* MAC one moderate positive and one moderate negative number on a |
zero total */ |
TEST_MACI (0x00000000, 0x00000000, |
0x00010000, 0x8000, |
0xffffffff, 0x80000000) |
|
/* MAC one moderate positive and one moderate negative number on a |
small positive total */ |
TEST_MACI (0x00000000, 0x00000006, |
0x00010000, 0x8000, |
0xffffffff, 0x80000006) |
|
/* MAC one moderate positive and one moderate negative number on a |
moderate positive total */ |
TEST_MACI (0x00000000, 0x80000000, |
0x00010000, 0x8000, |
0x00000000, 0x00000000) |
|
/* MAC one moderate positive and one moderate negative number on a |
large positive total */ |
TEST_MACI (0x7fffffff, 0xffffffff, |
0x00010000, 0x8000, |
0x7fffffff, 0x7fffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
small negative total */ |
TEST_MACI (0xffffffff, 0xffffffff, |
0x00010000, 0x8000, |
0xffffffff, 0x7fffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
moderate negative total */ |
TEST_MACI (0xffffffff, 0x7fffffff, |
0x00010000, 0x8000, |
0xfffffffe, 0xffffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
large negative total */ |
TEST_MACI (0x80000000, 0x80000000, |
0x00010000, 0x8000, |
0x80000000, 0x00000000) |
|
PUTC ('\n') |
|
/* ---------------------------------------------------------------------------- |
* Test of multiply signed and accumulate, read and clear l.macrc |
* ------------------------------------------------------------------------- */ |
_macrc: |
LOAD_STR (r3, "l.macrc\n") |
l.jal _puts |
l.nop |
|
/* MAC two small positive numbers on a zero total */ |
TEST_MACRC (0x00000000, 0x00000000, |
0x00000002, 0x00000003, |
0x00000006) |
|
/* MAC two small positive numbers on a small positive total */ |
TEST_MACRC (0x00000000, 0x00000006, |
0x00000002, 0x00000003, |
0x0000000c) |
|
/* MAC two small positive numbers on a moderate positive total */ |
TEST_MACRC (0x00000000, 0xfffffffa, |
0x00000002, 0x00000003, |
0x00000000) |
|
/* MAC two small positive numbers on a large positive total */ |
TEST_MACRC (0x3fffffff, 0xfffffffa, |
0x00000002, 0x00000003, |
0x00000000) |
|
/* MAC two small positive numbers on a small negative total */ |
TEST_MACRC (0xffffffff, 0xfffffffa, |
0x00000002, 0x00000003, |
0x00000000) |
|
/* MAC two small positive numbers on a moderate negative total */ |
TEST_MACRC (0xffffffff, 0x00000000, |
0x00000002, 0x00000003, |
0x00000006) |
|
/* MAC two small positive numbers on a large negative total */ |
TEST_MACRC (0x80000000, 0x00000000, |
0x00000002, 0x00000003, |
0x00000006) |
|
PUTC ('\n') |
|
/* MAC two moderate positive numbers on a zero total */ |
TEST_MACRC (0x00000000, 0x00000000, |
0x00008001, 0x0000fffe, |
0x7ffffffe) |
|
/* MAC two moderate positive numbers on a small positive total */ |
TEST_MACRC (0x00000000, 0x00000002, |
0x00008001, 0x0000fffe, |
0x80000000) |
|
/* MAC two moderate positive numbers on a moderate positive total */ |
TEST_MACRC (0x00000000, 0x80000002, |
0x00008001, 0x0000fffe, |
0x00000000) |
|
/* MAC two moderate positive numbers on a large positive total */ |
TEST_MACRC (0x7fffffff, 0x80000001, |
0x00008001, 0x0000fffe, |
0xffffffff) |
|
/* MAC two moderate positive numbers on a small negative total */ |
TEST_MACRC (0xffffffff, 0xffffffff, |
0x00008001, 0x0000fffe, |
0x7ffffffd) |
|
/* MAC two moderate positive numbers on a moderate negative total */ |
TEST_MACRC (0xffffffff, 0x80000002, |
0x00008001, 0x0000fffe, |
0x00000000) |
|
/* MAC two moderate positive numbers on a large negative total */ |
TEST_MACRC (0xfffffffe, 0x80000002, |
0x00008001, 0x0000fffe, |
0x00000000) |
|
PUTC ('\n') |
|
/* MAC two small negative numbers on a zero total */ |
TEST_MACRC (0x00000000, 0x00000000, |
0xfffffffe, 0xfffffffd, |
0x00000006) |
|
/* MAC two small negative numbers on a small positive total */ |
TEST_MACRC (0x00000000, 0x00000006, |
0xfffffffe, 0xfffffffd, |
0x0000000c) |
|
/* MAC two small negative numbers on a small negative total */ |
TEST_MACRC (0xffffffff, 0xffffffff, |
0xfffffffe, 0xfffffffd, |
0x00000005) |
|
PUTC ('\n') |
|
/* MAC one small positive and one small negative number on a zero |
total */ |
TEST_MACRC (0x00000000, 0x00000000, |
0x00000002, 0xfffffffd, |
0xfffffffa) |
|
/* MAC one small positive and one small negative number on a small |
positive total */ |
TEST_MACRC (0x00000000, 0x0000000c, |
0x00000002, 0xfffffffd, |
0x00000006) |
|
/* MAC one small positive and one small negative number on a moderate |
positive total */ |
TEST_MACRC (0x00000001, 0x00000005, |
0x00000002, 0xfffffffd, |
0xffffffff) |
|
/* MAC one small positive and one small negative number on a large |
positive total */ |
TEST_MACRC (0x7fffffff, 0xffffffff, |
0x00000002, 0xfffffffd, |
0xfffffff9) |
|
/* MAC one small positive and one small negative number on a small |
negative total */ |
TEST_MACRC (0xffffffff, 0xffffffff, |
0x00000002, 0xfffffffd, |
0xfffffff9) |
|
/* MAC one small positive and one small negative number on a moderate |
negative total */ |
TEST_MACRC (0xffffffff, 0x00000005, |
0x00000002, 0xfffffffd, |
0xffffffff) |
|
/* MAC one small positive and one small negative number on a large |
negative total */ |
TEST_MACRC (0x80000000, 0x00000006, |
0x00000002, 0xfffffffd, |
0x00000000) |
|
PUTC ('\n') |
|
/* MAC one moderate positive and one moderate negative number on a |
zero total */ |
TEST_MACRC (0x00000000, 0x00000000, |
0x00008000, 0xffff0000, |
0x80000000) |
|
/* MAC one moderate positive and one moderate negative number on a |
small positive total */ |
TEST_MACRC (0x00000000, 0x00000006, |
0x00008000, 0xffff0000, |
0x80000006) |
|
/* MAC one moderate positive and one moderate negative number on a |
moderate positive total */ |
TEST_MACRC (0x00000000, 0x80000000, |
0x00008000, 0xffff0000, |
0x00000000) |
|
/* MAC one moderate positive and one moderate negative number on a |
large positive total */ |
TEST_MACRC (0x7fffffff, 0xffffffff, |
0x00008000, 0xffff0000, |
0x7fffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
small negative total */ |
TEST_MACRC (0xffffffff, 0xffffffff, |
0x00008000, 0xffff0000, |
0x7fffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
moderate negative total */ |
TEST_MACRC (0xffffffff, 0x7fffffff, |
0x00008000, 0xffff0000, |
0xffffffff) |
|
/* MAC one moderate positive and one moderate negative number on a |
large negative total */ |
TEST_MACRC (0x80000000, 0x80000000, |
0x00008000, 0xffff0000, |
0x00000000) |
|
PUTC ('\n') |
|
/* ---------------------------------------------------------------------------- |
* Test of multiply signed and accumulate, l.msb |
* ------------------------------------------------------------------------- */ |
_msb: |
LOAD_STR (r3, "l.msb\n") |
l.jal _puts |
l.nop |
|
/* MSB two small positive numbers on a zero total */ |
TEST_MSB (0x00000000, 0x00000000, |
0x00000002, 0x00000003, |
0xffffffff, 0xfffffffa) |
|
/* MSB two small positive numbers on a small positive total */ |
TEST_MSB (0x00000000, 0x0000000c, |
0x00000002, 0x00000003, |
0x00000000, 0x00000006) |
|
/* MSB two small positive numbers on a moderate positive total */ |
TEST_MSB (0x00000001, 0x00000000, |
0x00000002, 0x00000003, |
0x00000000, 0xfffffffa) |
|
/* MSB two small positive numbers on a large positive total */ |
TEST_MSB (0x40000000, 0x00000000, |
0x00000002, 0x00000003, |
0x3fffffff, 0xfffffffa) |
|
/* MSB two small positive numbers on a small negative total */ |
TEST_MSB (0xffffffff, 0xfffffffa, |
0x00000002, 0x00000003, |
0xffffffff, 0xfffffff4) |
|
/* MSB two small positive numbers on a moderate negative total */ |
TEST_MSB (0xffffffff, 0x00000005, |
0x00000002, 0x00000003, |
0xfffffffe, 0xffffffff) |
|
/* MSB two small positive numbers on a large negative total */ |
TEST_MSB (0x80000000, 0x00000006, |
0x00000002, 0x00000003, |
0x80000000, 0x00000000) |
|
PUTC ('\n') |
|
/* MSB two moderate positive numbers on a zero total */ |
TEST_MSB (0x00000000, 0x00000000, |
0x00008001, 0x0000fffe, |
0xffffffff, 0x80000002) |
|
/* MSB two moderate positive numbers on a small positive total */ |
TEST_MSB (0x00000000, 0x00000002, |
0x00008001, 0x0000fffe, |
0xffffffff, 0x80000004) |
|
/* MSB two moderate positive numbers on a moderate positive total */ |
TEST_MSB (0x00000000, 0x80000002, |
0x00008001, 0x0000fffe, |
0x00000000, 0x00000004) |
|
/* MSB two moderate positive numbers on a large positive total */ |
TEST_MSB (0x7fffffff, 0x7ffffffd, |
0x00008001, 0x0000fffe, |
0x7ffffffe, 0xffffffff) |
|
/* MSB two moderate positive numbers on a small negative total */ |
TEST_MSB (0xffffffff, 0xffffffff, |
0x00008001, 0x0000fffe, |
0xffffffff, 0x80000001) |
|
/* MSB two moderate positive numbers on a moderate negative total */ |
TEST_MSB (0xffffffff, 0x80000002, |
0x00008001, 0x0000fffe, |
0xffffffff, 0x00000004) |
|
/* MSB two moderate positive numbers on a large negative total */ |
TEST_MSB (0xfffffffe, 0x80000002, |
0x00008001, 0x0000fffe, |
0xfffffffe, 0x00000004) |
|
PUTC ('\n') |
|
/* MSB two small negative numbers on a zero total */ |
TEST_MSB (0x00000000, 0x00000006, |
0xfffffffe, 0xfffffffd, |
0x00000000, 0x00000000) |
|
/* MSB two small negative numbers on a small positive total */ |
TEST_MSB (0x00000000, 0x0000000c, |
0xfffffffe, 0xfffffffd, |
0x00000000, 0x00000006) |
|
/* MSB two small negative numbers on a small negative total */ |
TEST_MSB (0xffffffff, 0xffffffff, |
0xfffffffe, 0xfffffffd, |
0xffffffff, 0xfffffff9) |
|
PUTC ('\n') |
|
/* MSB one small positive and one small negative number on a zero |
total */ |
TEST_MSB (0x00000000, 0x00000000, |
0x00000002, 0xfffffffd, |
0x00000000, 0x00000006) |
|
/* MSB one small positive and one small negative number on a small |
positive total */ |
TEST_MSB (0x00000000, 0x00000006, |
0x00000002, 0xfffffffd, |
0x00000000, 0x0000000c) |
|
/* MSB one small positive and one small negative number on a moderate |
positive total */ |
TEST_MSB (0x00000000, 0xffffffff, |
0x00000002, 0xfffffffd, |
0x00000001, 0x00000005) |
|
/* MSB one small positive and one small negative number on a large |
positive total */ |
TEST_MSB (0x7fffffff, 0xfffffff9, |
0x00000002, 0xfffffffd, |
0x7fffffff, 0xffffffff) |
|
/* MSB one small positive and one small negative number on a small |
negative total */ |
TEST_MSB (0xffffffff, 0xfffffff9, |
0x00000002, 0xfffffffd, |
0xffffffff, 0xffffffff) |
|
/* MSB one small positive and one small negative number on a moderate |
negative total */ |
TEST_MSB (0xfffffffe, 0xffffffff, |
0x00000002, 0xfffffffd, |
0xffffffff, 0x00000005) |
|
/* MSB one small positive and one small negative number on a large |
negative total */ |
TEST_MSB (0x80000000, 0x00000000, |
0x00000002, 0xfffffffd, |
0x80000000, 0x00000006) |
|
PUTC ('\n') |
|
/* MSB one moderate positive and one moderate negative number on a |
zero total */ |
TEST_MSB (0x00000000, 0x00000000, |
0x00008000, 0xffff0000, |
0x00000000, 0x80000000) |
|
/* MSB one moderate positive and one moderate negative number on a |
small positive total */ |
TEST_MSB (0x00000000, 0x00000006, |
0x00008000, 0xffff0000, |
0x00000000, 0x80000006) |
|
/* MSB one moderate positive and one moderate negative number on a |
moderate positive total */ |
TEST_MSB (0x00000000, 0x80000000, |
0x00008000, 0xffff0000, |
0x00000001, 0x00000000) |
|
/* MSB one moderate positive and one moderate negative number on a |
large positive total */ |
TEST_MSB (0x7fffffff, 0x7fffffff, |
0x00008000, 0xffff0000, |
0x7fffffff, 0xffffffff) |
|
/* MSB one moderate positive and one moderate negative number on a |
small negative total */ |
TEST_MSB (0xffffffff, 0xffffffff, |
0x00008000, 0xffff0000, |
0x00000000, 0x7fffffff) |
|
/* MSB one moderate positive and one moderate negative number on a |
moderate negative total */ |
TEST_MSB (0xfffffffe, 0xffffffff, |
0x00008000, 0xffff0000, |
0xffffffff, 0x7fffffff) |
|
/* MSB one moderate positive and one moderate negative number on a |
large negative total */ |
TEST_MSB (0x80000000, 0x00000000, |
0x00008000, 0xffff0000, |
0x80000000, 0x80000000) |
|
PUTC ('\n') |
|
/* ---------------------------------------------------------------------------- |
* All done |
* ------------------------------------------------------------------------- */ |
_exit: |
LOAD_STR (r3, "Test completed\n") |
l.jal _puts |
l.nop |
|
TEST_EXIT |
trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/is-mac-test.S
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/Makefile.am
===================================================================
--- trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/Makefile.am (revision 115)
+++ trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/Makefile.am (revision 116)
@@ -44,6 +44,7 @@
check_PROGRAMS = is-add-test \
is-div-test \
is-find-test \
+ is-mac-test \
is-lws-test \
$(INST_SET_TEST_OLD)
@@ -63,6 +64,11 @@
is_find_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
is_find_test_LDADD = inst-set-test.lo
+is_mac_test_SOURCES = inst-set-test.h \
+ is-mac-test.S
+is_mac_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
+is_mac_test_LDADD = inst-set-test.lo
+
is_lws_test_SOURCES = inst-set-test.h \
is-lws-test.S
is_lws_test_LDFLAGS = -T$(srcdir)/inst-set-test.ld
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/inst-set-test.h
22,39 → 22,11
with this program. If not, see <http: www.gnu.org/licenses/>. */ |
|
|
/* ---------------------------------------------------------------------------- |
* Test coverage |
* |
* The l.lws instruction was omitted from Or1ksim originally. It is specified |
* for ORBIS32, even though it is functionally equivalent to l.lwz. |
* |
* Having fixed the problem, this is (in good software engineering style), a |
* regresison test to go with the fix. |
* |
* Of course what is really needed is a comprehensive instruction test... |
* ------------------------------------------------------------------------- */ |
|
|
#include "spr-defs.h" |
#include "board.h" |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions |
* |
* A simple rising stack is provided starting at _stack and pointed to by |
* r1. r1 points to the next free word. Only 32-bit registers may be pushed |
* onto the stack. |
* |
* Local labels up to 49 are reserved for macros. Each is used only once in |
* all macros. You can get in a serious mess if you get local label clashing |
* in macros. |
* |
* Arguments to functions are passed in r3 through r8. |
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* Coding conventions are described in inst-set-test.S |
* ------------------------------------------------------------------------- */ |
|
|
142,9 → 114,35
l.nop NOP_PUTC |
|
/* ---------------------------------------------------------------------------- |
* Macro to print a string |
* |
* Arguments: |
* s The string to print |
* ------------------------------------------------------------------------- */ |
#define PUTS(s) \ |
LOAD_STR (r3, s) ;\ |
PUSH (r9) ;\ |
l.jal _puts ;\ |
l.nop ;\ |
POP (r9) |
|
/* ---------------------------------------------------------------------------- |
* Macro to print a hex value |
* |
* Arguments: |
* v The value to print |
* ------------------------------------------------------------------------- */ |
#define PUTH(v) \ |
LOAD_CONST (r3, v) ;\ |
PUSH (r9) ;\ |
l.jal _puth ;\ |
l.nop ;\ |
POP (r9) |
|
/* ---------------------------------------------------------------------------- |
* Macro for recording the result of a test |
* |
* The test result is in r4. Print out the name of test indented two spaces, |
* The test result is in reg. Print out the name of test indented two spaces, |
* followed by ": ", either "OK" or "Failed" and a newline. |
* |
* Arguments: |
253,6 → 251,71
9: |
|
/* ---------------------------------------------------------------------------- |
* Macro for recording the result of a test (in two regs) |
* |
* The test result is in reg1 and reg2. Print out the name of test indented |
* two spaces, followed by ": ", either "OK" or "Failed" and a newline. |
* |
* Arguments: |
* str Textual name of the test |
* reg1 The result to test (not r2) |
* reg2 The result to test (not r2) |
* val1 Desired result of the test |
* val2 Desired result of the test |
* ------------------------------------------------------------------------- */ |
#define CHECK_RES2(reg1, reg2, val1, val2) \ |
PUSH (reg2) /* Save the test registers */ ;\ |
PUSH (reg1) ;\ |
;\ |
LOAD_CONST(r2,val1) /* First desired result */ ;\ |
POP (reg1) /* First register to test */ ;\ |
PUSH (reg1) /* May need again later */ ;\ |
l.sfeq r2,reg1 /* Does the result match? */ ;\ |
l.bf 10f ;\ |
l.nop ;\ |
;\ |
/* First register failed. */ ;\ |
l.jal _pfail /* Test failed */ ;\ |
l.nop ;\ |
POP (reg1) /* Report the registers */ ;\ |
l.add r3,r0,reg1 ;\ |
l.nop NOP_REPORT ;\ |
POP (reg2) /* Report the registers */ ;\ |
l.add r3,r0,reg2 ;\ |
l.j 12f ;\ |
l.nop NOP_REPORT ;\ |
;\ |
/* First register matched, check the second */ ;\ |
10: ;\ |
LOAD_CONST(r2,val2) /* Second desired result */ ;\ |
POP (reg1) /* First register to test */ ;\ |
POP (reg2) /* Second register to test */ ;\ |
PUSH (reg2) /* May need again later */ ;\ |
PUSH (reg1) /* May need again later */ ;\ |
l.sfeq r2,reg2 /* Does the result match? */ ;\ |
l.bf 11f ;\ |
l.nop ;\ |
;\ |
/* Second register failed. */ ;\ |
l.jal _pfail /* Test failed */ ;\ |
l.nop ;\ |
POP (reg1) /* Report the registers */ ;\ |
l.add r3,r0,reg1 ;\ |
l.nop NOP_REPORT ;\ |
POP (reg2) /* Report the registers */ ;\ |
l.add r3,r0,reg2 ;\ |
l.j 12f ;\ |
l.nop NOP_REPORT ;\ |
;\ |
/* Both registers passed */ ;\ |
11: ;\ |
POP (reg1) /* Discard the registers */ ;\ |
POP (reg2) /* Discard the registers */ ;\ |
l.jal _pok /* Test succeeded */ ;\ |
l.nop ;\ |
12: |
|
/* ---------------------------------------------------------------------------- |
* Macro to report 0xdeaddead and then terminate |
* ------------------------------------------------------------------------- */ |
#define TEST_EXIT \ |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/is-div-test.S
23,22 → 23,7
*/ |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions |
* |
* A simple rising stack is provided starting at _stack and pointed to by |
* r1. r1 points to the next free word. Only 32-bit registers may be pushed |
* onto the stack. |
* |
* Local labels up to 49 are reserved for macros. Each is used only once in |
* all macros. You can get in a serious mess if you get local label clashing |
* in macros. |
* |
* Arguments to functions are passed in r3 through r8. |
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* Coding conventions are described in inst-set-test.S |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
/trunk/or1ksim/testsuite/test-code-or1k/inst-set-test/is-lws-test.S
23,22 → 23,7
*/ |
|
/* ---------------------------------------------------------------------------- |
* Coding conventions |
* |
* A simple rising stack is provided starting at _stack and pointed to by |
* r1. r1 points to the next free word. Only 32-bit registers may be pushed |
* onto the stack. |
* |
* Local labels up to 49 are reserved for macros. Each is used only once in |
* all macros. You can get in a serious mess if you get local label clashing |
* in macros. |
* |
* Arguments to functions are passed in r3 through r8. |
* r9 is the link (return address) |
* r11 is for returning results |
* |
* Only r1 and r2 are preserved across function calls. It is up to the callee |
* to save any other registers required. |
* Coding conventions are described in inst-set-test.S |
* ------------------------------------------------------------------------- */ |
|
/* ---------------------------------------------------------------------------- |
/trunk/or1ksim/testsuite/test-code-or1k/ChangeLog
1,3 → 1,16
2010-06-11 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* inst-set-test/inst-set-test.h: Calling conventions updated. |
<CHECK_RES2>: New macro created. |
<PUTS>: New macro created. |
<PUTH>: New macro created. |
* inst-set-test/inst-set-test.S: New calling convention |
implemented throughout. |
(puth): Created. |
* inst-set-test/is-mac-test.S: Created. |
* inst-set-test/Makefile.am: Updated for new tests |
* inst-set-test/Makefile.in: Regenerated. |
* mul/mul.c: Corrected expected results. |
|
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* inst-set-test/is-add-test.S: Commenting corrected. |
* inst-set-test/is-find-test.S: Created. |
/trunk/or1ksim/testsuite/test-code-or1k/mul/mul.c
30,8 → 30,8
#include "support.h" |
|
#define T1 0xa6312f33 |
#define T2 0x0d4de375 |
#define T3 0x61ab48dc |
#define T2 0x059b8f08 |
#define T3 0x00000000 |
|
#define MAC(x,y) asm volatile ("l.mac\t%0,%1" : : "r" (x), "r" (y)) |
#define MACRC macrc() |
/trunk/or1ksim/testsuite/or1ksim.tests/inst-set-test.exp
283,3 → 283,220
"!report(0xdeaddead);" \ |
"!exit(0)"] \ |
"inst-set-test.cfg" "inst-set-test/is-lws-test" |
|
# Run the l.mac test |
run_or1ksim "mac-test" \ |
[list "!l.mac" \ |
" 0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \ |
" 0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x00000000 0000000c: OK" \ |
" 0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000001 00000000: OK" \ |
" 0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x40000000 00000000: OK" \ |
" 0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000 00000000: OK" \ |
" 0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0xffffffff 00000006: OK" \ |
" 0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x80000000 00000006: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0x00008001 * 0x0000fffe = 0x00000000 7ffffffe: OK" \ |
" 0x00000000 00000002 + 0x00008001 * 0x0000fffe = 0x00000000 80000000: OK" \ |
" 0x00000000 80000002 + 0x00008001 * 0x0000fffe = 0x00000001 00000000: OK" \ |
" 0x7fffffff 80000001 + 0x00008001 * 0x0000fffe = 0x7fffffff ffffffff: OK" \ |
" 0xffffffff ffffffff + 0x00008001 * 0x0000fffe = 0x00000000 7ffffffd: OK" \ |
" 0xffffffff 80000002 + 0x00008001 * 0x0000fffe = 0x00000000 00000000: OK" \ |
" 0xfffffffe 80000002 + 0x00008001 * 0x0000fffe = 0xffffffff 00000000: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0xfffffffe * 0xfffffffd = 0x00000000 00000006: OK" \ |
" 0x00000000 00000006 + 0xfffffffe * 0xfffffffd = 0x00000000 0000000c: OK" \ |
" 0xffffffff ffffffff + 0xfffffffe * 0xfffffffd = 0x00000000 00000005: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0x00000002 * 0xfffffffd = 0xffffffff fffffffa: OK" \ |
" 0x00000000 0000000c + 0x00000002 * 0xfffffffd = 0x00000000 00000006: OK" \ |
" 0x00000001 00000005 + 0x00000002 * 0xfffffffd = 0x00000000 ffffffff: OK" \ |
" 0x7fffffff ffffffff + 0x00000002 * 0xfffffffd = 0x7fffffff fffffff9: OK" \ |
" 0xffffffff ffffffff + 0x00000002 * 0xfffffffd = 0xffffffff fffffff9: OK" \ |
" 0xffffffff 00000005 + 0x00000002 * 0xfffffffd = 0xfffffffe ffffffff: OK" \ |
" 0x80000000 00000006 + 0x00000002 * 0xfffffffd = 0x80000000 00000000: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0x00008000 * 0xffff0000 = 0xffffffff 80000000: OK" \ |
" 0x00000000 00000006 + 0x00008000 * 0xffff0000 = 0xffffffff 80000006: OK" \ |
" 0x00000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000 00000000: OK" \ |
" 0x7fffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff 7fffffff: OK" \ |
" 0xffffffff ffffffff + 0x00008000 * 0xffff0000 = 0xffffffff 7fffffff: OK" \ |
" 0xffffffff 7fffffff + 0x00008000 * 0xffff0000 = 0xfffffffe ffffffff: OK" \ |
" 0x80000000 80000000 + 0x00008000 * 0xffff0000 = 0x80000000 00000000: OK" \ |
"!" \ |
"l.maci" \ |
" 0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \ |
" 0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x00000000 0000000c: OK" \ |
" 0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000001 00000000: OK" \ |
" 0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x40000000 00000000: OK" \ |
" 0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000 00000000: OK" \ |
" 0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0xffffffff 00000006: OK" \ |
" 0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x80000000 00000006: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0x00010002 * 0x00007fff = 0x00000000 7ffffffe: OK" \ |
" 0x00000000 00000002 + 0x00010002 * 0x00007fff = 0x00000000 80000000: OK" \ |
" 0x00000000 80000002 + 0x00010002 * 0x00007fff = 0x00000001 00000000: OK" \ |
" 0x7fffffff 80000001 + 0x00010002 * 0x00007fff = 0x7fffffff ffffffff: OK" \ |
" 0xffffffff ffffffff + 0x00010002 * 0x00007fff = 0x00000000 7ffffffd: OK" \ |
" 0xffffffff 80000002 + 0x00010002 * 0x00007fff = 0x00000000 00000000: OK" \ |
" 0xfffffffe 80000002 + 0x00010002 * 0x00007fff = 0xffffffff 00000000: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0xfffffffe * 0x0000fffd = 0x00000000 00000006: OK" \ |
" 0x00000000 00000006 + 0xfffffffe * 0x0000fffd = 0x00000000 0000000c: OK" \ |
" 0xffffffff ffffffff + 0xfffffffe * 0x0000fffd = 0x00000000 00000005: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0x00000002 * 0x0000fffd = 0xffffffff fffffffa: OK" \ |
" 0x00000000 0000000c + 0x00000002 * 0x0000fffd = 0x00000000 00000006: OK" \ |
" 0x00000001 00000005 + 0x00000002 * 0x0000fffd = 0x00000000 ffffffff: OK" \ |
" 0x7fffffff ffffffff + 0x00000002 * 0x0000fffd = 0x7fffffff fffffff9: OK" \ |
" 0xffffffff ffffffff + 0x00000002 * 0x0000fffd = 0xffffffff fffffff9: OK" \ |
" 0xffffffff 00000005 + 0x00000002 * 0x0000fffd = 0xfffffffe ffffffff: OK" \ |
" 0x80000000 00000006 + 0x00000002 * 0x0000fffd = 0x80000000 00000000: OK" \ |
"!" \ |
" 0x00000000 00000000 + 0x00010000 * 0x00008000 = 0xffffffff 80000000: OK" \ |
" 0x00000000 00000006 + 0x00010000 * 0x00008000 = 0xffffffff 80000006: OK" \ |
" 0x00000000 80000000 + 0x00010000 * 0x00008000 = 0x00000000 00000000: OK" \ |
" 0x7fffffff ffffffff + 0x00010000 * 0x00008000 = 0x7fffffff 7fffffff: OK" \ |
" 0xffffffff ffffffff + 0x00010000 * 0x00008000 = 0xffffffff 7fffffff: OK" \ |
" 0xffffffff 7fffffff + 0x00010000 * 0x00008000 = 0xfffffffe ffffffff: OK" \ |
" 0x80000000 80000000 + 0x00010000 * 0x00008000 = 0x80000000 00000000: OK" \ |
"!" \ |
"l.macrc" \ |
" 0x00000000 00000000 + 0x00000002 * 0x00000003 = 0x00000006: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 00000006 + 0x00000002 * 0x00000003 = 0x0000000c: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 fffffffa + 0x00000002 * 0x00000003 = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x3fffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff fffffffa + 0x00000002 * 0x00000003 = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff 00000000 + 0x00000002 * 0x00000003 = 0x00000006: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x80000000 00000000 + 0x00000002 * 0x00000003 = 0x00000006: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
"!" \ |
" 0x00000000 00000000 + 0x00008001 * 0x0000fffe = 0x7ffffffe: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 00000002 + 0x00008001 * 0x0000fffe = 0x80000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 80000002 + 0x00008001 * 0x0000fffe = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x7fffffff 80000001 + 0x00008001 * 0x0000fffe = 0xffffffff: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff ffffffff + 0x00008001 * 0x0000fffe = 0x7ffffffd: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff 80000002 + 0x00008001 * 0x0000fffe = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xfffffffe 80000002 + 0x00008001 * 0x0000fffe = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
"!" \ |
" 0x00000000 00000000 + 0xfffffffe * 0xfffffffd = 0x00000006: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 00000006 + 0xfffffffe * 0xfffffffd = 0x0000000c: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff ffffffff + 0xfffffffe * 0xfffffffd = 0x00000005: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
"!" \ |
" 0x00000000 00000000 + 0x00000002 * 0xfffffffd = 0xfffffffa: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 0000000c + 0x00000002 * 0xfffffffd = 0x00000006: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000001 00000005 + 0x00000002 * 0xfffffffd = 0xffffffff: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x7fffffff ffffffff + 0x00000002 * 0xfffffffd = 0xfffffff9: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff ffffffff + 0x00000002 * 0xfffffffd = 0xfffffff9: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff 00000005 + 0x00000002 * 0xfffffffd = 0xffffffff: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x80000000 00000006 + 0x00000002 * 0xfffffffd = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
"!" \ |
" 0x00000000 00000000 + 0x00008000 * 0xffff0000 = 0x80000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 00000006 + 0x00008000 * 0xffff0000 = 0x80000006: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x00000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x7fffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff ffffffff + 0x00008000 * 0xffff0000 = 0x7fffffff: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0xffffffff 7fffffff + 0x00008000 * 0xffff0000 = 0xffffffff: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
" 0x80000000 80000000 + 0x00008000 * 0xffff0000 = 0x00000000: OK" \ |
" - MACHI cleared" \ |
" - MACLO cleared" \ |
"!" \ |
"l.msb" \ |
" 0x00000000 00000000 - 0x00000002 * 0x00000003 = 0xffffffff fffffffa: OK" \ |
" 0x00000000 0000000c - 0x00000002 * 0x00000003 = 0x00000000 00000006: OK" \ |
" 0x00000001 00000000 - 0x00000002 * 0x00000003 = 0x00000000 fffffffa: OK" \ |
" 0x40000000 00000000 - 0x00000002 * 0x00000003 = 0x3fffffff fffffffa: OK" \ |
" 0xffffffff fffffffa - 0x00000002 * 0x00000003 = 0xffffffff fffffff4: OK" \ |
" 0xffffffff 00000005 - 0x00000002 * 0x00000003 = 0xfffffffe ffffffff: OK" \ |
" 0x80000000 00000006 - 0x00000002 * 0x00000003 = 0x80000000 00000000: OK" \ |
"!" \ |
" 0x00000000 00000000 - 0x00008001 * 0x0000fffe = 0xffffffff 80000002: OK" \ |
" 0x00000000 00000002 - 0x00008001 * 0x0000fffe = 0xffffffff 80000004: OK" \ |
" 0x00000000 80000002 - 0x00008001 * 0x0000fffe = 0x00000000 00000004: OK" \ |
" 0x7fffffff 7ffffffd - 0x00008001 * 0x0000fffe = 0x7ffffffe ffffffff: OK" \ |
" 0xffffffff ffffffff - 0x00008001 * 0x0000fffe = 0xffffffff 80000001: OK" \ |
" 0xffffffff 80000002 - 0x00008001 * 0x0000fffe = 0xffffffff 00000004: OK" \ |
" 0xfffffffe 80000002 - 0x00008001 * 0x0000fffe = 0xfffffffe 00000004: OK" \ |
"!" \ |
" 0x00000000 00000006 - 0xfffffffe * 0xfffffffd = 0x00000000 00000000: OK" \ |
" 0x00000000 0000000c - 0xfffffffe * 0xfffffffd = 0x00000000 00000006: OK" \ |
" 0xffffffff ffffffff - 0xfffffffe * 0xfffffffd = 0xffffffff fffffff9: OK" \ |
"!" \ |
" 0x00000000 00000000 - 0x00000002 * 0xfffffffd = 0x00000000 00000006: OK" \ |
" 0x00000000 00000006 - 0x00000002 * 0xfffffffd = 0x00000000 0000000c: OK" \ |
" 0x00000000 ffffffff - 0x00000002 * 0xfffffffd = 0x00000001 00000005: OK" \ |
" 0x7fffffff fffffff9 - 0x00000002 * 0xfffffffd = 0x7fffffff ffffffff: OK" \ |
" 0xffffffff fffffff9 - 0x00000002 * 0xfffffffd = 0xffffffff ffffffff: OK" \ |
" 0xfffffffe ffffffff - 0x00000002 * 0xfffffffd = 0xffffffff 00000005: OK" \ |
" 0x80000000 00000000 - 0x00000002 * 0xfffffffd = 0x80000000 00000006: OK" \ |
"!" \ |
" 0x00000000 00000000 - 0x00008000 * 0xffff0000 = 0x00000000 80000000: OK" \ |
" 0x00000000 00000006 - 0x00008000 * 0xffff0000 = 0x00000000 80000006: OK" \ |
" 0x00000000 80000000 - 0x00008000 * 0xffff0000 = 0x00000001 00000000: OK" \ |
" 0x7fffffff 7fffffff - 0x00008000 * 0xffff0000 = 0x7fffffff ffffffff: OK" \ |
" 0xffffffff ffffffff - 0x00008000 * 0xffff0000 = 0x00000000 7fffffff: OK" \ |
" 0xfffffffe ffffffff - 0x00008000 * 0xffff0000 = 0xffffffff 7fffffff: OK" \ |
" 0x80000000 00000000 - 0x00008000 * 0xffff0000 = 0x80000000 80000000: OK" \ |
"!" \ |
"!Test completed" \ |
"!report(0xdeaddead);" \ |
"!exit(0)"] \ |
"inst-set-test.cfg" "inst-set-test/is-mac-test" |
/trunk/or1ksim/testsuite/or1ksim.tests/mul.exp
27,10 → 27,10
# Run the multiplication test |
run_or1ksim "mul" \ |
[list "00000000" \ |
"70a2588c" \ |
"cac28a17" \ |
"a6312f33, expected a6312f33" \ |
"0d4de375, expected 0d4de375" \ |
"61ab48dc, expected 61ab48dc" \ |
"059b8f08, expected 059b8f08" \ |
"00000000, expected 00000000" \ |
"!report(0xdeaddead);" \ |
"!Test succesful." \ |
"!exit(0)"] \ |
/trunk/or1ksim/testsuite/ChangeLog
1,3 → 1,8
2010-06-11 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* or1ksim.tests/inst-set-test.exp: Added MAC tests. |
* or1ksim.tests/mul.exp: Corrected erroneous expected results. |
* README: Updated with new tests. |
|
2010-06-10 Jeremy Bennett <jeremy.bennett@embecosm.com> |
* or1ksim.tests/inst-set-test.exp: Added find tests. |
* README: Updated with new tests. |
/trunk/or1ksim/testsuite/README
12,9 → 12,9
Tests are provided for the standalone simulator (or1ksim) and for the library |
(libsim.a). |
|
At the time of writing a total of 1,261 tests compile, run and pass. That |
figure is broken down into 997 tests of the standalone simulator and 264 tests |
of the library |
At the time of writing a total of 1,450 tests compile, run and pass. That |
figure is broken down into 1,186 tests of the standalone simulator and 264 |
tests of the library |
|
Configuration and make files are provided for further test programs. These |
come in three categories. |
46,7 → 46,7
Working tests |
============= |
|
A total of 997 tests of standalone Or1ksim: |
A total of 1,186 tests of standalone Or1ksim: |
|
basic: 8 tests of a wide range of instructions and registers. |
cache: 5 tests of the Or1ksim cache modeling |
70,6 → 70,7
is-div-test: 4 tests of the l.div and l.divu instructions (Bug 1770). |
is-find-test: 14 tests of the l.ff1 and l.fl1 instructions (Bug 1772). |
is-lws-test: 13 tests of the l.lws instruction (Bug 1767). |
is-mac-test: 189 tests of the MAC instructions (Bug 1773). |
mem-test: 16 tests of simple memory access. |
mmu: 110 tests of the MMU. |
mul: 5 tests of the multiply functionality. |
/trunk/or1ksim/configure
1,7 → 1,7
#! /bin/sh |
# From configure.ac Id: configure.ac 1032 2010-06-10 17:04:04Z jeremy using automake version AC_ACVERSION. |
# Guess values for system-dependent variables and create Makefiles. |
# Generated by GNU Autoconf 2.63 for or1ksim 2010-06-09. |
# Generated by GNU Autoconf 2.63 for or1ksim 2010-06-11. |
# |
# Report bugs to <openrisc@opencores.org>. |
# |
766,8 → 766,8
# Identity of this package. |
PACKAGE_NAME='or1ksim' |
PACKAGE_TARNAME='or1ksim' |
PACKAGE_VERSION='2010-06-09' |
PACKAGE_STRING='or1ksim 2010-06-09' |
PACKAGE_VERSION='2010-06-11' |
PACKAGE_STRING='or1ksim 2010-06-11' |
PACKAGE_BUGREPORT='openrisc@opencores.org' |
|
# Factoring default headers for most tests. |
1529,7 → 1529,7
# Omit some internal or obsolete options to make the list less imposing. |
# This message is too long to be a string in the A/UX 3.1 sh. |
cat <<_ACEOF |
\`configure' configures or1ksim 2010-06-09 to adapt to many kinds of systems. |
\`configure' configures or1ksim 2010-06-11 to adapt to many kinds of systems. |
|
Usage: $0 [OPTION]... [VAR=VALUE]... |
|
1600,7 → 1600,7
|
if test -n "$ac_init_help"; then |
case $ac_init_help in |
short | recursive ) echo "Configuration of or1ksim 2010-06-09:";; |
short | recursive ) echo "Configuration of or1ksim 2010-06-11:";; |
esac |
cat <<\_ACEOF |
|
1707,7 → 1707,7
test -n "$ac_init_help" && exit $ac_status |
if $ac_init_version; then |
cat <<\_ACEOF |
or1ksim configure 2010-06-09 |
or1ksim configure 2010-06-11 |
generated by GNU Autoconf 2.63 |
|
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1741,7 → 1741,7
This file contains any messages produced by compilers while |
running configure, to aid debugging if configure makes a mistake. |
|
It was created by or1ksim $as_me 2010-06-09, which was |
It was created by or1ksim $as_me 2010-06-11, which was |
generated by GNU Autoconf 2.63. Invocation command line was |
|
$ $0 $@ |
11284,7 → 11284,7
|
# Define the identity of the package. |
PACKAGE='or1ksim' |
VERSION='2010-06-09' |
VERSION='2010-06-11' |
|
|
cat >>confdefs.h <<_ACEOF |
18259,7 → 18259,7
# report actual input values of CONFIG_FILES etc. instead of their |
# values after options handling. |
ac_log=" |
This file was extended by or1ksim $as_me 2010-06-09, which was |
This file was extended by or1ksim $as_me 2010-06-11, which was |
generated by GNU Autoconf 2.63. Invocation command line was |
|
CONFIG_FILES = $CONFIG_FILES |
18322,7 → 18322,7
_ACEOF |
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
ac_cs_version="\\ |
or1ksim config.status 2010-06-09 |
or1ksim config.status 2010-06-11 |
configured by $0, generated by GNU Autoconf 2.63, |
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
|