URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
/* We used to ICE as we did not mark a Vop for rename as
|
/* We used to ICE as we did not mark a Vop for rename as
|
we changed a function call to a normal modify statement
|
we changed a function call to a normal modify statement
|
while folding exp(0.0); */
|
while folding exp(0.0); */
|
|
|
double exp(double);
|
double exp(double);
|
void f0(void);
|
void f0(void);
|
void f(double);
|
void f(double);
|
typedef struct Parser {
|
typedef struct Parser {
|
int x;
|
int x;
|
char *s;
|
char *s;
|
} Parser;
|
} Parser;
|
static double pop(Parser *p) {
|
static double pop(Parser *p) {
|
if (p->s[0] <= 0) {
|
if (p->s[0] <= 0) {
|
f0();
|
f0();
|
return 0;
|
return 0;
|
}
|
}
|
--p->x;
|
--p->x;
|
return 0;
|
return 0;
|
}
|
}
|
static void evalFactor(Parser *p) {
|
static void evalFactor(Parser *p) {
|
while (p->x)
|
while (p->x)
|
f(exp(pop(p)));
|
f(exp(pop(p)));
|
}
|
}
|
static void evalTerm(Parser *p) {
|
static void evalTerm(Parser *p) {
|
while (p->s[0])
|
while (p->s[0])
|
evalFactor(p);
|
evalFactor(p);
|
}
|
}
|
static void evalExpression(Parser *p) {
|
static void evalExpression(Parser *p) {
|
evalTerm(p);
|
evalTerm(p);
|
while (p->s[0])
|
while (p->s[0])
|
evalTerm(p);
|
evalTerm(p);
|
}
|
}
|
void evalPrimary(Parser *p) {
|
void evalPrimary(Parser *p) {
|
if (p->s)
|
if (p->s)
|
return;
|
return;
|
evalExpression(p);
|
evalExpression(p);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.