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.target/] [mips/] [dse-1.c] - Blame information for rev 321

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 321 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-mgp64 -O" } */
3
 
4
#define TEST(ID, TYPE1, TYPE2)                                  \
5
  union u##ID {                                                 \
6
    TYPE1 m1[sizeof (TYPE2) / sizeof (TYPE1)];                  \
7
    TYPE2 m2;                                                   \
8
  };                                                            \
9
                                                                \
10
  /* The MIPS16 versions of the shifts we need are too          \
11
     expensive.  */                                             \
12
  TYPE1 __attribute__((nomips16))                               \
13
  f##ID (TYPE2 x, union u##ID *u)                               \
14
  {                                                             \
15
    u->m2 = x;                                                  \
16
    return (u->m1[0]                                             \
17
            + u->m1[sizeof (TYPE2) / sizeof (TYPE1) - 1]);      \
18
  }                                                             \
19
                                                                \
20
  TYPE1 __attribute__((nomips16))                               \
21
  g##ID (union u##ID *u)                                        \
22
  {                                                             \
23
    u->m2 = 0;                                                   \
24
    return (u->m1[0] | u->m1[1]);                                \
25
  }
26
 
27
TEST (1, unsigned int, unsigned long long);
28
TEST (2, int, long long);
29
TEST (3, unsigned short, unsigned long long);
30
TEST (4, short, long long);
31
TEST (5, unsigned char, unsigned long long);
32
TEST (6, signed char, long long);
33
 
34
TEST (7, unsigned short, unsigned int);
35
TEST (8, short, int);
36
TEST (9, unsigned char, unsigned int);
37
TEST (10, signed char, int);
38
 
39
TEST (11, unsigned char, unsigned short);
40
TEST (12, signed char, short);
41
 
42
/* { dg-final { scan-assembler-not "\tlh\t" } } */
43
/* { dg-final { scan-assembler-not "\tlhu\t" } } */
44
/* { dg-final { scan-assembler-not "\tlw\t" } } */
45
/* { dg-final { scan-assembler-not "\tlwu\t" } } */
46
/* { dg-final { scan-assembler-not "\tlb\t" } } */
47
/* { dg-final { scan-assembler-not "\tlbu\t" } } */

powered by: WebSVN 2.1.0

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