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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [sim/] [testsuite/] [d10v-elf/] [t-subi.s] - Blame information for rev 309

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

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

powered by: WebSVN 2.1.0

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