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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [arm/] [cmp-2.c] - Blame information for rev 714

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do compile } */
2
/* { dg-require-effective-target arm_vfp_ok } */
3
/* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
4
/* { dg-options "-O -mfpu=vfp -mfloat-abi=softfp" } */
5
/* { dg-final { scan-assembler-not "\tbl\t" } } */
6
/* { dg-final { scan-assembler-not "__aeabi" } } */
7
int x, y;
8
 
9
#define EQ(X, Y) ((X) == (Y))
10
#define NE(X, Y) ((X) != (Y))
11
#define LT(X, Y) ((X) < (Y))
12
#define GT(X, Y) ((X) > (Y))
13
#define LE(X, Y) ((X) <= (Y))
14
#define GE(X, Y) ((X) >= (Y))
15
 
16
#define TEST_EXPR(NAME, ARGS, EXPR)                     \
17
  int NAME##1 ARGS { return (EXPR); }                   \
18
  int NAME##2 ARGS { return !(EXPR); }                  \
19
  int NAME##3 ARGS { return (EXPR) ? x : y; }           \
20
  void NAME##4 ARGS { if (EXPR) x++; }                  \
21
  void NAME##5 ARGS { if (!(EXPR)) x++; }
22
 
23
#define TEST(NAME, TYPE, OPERATOR) \
24
  TEST_EXPR (NAME##_rr, (TYPE a1, TYPE a2), OPERATOR (a1, a2))          \
25
  TEST_EXPR (NAME##_rm, (TYPE a1, TYPE *a2), OPERATOR (a1, *a2))        \
26
  TEST_EXPR (NAME##_mr, (TYPE *a1, TYPE a2), OPERATOR (*a1, a2))        \
27
  TEST_EXPR (NAME##_mm, (TYPE *a1, TYPE *a2), OPERATOR (*a1, *a2))      \
28
  TEST_EXPR (NAME##_rc, (TYPE a1), OPERATOR (a1, 100))                  \
29
  TEST_EXPR (NAME##_cr, (TYPE a1), OPERATOR (100, a1))
30
 
31
#define TEST_OP(NAME, OPERATOR) \
32
  TEST (f_##NAME, float, OPERATOR)              \
33
  TEST (d_##NAME, double, OPERATOR)             \
34
  TEST (ld_##NAME, long double, OPERATOR)
35
 
36
TEST_OP (eq, EQ)
37
TEST_OP (ne, NE)
38
TEST_OP (lt, LT)
39
TEST_OP (gt, GT)
40
TEST_OP (le, LE)
41
TEST_OP (ge, GE)
42
TEST_OP (blt, __builtin_isless)
43
TEST_OP (bgt, __builtin_isgreater)
44
TEST_OP (ble, __builtin_islessequal)
45
TEST_OP (bge, __builtin_isgreaterequal)
46
/* This one should be expanded into separate ordered and equality
47
   comparisons.  */
48
TEST_OP (blg, __builtin_islessgreater)
49
TEST_OP (bun, __builtin_isunordered)

powered by: WebSVN 2.1.0

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