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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [sparc/] [setcc-2.c] - Rev 711

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

/* { dg-do compile } */
/* { dg-options "-O1" } */
 
int neq (int a, int b)
{
  return -(a != b);
}
 
int eq (int a, int b)
{
  return -(a == b);
}
 
int lt (unsigned int a, unsigned int b)
{
  return -(a < b);
}
 
int leq (unsigned int a, unsigned int b)
{
  return -(a <= b);
}
 
int geq (unsigned int a, unsigned int b)
{
  return -(a >= b);
}
 
int gt (unsigned int a, unsigned int b)
{
  return -(a > b);
}
 
/* { dg-final { scan-assembler-times "xor\t%" 2 } } */
/* { dg-final { scan-assembler-times "subcc\t%" 2 } } */
/* { dg-final { scan-assembler-times "addx\t%" 3 } } */
/* { dg-final { scan-assembler-times "subx\t%" 3 } } */
/* { dg-final { scan-assembler-times "cmp\t%" 4 } } */
/* { dg-final { scan-assembler-not "sra\t%" { target lp64 } } } */
 

Go to most recent revision | 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.