URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [or1ksim/] [testsuite/] [test-code-or1k/] [flag/] [flag.S] - Rev 841
Go to most recent revision | Compare with Previous | Blame | View Log
/* flag.S. Test of Or1ksim status register flagsCopyright (C) 1999-2006 OpenCoresCopyright (C) 2010 Embecosm LimitedContributors various OpenCores participantsContributor 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 itunder the terms of the GNU General Public License as published by the FreeSoftware 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 WITHOUTANY WARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License formore details.You should have received a copy of the GNU General Public License alongwith this program. If not, see <http: www.gnu.org/licenses/>. *//* ----------------------------------------------------------------------------This code is commented throughout for use with Doxygen.--------------------------------------------------------------------------*//* Basic SR flag test */#include "spr-defs.h"#define SET_ARITH_FLAG 0 /* If this is not set this test has no meaning */.section .except, "ax".org 0x100_reset:l.nop// Clear R0 on start-up. There is no guarantee that R0 is hardwired to zero,// and indeed it is not when simulating the or1200 Verilog core.l.andi r0,r0,0x0l.movhi r10,0x8000l.addi r11,r0,-1l.addi r12,r0,2l.addi r13,r0,0x5678l.movhi r14,0xdeadl.ori r14,r14,0xdeadl.addi r15,r0,0xdeadl.movhi r3,hi(start)l.ori r3,r3,lo(start)l.jr r3l.nop.section .textstart:/* Test start */#if SET_ARITH_FLAG/* Simple zero test */l.addi r1,r0,1 /* f = 0 */l.addi r1, r0, 0l.bnf _errl.bf _errl.addi r1,r0,1 /* f = 0 */l.add r1, r0, r0l.bnf _errl.addi r1,r0,1 /* f = 0 */l.andi r1, r0, 0l.bnf _errl.addi r1,r0,1 /* f = 0 */l.and r1, r0, r0l.bnf _errl.addi r1,r0,1 /* f = 0 */l.sub r1, r0, r0l.bf _errl.or r1, r0, r0l.bf _errl.ori r1, r0, 0l.bf _errl.xor r1, r0, r0l.bf _errl.xori r1, r0, 0l.bf _errl.addi r1,r0,0 /* f = 1 */l.sub r1, r0, r0l.bnf _errl.or r1, r0, r0l.bnf _errl.ori r1, r0, 0l.bnf _errl.xor r1, r0, r0l.bnf _errl.xori r1, r0, 0l.bnf _errl.addi r1,r0,0 /* f = 1 */l.addi r1, r0, 0xdeadl.bf _errl.addi r1,r0,0 /* f = 1 */l.add r1, r0, r15l.bf _errl.addi r1,r0,0 /* f = 1 */l.andi r1, r11, 0xdeadl.bf _errl.addi r1,r0,0 /* f = 1 */l.and r1, r11, r15l.bf _errl.addi r1,r0,0 /* f = 1 */l.addi r1, r11, 0l.bf _errl.addi r1,r0,0 /* f = 1 */l.add r1, r11, r0l.bf _errl.addi r1,r0,0 /* f = 1 */l.andi r1, r11, 0x1234l.bf _errl.addi r1,r0,0 /* f = 1 */l.and r1, r11, r10l.bf _err#endifl.movhi r3,0xdeadl.ori r3,r3,0xdeadl.nop NOP_REPORTl.ori r3,r0,0l.nop NOP_EXIT_err:l.ori r3,r1,0l.nop NOP_REPORTl.mfspr r3,r0,SPR_SRl.nop NOP_REPORTl.nop NOP_EXIT
Go to most recent revision | Compare with Previous | Blame | View Log
