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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [or1ksim/] [testbench/] [flag.S] - Blame information for rev 1770

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 616 markom
/* Basic SR flag test */
2
#include "spr_defs.h"
3
 
4 970 simons
#define SET_ARITH_FLAG   0  /* If this is not set this test has no meaning */
5 616 markom
 
6 956 simons
        .section .except, "ax"
7 970 simons
  l.movhi r10,0x8000
8
 
9
  .section .text
10 616 markom
        .org 0x100
11
_reset:
12
        l.nop
13
 
14
  l.movhi r10,0x8000
15
  l.addi  r11,r0,-1
16
  l.addi  r12,r0,2
17
  l.addi  r13,r0,0x5678
18
  l.movhi r14,0xdead
19
  l.ori   r14,r14,0xdead
20
  l.addi  r15,r0,0xdead
21
 
22
  /* Test start */
23
 
24 970 simons
#if SET_ARITH_FLAG
25 616 markom
  /* Simple zero test */
26
  l.addi r1,r0,1        /* f = 0 */
27
  l.addi  r1, r0, 0
28
  l.bnf     _err
29 970 simons
  l.bf     _err
30 616 markom
  l.addi r1,r0,1        /* f = 0 */
31
  l.add  r1, r0, r0
32
  l.bnf     _err
33
  l.addi r1,r0,1        /* f = 0 */
34
  l.andi  r1, r0, 0
35
  l.bnf     _err
36
  l.addi r1,r0,1        /* f = 0 */
37
  l.and  r1, r0, r0
38
  l.bnf     _err
39
 
40
  l.addi r1,r0,1        /* f = 0 */
41
  l.sub  r1, r0, r0
42
  l.bf     _err
43
  l.or   r1, r0, r0
44
  l.bf     _err
45
  l.ori  r1, r0, 0
46
  l.bf     _err
47
  l.xor  r1, r0, r0
48
  l.bf     _err
49
  l.xori r1, r0, 0
50
  l.bf     _err
51
 
52
  l.addi r1,r0,0        /* f = 1 */
53
  l.sub  r1, r0, r0
54
  l.bnf     _err
55
  l.or   r1, r0, r0
56
  l.bnf     _err
57
  l.ori  r1, r0, 0
58
  l.bnf     _err
59
  l.xor  r1, r0, r0
60
  l.bnf     _err
61
  l.xori r1, r0, 0
62
  l.bnf     _err
63
 
64
  l.addi r1,r0,0        /* f = 1 */
65
  l.addi  r1, r0, 0xdead
66
  l.bf     _err
67
  l.addi r1,r0,0        /* f = 1 */
68
  l.add  r1, r0, r15
69
  l.bf     _err
70
  l.addi r1,r0,0        /* f = 1 */
71
  l.andi  r1, r11, 0xdead
72
  l.bf     _err
73
  l.addi r1,r0,0        /* f = 1 */
74
  l.and  r1, r11, r15
75
  l.bf     _err
76
 
77
  l.addi r1,r0,0        /* f = 1 */
78
  l.addi  r1, r11, 0
79
  l.bf     _err
80
  l.addi r1,r0,0        /* f = 1 */
81
  l.add  r1, r11, r0
82
  l.bf     _err
83
  l.addi r1,r0,0        /* f = 1 */
84
  l.andi  r1, r11, 0x1234
85
  l.bf     _err
86
  l.addi r1,r0,0        /* f = 1 */
87
  l.and  r1, r11, r10
88
  l.bf     _err
89 970 simons
#endif
90
 
91 616 markom
  l.movhi r3,0xdead
92
  l.ori   r3,r3,0xdead
93
  l.nop   NOP_REPORT
94
  l.ori   r3,r0,0
95
  l.nop   NOP_EXIT
96
 
97
_err:
98
  l.ori   r3,r1,0
99
  l.nop   NOP_REPORT
100
  l.mfspr r3,r0,SPR_SR
101
  l.nop   NOP_REPORT
102
  l.nop   NOP_EXIT

powered by: WebSVN 2.1.0

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