diff options
Diffstat (limited to 'tests/tcg/cris/libc/check_ftag.c')
-rw-r--r-- | tests/tcg/cris/libc/check_ftag.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/tcg/cris/libc/check_ftag.c b/tests/tcg/cris/libc/check_ftag.c new file mode 100644 index 0000000000..aaa5c97115 --- /dev/null +++ b/tests/tcg/cris/libc/check_ftag.c @@ -0,0 +1,37 @@ +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include "sys.h" +#include "crisutils.h" + +static always_inline void cris_ftag_i(unsigned int x) +{ + register unsigned int v asm("$r10") = x; + asm ("ftagi\t[%0]\n" : : "r" (v) ); +} +static always_inline void cris_ftag_d(unsigned int x) +{ + register unsigned int v asm("$r10") = x; + asm ("ftagd\t[%0]\n" : : "r" (v) ); +} +static always_inline void cris_fidx_i(unsigned int x) +{ + register unsigned int v asm("$r10") = x; + asm ("fidxi\t[%0]\n" : : "r" (v) ); +} +static always_inline void cris_fidx_d(unsigned int x) +{ + register unsigned int v asm("$r10") = x; + asm ("fidxd\t[%0]\n" : : "r" (v) ); +} + + +int main(void) +{ + cris_ftag_i(0); + cris_ftag_d(0); + cris_fidx_i(0); + cris_fidx_d(0); + pass(); + return 0; +} |