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.dg/] [pr40501.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile { target alpha*-*-* ia64*-*-* x86_64-*-* s390x-*-* } } */
2
/* { dg-options "-O2" } */
3
/* { dg-require-effective-target lp64 } */
4
 
5
/* PR middle-end/40501 */
6
 
7
/* This once failed due to the bswap pass missing to add the type
8
   casts of the signed argument and result to the proper unsigned
9
   types.  */
10
 
11
typedef long int int64_t;
12
 
13
int64_t
14
swap64 (int64_t n)
15
{
16
  return (((n & (((int64_t) 0xff) )) << 56) |
17
          ((n & (((int64_t) 0xff) << 8)) << 40) |
18
          ((n & (((int64_t) 0xff) << 16)) << 24) |
19
          ((n & (((int64_t) 0xff) << 24)) << 8) |
20
          ((n & (((int64_t) 0xff) << 32)) >> 8) |
21
          ((n & (((int64_t) 0xff) << 40)) >> 24) |
22
          ((n & (((int64_t) 0xff) << 48)) >> 40) |
23
          ((n & (((int64_t) 0xff) << 56)) >> 56));
24
}

powered by: WebSVN 2.1.0

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