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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [shift_mask.c] - Rev 691

Compare with Previous | Blame | View Log

/* { dg-do compile } */
/* { dg-options "-O2" } */
 
int test_sal (int a, int c)
{
  return a << (c & 0x1f);
}
 
int test_sar (int a, int c)
{
  return a >> (c & 0x1f);
}
 
unsigned int test_shr (unsigned int a, int c)
{
  return a >> (c & 0x1f);
}
 
unsigned int test_rol (unsigned int a, int c)
{
  int z = c & 0x1f;
  return (a << z) | (a >> (32 - z));
}
 
unsigned int test_ror (unsigned int a, int c)
{
  int z = c & 0x1f;
  return (a >> z) | (a << (32 - z));
}
 
/* { dg-final { scan-assembler-not "and" } } */
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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