URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [tests/] [or1200/] [sim/] [or1200-ext.S] - Rev 801
Compare with Previous | Blame | View Log
/*OR1200 zero and sign extension instruction testsVery basic, testingJulius Baxter, ORSoC AB, julius.baxter@orsoc.se*/////////////////////////////////////////////////////////////////////////// //////// Copyright (C) 2010 Authors and OPENCORES.ORG //////// //////// This source file may be used and distributed without //////// restriction provided that this copyright statement is not //////// removed from the file and that any derivative work contains //////// the original copyright notice and the associated disclaimer. //////// //////// This source file is free software; you can redistribute it //////// and/or modify it under the terms of the GNU Lesser General //////// Public License as published by the Free Software Foundation; //////// either version 2.1 of the License, or (at your option) any //////// later version. //////// //////// This source 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 Lesser General Public License for more //////// details. //////// //////// You should have received a copy of the GNU Lesser General //////// Public License along with this source; if not, download it //////// from http://www.opencores.org/lgpl.shtml //////// //////////////////////////////////////////////////////////////////////////#include "spr-defs.h"#include "board.h"#include "or1200-defines.h"/* =================================================== [ exceptions ] === */.section .vectors, "ax"/* ---[ 0x100: RESET exception ]----------------------------------------- */.org 0x100l.movhi r0, 0/* Clear status register */l.ori r1, r0, SPR_SR_SMl.mtspr r0, r1, SPR_SR/* Clear timer */l.mtspr r0, r0, SPR_TTMR/* Jump to program initialisation code */.global _startl.movhi r4, hi(_start)l.ori r4, r4, lo(_start)l.jr r4l.nop.org 0x600l.nop 0x1/* ---[ 0x700: Illegal instruction exception ]-------------------------- */.org 0x700#ifndef OR1200_IMPL_ALU_EXT// No problem - instruction not supportedl.movhi r3, hi(0x8000000d)l.ori r3, r3, lo(0x8000000d)l.nop 0x2l.ori r3, r0, 0#elsel.ori r3, r0, 1#endifl.nop 0x1/* =================================================== [ text ] === */.section .text/* =================================================== [ start ] === */.global _start_start:// Kick off testl.jal _mainl.nop/* =================================================== [ main ] === */.global _main_main:// l.exth tests firstl.ori r4,r0,0xffffl.ori r5,r0,0x7fffl.exths r3,r4l.movhi r8,0xffffl.ori r8,r8,0xffffl.nop 0x2l.sfne r8,r3l.bf faill.nopl.ori r8,r0,0xffffl.exthz r3,r4l.nop 0x2l.sfne r8,r3l.bf faill.nopl.exths r3,r5l.nop 0x2l.sfne r3,r5l.bf faill.nopl.exthz r3,r5l.nop 0x2l.sfne r3,r5l.bf faill.nop// l.extb testsl.ori r4,r0,0x00ffl.ori r5,r0,0x007fl.extbs r3,r4l.nop 0x2l.movhi r8,0xffffl.ori r8,r8,0xffffl.sfne r8,r3l.bf faill.nopl.ori r8,r0,0x00ffl.extbz r3,r4l.nop 0x2l.sfne r8,r3l.bf faill.nopl.extbs r3,r5l.nop 0x2l.sfne r3,r5l.bf faill.nopl.extbz r3,r5l.nop 0x2l.sfne r3,r5l.bf faill.nop// l.extw tests - shouldn't change anythingl.movhi r4,0xffffl.ori r4,r4,0xffffl.extws r3,r4l.nop 0x2l.sfne r3,r4l.bf faill.nopl.extwz r3,r4l.nop 0x2l.sfne r3,r4l.bf faill.nopl.movhi r4,0x7fffl.ori r4,r4,0xffffl.extws r3,r4l.nop 0x2l.sfne r3,r4l.bf faill.nopl.extwz r3,r4l.nop 0x2l.sfne r3,r4l.bf faill.nopl.movhi r3, hi(0x8000000d)l.ori r3, r3, lo(0x8000000d)l.nop 0x2l.ori r3, r0, 0l.nop 0x1fail:l.ori r3, r0, 1l.nop 0x1
