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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20040101-1.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
typedef unsigned short uint16_t;
2
typedef unsigned int uint32_t;
3
 
4
#define CF (1<<0)
5
#define PF (1<<2)
6
#define AF (1<<4)
7
#define ZF (1<<6)
8
#define SF (1<<7)
9
#define OF (1<<11)
10
 
11
#define EFLAGS_BITS (CF|PF|AF|ZF|SF|OF)
12
 
13
void test16(uint16_t x, uint32_t eflags)
14
{
15
        uint16_t bsr_result;
16
        uint32_t bsr_eflags;
17
        uint16_t bsf_result;
18
        uint32_t bsf_eflags;
19
 
20
        __asm volatile(""
21
                : "=&r" (bsr_result), "=&r" (bsr_eflags)
22
                : "r" (x), "i" (~EFLAGS_BITS), "r" (eflags));
23
        __asm volatile(""
24
                : "=&r" (bsf_result), "=&r" (bsf_eflags)
25
                : "r" (x), "i" (~EFLAGS_BITS), "r" (eflags));
26
        printf("%08x %04x bsrw %02x %08x bsfw %02x %08x\n",
27
                x, eflags, bsr_result, bsr_eflags, bsf_result, bsf_eflags);
28
}

powered by: WebSVN 2.1.0

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