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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [pr39607.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
// PR rtl-optimization/39607
2
// { dg-do compile }
3
// { dg-options "-O2" }
4
 
5
void abcErrorMessage(int error);
6
enum AbcSurfType {
7
    SURF_U,
8
    SURF_V
9
};
10
class AbcVec2d
11
{
12
public:
13
    double x;
14
    double y;
15
};
16
class AbcIval1d
17
{
18
protected:
19
    double m_dMin;
20
    double m_dMax;
21
public:
22
    AbcIval1d();
23
    AbcIval1d(double dMin, double dMax);
24
    double GetMax() const { return m_dMax; }
25
    double GetMin() const { return m_dMin; }
26
};
27
inline AbcIval1d::AbcIval1d(double dMin, double dMax)
28
{
29
    if (dMin > dMax) {
30
        abcErrorMessage(1);
31
    }
32
    else {
33
        m_dMin = dMin;
34
        m_dMax = dMax;
35
    }
36
}
37
class AbcIval2d
38
{
39
protected:
40
    AbcVec2d m_vMin;
41
    AbcVec2d m_vMax;
42
public:
43
    AbcVec2d GetMax() const { return m_vMax; }
44
    AbcVec2d GetMin() const { return m_vMin; }
45
};
46
class AbcCone
47
{
48
protected:
49
    int m_uv;
50
public:
51
    AbcIval2d GetNaturalUVDomain() const;
52
    AbcIval1d GetLinearParamIval(AbcSurfType * pSurfParam) const;
53
};
54
AbcIval1d AbcCone::GetLinearParamIval(AbcSurfType * pSurfParam) const
55
{
56
    AbcIval1d sIval;
57
    AbcIval2d sUVDomain = GetNaturalUVDomain();
58
    if (m_uv) {
59
        sIval = AbcIval1d(sUVDomain.GetMin().x,sUVDomain.GetMax().x);
60
    }
61
    else {
62
        sIval = AbcIval1d(sUVDomain.GetMin().y,sUVDomain.GetMax().y);
63
    }
64
    return sIval;
65
}

powered by: WebSVN 2.1.0

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