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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gdb-7.2/] [sim/] [testsuite/] [d10v-elf/] [t-sub.s] - Blame information for rev 866

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

Line No. Rev Author Line
1 330 jeremybenn
.include "t-macros.i"
2
 
3
        start
4
 
5
;;  The d10v implements negated addition for subtraction
6
 
7
        .macro check_sub s x y r c
8
        ;; clear carry
9
        ldi     r6,#0x8004
10
        mvtc    r6,cr0
11
        ;; subtract
12
        ldi     r10,#\x
13
        ldi     r11,#\y
14
        sub     r10, r11
15
        ;; verify result
16
        ldi     r12, #\r
17
        cmpeq   r10, r12
18
        brf0t   1f
19
        ldi     r6, 1
20
        ldi     r2, #\s
21
        trap    15
22
1:
23
        ;; verify carry
24
        mvfc    r6, cr0
25
        and3    r6, r6, #1
26
        cmpeqi  r6, #\c
27
        brf0t   1f
28
        ldi     r6, 1
29
        ldi     r2, #\s
30
        trap    15
31
1:
32
        .endm
33
 
34
check_sub 1 0x0000 0x0000  0x0000  1
35
check_sub 2 0x0000 0x0001  0xffff  0
36
check_sub 3 0x0001 0x0000  0x0001  1
37
check_sub 4 0x0001 0x0001  0x0000  1
38
check_sub 5 0x0000 0x8000  0x8000  0
39
check_sub 6 0x8000 0x0001  0x7fff  1
40
check_sub 7 0x7fff 0x7fff  0x0000  1
41
 
42
        exit0

powered by: WebSVN 2.1.0

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