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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [sh/] [pr49468-si.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* Check that 32 bit integer abs is generated as neg instruction and
2
   conditional branch instead of default branch-free code.  */
3
/* { dg-do compile { target "sh*-*-*" } } */
4
/* { dg-options "-O1" } */
5
/* { dg-final { scan-assembler-times "neg" 2 } } */
6
 
7
 
8
/* Normal integer absolute value.  */
9
int
10
abs_0 (int i)
11
{
12
  return (i < 0) ? -i : i;
13
}
14
 
15
/*  Negated integer absolute value.
16
    The generated code should be the same, except that the branch
17
    condition is inverted.  */
18
int
19
abs_1 (int i)
20
{
21
  return (i > 0) ? -i : i;
22
}

powered by: WebSVN 2.1.0

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