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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [bfin/] [mul-combine.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* Make sure combine eliminates all unnecessary instructions for the
2
   sixteen cases of hi/lo multiplications.  */
3
 
4
/* { dg-do compile } */
5
/* { dg-options "-O2" } */
6
 
7
/* { dg-final { scan-assembler-not "<<" } } */
8
/* { dg-final { scan-assembler-not "PACK" } } */
9
 
10
extern void abort (void);
11
extern void exit (int);
12
 
13
typedef short  __v2hi __attribute ((vector_size(4)));
14
typedef __v2hi fract2x16;
15
typedef short fract16;
16
 
17
#define GETVECT(HILO1,HILO2,IN1,IN2)                                    \
18
  __builtin_bfin_compose_2x16 ((HILO2) ? __builtin_bfin_extract_hi (IN1) : __builtin_bfin_extract_lo (IN1), \
19
                          (HILO1) ? __builtin_bfin_extract_hi (IN2) : __builtin_bfin_extract_lo (IN2))
20
#define DOTEST(IN1, IN2, HL1, HL2, HL3, HL4)                                    \
21
  __builtin_bfin_multr_fr2x16 (GETVECT (HL1, HL2, IN1, IN1), \
22
                          GETVECT (HL3, HL4, IN2, IN2))
23
 
24
#define FUNC(HL1, HL2, HL3, HL4) \
25
  fract2x16 foo ## HL1 ## HL2 ## HL3 ## HL4 (fract2x16 a, fract2x16 b)\
26
  { \
27
    return DOTEST(a, b, HL1, HL2, HL3, HL4);\
28
  }
29
 
30
FUNC (0, 0, 0, 0)
31
FUNC (1, 0, 0, 0)
32
FUNC (0, 1, 0, 0)
33
FUNC (1, 1, 0, 0)
34
FUNC (0, 0, 1, 0)
35
FUNC (1, 0, 1, 0)
36
FUNC (0, 1, 1, 0)
37
FUNC (1, 1, 1, 0)
38
FUNC (0, 0, 0, 1)
39
FUNC (1, 0, 0, 1)
40
FUNC (0, 1, 0, 1)
41
FUNC (1, 1, 0, 1)
42
FUNC (0, 0, 1, 1)
43
FUNC (1, 0, 1, 1)
44
FUNC (0, 1, 1, 1)
45
FUNC (1, 1, 1, 1)

powered by: WebSVN 2.1.0

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