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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.target/] [mips/] [octeon-bbit-3.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 321 jeremybenn
/* { dg-do compile } */
2
 
3
/* Force big-endian because for little-endian, combine generates this:
4
 
5
 (if_then_else (ne (zero_extract:DI (subreg:DI (truncate:SI (reg:DI 196)) 0)
6
                 (const_int 1)
7
                 (const_int 0))
8
             (const_int 0))
9
         (label_ref 20)
10
         (pc)))
11
 
12
  which does not get recognized as a valid bbit pattern.  The
13
  middle-end should be able to simplify this further.  */
14
/* { dg-options "-O2 -march=octeon -meb" } */
15
 
16
/* { dg-final { scan-assembler-times "\tbbit\[01\]\t|\tbgez\t" 2 } } */
17
/* { dg-final { scan-assembler-not "ext\t" } } */
18
 
19
void abort (void);
20
void exit (int);
21
 
22
typedef unsigned long long ulong64;
23
 
24
typedef struct bitfield_s {
25
  ulong64 a:1;
26
  ulong64 b:29;
27
  ulong64 c:1;
28
  ulong64 d:15;
29
  ulong64 f:18;
30
} bitfield_t;
31
 
32
bitfield_t bar;
33
 
34
NOMIPS16 void
35
f ()
36
{
37
  foo(&bar);
38
  if (bar.a != 0x1)
39
    abort ();
40
  else if (!bar.c)
41
    abort ();
42
  else
43
    exit (0);
44
}

powered by: WebSVN 2.1.0

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