OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [testbench/] [flag.S] - Diff between revs 970 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 970 Rev 1765
/* Basic SR flag test */
/* Basic SR flag test */
#include "spr_defs.h"
#include "spr_defs.h"
#define SET_ARITH_FLAG   0  /* If this is not set this test has no meaning */
#define SET_ARITH_FLAG   0  /* If this is not set this test has no meaning */
        .section .except, "ax"
        .section .except, "ax"
  l.movhi r10,0x8000
  l.movhi r10,0x8000
  .section .text
  .section .text
        .org 0x100
        .org 0x100
_reset:
_reset:
        l.nop
        l.nop
  l.movhi r10,0x8000
  l.movhi r10,0x8000
  l.addi  r11,r0,-1
  l.addi  r11,r0,-1
  l.addi  r12,r0,2
  l.addi  r12,r0,2
  l.addi  r13,r0,0x5678
  l.addi  r13,r0,0x5678
  l.movhi r14,0xdead
  l.movhi r14,0xdead
  l.ori   r14,r14,0xdead
  l.ori   r14,r14,0xdead
  l.addi  r15,r0,0xdead
  l.addi  r15,r0,0xdead
  /* Test start */
  /* Test start */
#if SET_ARITH_FLAG
#if SET_ARITH_FLAG
  /* Simple zero test */
  /* Simple zero test */
  l.addi r1,r0,1        /* f = 0 */
  l.addi r1,r0,1        /* f = 0 */
  l.addi  r1, r0, 0
  l.addi  r1, r0, 0
  l.bnf     _err
  l.bnf     _err
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,1        /* f = 0 */
  l.addi r1,r0,1        /* f = 0 */
  l.add  r1, r0, r0
  l.add  r1, r0, r0
  l.bnf     _err
  l.bnf     _err
  l.addi r1,r0,1        /* f = 0 */
  l.addi r1,r0,1        /* f = 0 */
  l.andi  r1, r0, 0
  l.andi  r1, r0, 0
  l.bnf     _err
  l.bnf     _err
  l.addi r1,r0,1        /* f = 0 */
  l.addi r1,r0,1        /* f = 0 */
  l.and  r1, r0, r0
  l.and  r1, r0, r0
  l.bnf     _err
  l.bnf     _err
  l.addi r1,r0,1        /* f = 0 */
  l.addi r1,r0,1        /* f = 0 */
  l.sub  r1, r0, r0
  l.sub  r1, r0, r0
  l.bf     _err
  l.bf     _err
  l.or   r1, r0, r0
  l.or   r1, r0, r0
  l.bf     _err
  l.bf     _err
  l.ori  r1, r0, 0
  l.ori  r1, r0, 0
  l.bf     _err
  l.bf     _err
  l.xor  r1, r0, r0
  l.xor  r1, r0, r0
  l.bf     _err
  l.bf     _err
  l.xori r1, r0, 0
  l.xori r1, r0, 0
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.sub  r1, r0, r0
  l.sub  r1, r0, r0
  l.bnf     _err
  l.bnf     _err
  l.or   r1, r0, r0
  l.or   r1, r0, r0
  l.bnf     _err
  l.bnf     _err
  l.ori  r1, r0, 0
  l.ori  r1, r0, 0
  l.bnf     _err
  l.bnf     _err
  l.xor  r1, r0, r0
  l.xor  r1, r0, r0
  l.bnf     _err
  l.bnf     _err
  l.xori r1, r0, 0
  l.xori r1, r0, 0
  l.bnf     _err
  l.bnf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.addi  r1, r0, 0xdead
  l.addi  r1, r0, 0xdead
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.add  r1, r0, r15
  l.add  r1, r0, r15
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.andi  r1, r11, 0xdead
  l.andi  r1, r11, 0xdead
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.and  r1, r11, r15
  l.and  r1, r11, r15
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.addi  r1, r11, 0
  l.addi  r1, r11, 0
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.add  r1, r11, r0
  l.add  r1, r11, r0
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.andi  r1, r11, 0x1234
  l.andi  r1, r11, 0x1234
  l.bf     _err
  l.bf     _err
  l.addi r1,r0,0        /* f = 1 */
  l.addi r1,r0,0        /* f = 1 */
  l.and  r1, r11, r10
  l.and  r1, r11, r10
  l.bf     _err
  l.bf     _err
#endif
#endif
  l.movhi r3,0xdead
  l.movhi r3,0xdead
  l.ori   r3,r3,0xdead
  l.ori   r3,r3,0xdead
  l.nop   NOP_REPORT
  l.nop   NOP_REPORT
  l.ori   r3,r0,0
  l.ori   r3,r0,0
  l.nop   NOP_EXIT
  l.nop   NOP_EXIT
_err:
_err:
  l.ori   r3,r1,0
  l.ori   r3,r1,0
  l.nop   NOP_REPORT
  l.nop   NOP_REPORT
  l.mfspr r3,r0,SPR_SR
  l.mfspr r3,r0,SPR_SR
  l.nop   NOP_REPORT
  l.nop   NOP_REPORT
  l.nop   NOP_EXIT
  l.nop   NOP_EXIT
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.