Comments (9)
Issue was confirmed and reproduced. Fix implemented and this test should be working in the latest devel branch
from rev.
We've seen it fixed on e285dff, but on latest devel it is still broken (FPU issues in general, not this particular test case).
from rev.
Can confirm we are still seeing that... root caused to an issue with FP MV, fix in place and will be included in devel shortly
from rev.
Additional FP op updates pushed to devel - test should be working
from rev.
This particular test case is fixed on (4414659), but we stil see FPU issues.
Example:
int main() {
assert(fabs(-1) >= 1);
assert(fabs(-1) < 1.01);
return 0;
}
And something less trivial:
#include <cmath>
#define assert(x) if (!(x)) { asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); }
template <typename T> void testPI()
{
T pi = 0;
T n = 1;
for(int i = 0; i < 10000; i++, n += 2) {
T tmp = 4.0 / n;
if (i % 2)
pi -= tmp;
else pi += tmp;
}
assert(pi > 3.1414);
assert(pi < 3.1417);
}
int main() {
testPI<float>();
}
Sqrt is a dedicated instruction, so we need a test for that as well:
#include <cmath>
#define assert(x) if (!(x)) { asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); asm(".byte 0x00"); }
int main() {
float fx, fy;
double dx, dy;
fx = 25;
fy = sqrt(fx);
assert(fy > 4.99);
assert(fy < 5.01);
dx = 25;
dy = sqrt(dx);
assert(dy > 4.99);
assert(dy < 5.01);
fx = 8;
fy = sqrt(fx);
assert(fy > 2.8);
assert(fy < 2.9);
dx = 8;
dy = sqrt(dx);
assert(dy > 2.8);
assert(dy < 2.9);
return 0;
}
from rev.
Tested on (581618e), out of the four test cases posted earlier, the last two are failing at this point.
from rev.
Seems that we have a regression again on devel branch and tests which were passing are now broken.
Example:
volatile float a = 0.199;
volatile float b = 0.2;
assert(a < b);
assert(a <= b);
assert(b > a);
assert(b >= a);
a = 0.2;
assert(a == b);
from rev.
Revisiting this issue... The test above appears to be working properly, however, the testPi()
function appears to still fail. I believe the root cause of this is a double to single precision conversion that Rev is performing incorrectly - will address and have a fix ASAP
from rev.
This bug has become a container for multiple things. I believe it is not a good idea to track it this way. Original issue has been fixed so I am closing this bug and we'll create simpler self-contained issues with more specific problems.
from rev.
Related Issues (20)
- Strange behavior With `rev_read` when reading > 370 bytes HOT 8
- Off by one in mmap size region calculation HOT 3
- Odd segfault at the end of .text section HOT 4
- Using snprintf to populate buffer for rev_write segfaults HOT 3
- munmap test fails with memH enabled HOT 3
- Double addition ends as NaN HOT 7
- simple constructor crash HOT 4
- Argument passing / atoi conversion sensitivity to compiler output HOT 9
- missing thread execution for RV32I HOT 1
- Make spikeCheck modular based on the startSymbol passed in the rev config
- Statistics not being correctly accumulated or reported HOT 2
- fcvt.w.s does not support rounding modes HOT 8
- [FEATURE REQUEST] ifence HOT 1
- [FEATURE REQUEST] Support cache flush instructions HOT 1
- A problem with FPU register dependency tracking HOT 12
- Out of Memory error when using rev_mmap (with the memH memory backend) HOT 2
- c.addi16sp instruction is incorrectly printed as c.lui by Rev Tracer HOT 1
- Tracer is printing compressed register move instructions as c.jr instructions HOT 3
- [FEATURE REQUEST] Documentation HOT 3
- rev_read operation slowdown after large number of lines read HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rev.