root / tests / cris / check_ftag.c @ 681f8c29
History | View | Annotate | Download (729 Bytes)
1 | 1b893ef3 | edgar_igl | #include <stdio.h> |
---|---|---|---|
2 | 1b893ef3 | edgar_igl | #include <stdlib.h> |
3 | 1b893ef3 | edgar_igl | #include <stdint.h> |
4 | 1b893ef3 | edgar_igl | #include "sys.h" |
5 | 1b893ef3 | edgar_igl | #include "crisutils.h" |
6 | 1b893ef3 | edgar_igl | |
7 | 1b893ef3 | edgar_igl | extern inline void cris_ftag_i(unsigned int x) { |
8 | 1b893ef3 | edgar_igl | register unsigned int v asm("$r10") = x; |
9 | 1b893ef3 | edgar_igl | asm ("ftagi\t[%0]\n" : : "r" (v) ); |
10 | 1b893ef3 | edgar_igl | } |
11 | 1b893ef3 | edgar_igl | extern inline void cris_ftag_d(unsigned int x) { |
12 | 1b893ef3 | edgar_igl | register unsigned int v asm("$r10") = x; |
13 | 1b893ef3 | edgar_igl | asm ("ftagd\t[%0]\n" : : "r" (v) ); |
14 | 1b893ef3 | edgar_igl | } |
15 | 1b893ef3 | edgar_igl | extern inline void cris_fidx_i(unsigned int x) { |
16 | 1b893ef3 | edgar_igl | register unsigned int v asm("$r10") = x; |
17 | 1b893ef3 | edgar_igl | asm ("fidxi\t[%0]\n" : : "r" (v) ); |
18 | 1b893ef3 | edgar_igl | } |
19 | 1b893ef3 | edgar_igl | extern inline void cris_fidx_d(unsigned int x) { |
20 | 1b893ef3 | edgar_igl | register unsigned int v asm("$r10") = x; |
21 | 1b893ef3 | edgar_igl | asm ("fidxd\t[%0]\n" : : "r" (v) ); |
22 | 1b893ef3 | edgar_igl | } |
23 | 1b893ef3 | edgar_igl | |
24 | 1b893ef3 | edgar_igl | |
25 | 1b893ef3 | edgar_igl | int main(void) |
26 | 1b893ef3 | edgar_igl | { |
27 | 1b893ef3 | edgar_igl | cris_ftag_i(0);
|
28 | 1b893ef3 | edgar_igl | cris_ftag_d(0);
|
29 | 1b893ef3 | edgar_igl | cris_fidx_i(0);
|
30 | 1b893ef3 | edgar_igl | cris_fidx_d(0);
|
31 | 1b893ef3 | edgar_igl | pass(); |
32 | 1b893ef3 | edgar_igl | return 0; |
33 | 1b893ef3 | edgar_igl | } |