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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [microblaze/] [isa/] [vanilla.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-options "-O3 -mcpu=v6.00.a -mcpu=v6.00.a" } */
2
 
3
volatile int m1, m2, m3;
4
volatile long l1, l2;
5
volatile long long llp;
6
volatile unsigned int u1, u2, u3;
7
 
8
volatile unsigned long ul1, ul2;
9
volatile unsigned long long ullp;
10
 
11
int test_mul () {
12
 
13
  /* { dg-final { scan-assembler-not "mul\tr" } } */
14
    m1 = m2 * m3 ;
15
 
16
  /* { dg-final { scan-assembler-not "muli" } } */
17
    m3 = m1 * 1234 ;
18
 
19
  /* { dg-final { scan-assembler-not "mulh" } } */
20
    llp = ((long long)l1 * l2);
21
 
22
  /* { dg-final { scan-assembler-not "mulhu" } } */
23
    ullp = ((unsigned long long)ul1 * ul2);
24
 
25
  /* { dg-final { scan-assembler-not "mulhsu" } } */
26
    llp = ((long long)l1 * ul2);
27
 
28
  /* { dg-final { scan-assembler-not "bslli" } } */
29
    m3 = m2 << 25;
30
 
31
  /* { dg-final { scan-assembler-not "bsll" } } */
32
    m2 = m1 << m3;
33
 
34
  /* { dg-final { scan-assembler-not "bsrai" } } */
35
    m3 = m2 >> 25;
36
 
37
  /* { dg-final { scan-assembler-not "bsra" } } */
38
    m2 = m1 >> m3;
39
 
40
  /* { dg-final { scan-assembler-not "idiv" } } */
41
    m1 = m2 / m1;
42
 
43
  /* { dg-final { scan-assembler-not "idivu" } } */
44
    u1 = u2 / u3;
45
 
46
  /* { dg-final { scan-assembler-not "pcmpne" } } */
47
    m3 = (m3 != m1);
48
 
49
  /* { dg-final { scan-assembler-not "pcmpeq" } } */
50
    return (m1 == m2);
51
}
52
 
53
 
54
 
55
volatile float f1, f2, f3;
56
 
57
void float_func ()
58
{
59
  /* { dg-final { scan-assembler-not "fmul" } } */
60
    f1 = f2 * f3;
61
 
62
  /* { dg-final { scan-assembler-not "fadd" } } */
63
    f1 = f2 + f3;
64
 
65
  /* { dg-final { scan-assembler-not "frsub" } } */
66
    f1 = f2 - f3;
67
 
68
  /* { dg-final { scan-assembler-not "fdiv" } } */
69
    f1 = f2 / f3;
70
 
71
}
72
 
73
void float_cmp_func ()
74
{
75
    /* { dg-final { scan-assembler-not "fcmp" } } */
76
    if (f2 <= f3)
77
        print ("le");
78
    else if (f2 == f3)
79
        print ("eq");
80
    else if (f2 < f3)
81
        print ("lt");
82
    else if (f2 > f3)
83
        print ("gt");
84
    else if (f2 >= f3)
85
        print ("ge");
86
    else if (f2 != f3)
87
        print ("ne");
88
 
89
}

powered by: WebSVN 2.1.0

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