~ubuntu-branches/ubuntu/wily/qemu-kvm-spice/wily

« back to all changes in this revision

Viewing changes to tests/cris/check_ftag.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-10-19 10:44:56 UTC
  • Revision ID: james.westby@ubuntu.com-20111019104456-xgvskumk3sxi97f4
Tags: upstream-0.15.0+noroms
ImportĀ upstreamĀ versionĀ 0.15.0+noroms

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <stdint.h>
 
4
#include "sys.h"
 
5
#include "crisutils.h"
 
6
 
 
7
static inline void cris_ftag_i(unsigned int x)
 
8
{
 
9
        register unsigned int v asm("$r10") = x;
 
10
        asm ("ftagi\t[%0]\n" : : "r" (v) );
 
11
}
 
12
static inline void cris_ftag_d(unsigned int x)
 
13
{
 
14
        register unsigned int v asm("$r10") = x;
 
15
        asm ("ftagd\t[%0]\n" : : "r" (v) );
 
16
}
 
17
static inline void cris_fidx_i(unsigned int x)
 
18
{
 
19
        register unsigned int v asm("$r10") = x;
 
20
        asm ("fidxi\t[%0]\n" : : "r" (v) );
 
21
}
 
22
static inline void cris_fidx_d(unsigned int x)
 
23
{
 
24
        register unsigned int v asm("$r10") = x;
 
25
        asm ("fidxd\t[%0]\n" : : "r" (v) );
 
26
}
 
27
 
 
28
 
 
29
int main(void)
 
30
{
 
31
        cris_ftag_i(0);
 
32
        cris_ftag_d(0);
 
33
        cris_fidx_i(0);
 
34
        cris_fidx_d(0);
 
35
        pass();
 
36
        return 0;
 
37
}