Comments (7)
I've fixed division in NEON, the explanation for why it was broken is here f8ebd87. Let me know if this is still an issue for you. It is "fixed" in the sense that it is consistent with SSE now, but the issue of large integers remains.
from hlslpp.
@redorav Thanks for quick turnaround! My tests are passing fine with this update on M1 ✅
from hlslpp.
Hi @egorodet, it is a known issue that integer division is broken. There are no intrinsics for integer division and when I sat down to find a solution I couldn't find anything that wasn't a bit of a monster and left it for the future. Currently all it does is cast to float, divide and cast back which obviously isn't very good.
I had an issue open already, I'll close that one and track here instead. If you know of a good solution I could put in that would make it much easier, otherwise I'll see when I can find a bit of time to look into it.
from hlslpp.
Copying original comment from the other bug:
SSE doesn't have native division instructions for vectors. One possibility is to extract the scalars, divide, then put back. Another alternative is to take a look at this website which seems to have alternatives and claim to be fast
from hlslpp.
Hi @redorav, yes I see that current implementation is not perfect, but it seems to work in most cases on x86/64 architecture, but gives completely wrong results on ARM (Apple M1 in my case). So additionally to existing issue, there's something wrong in the NEON implementation of the current workaround.
from hlslpp.
I added workaround in the code of my wrapper class Point
, so it should not be a stopper for me. It's up to you if it's better to keep or close this issue. I'm fine with description of the existing issue, just want to raise its priority because current implementation could give wrong results.
from hlslpp.
Thank you for detailed report, hlsl++ is a lot better thanks to your efforts
from hlslpp.
Related Issues (20)
- Integer vector comparison is working incorrectly on Intel based Macs with MacOS >= 11 HOT 3
- Improve HLSL++ unit tests by using full-featured testing framework HOT 2
- Matrix accessor operator HOT 6
- operator / (float1, float3) looks inverted HOT 8
- How well does this cover HLSL202x? HOT 11
- * operator brake mult function in quaternion HOT 7
- Quaternion slerp returning nan values HOT 2
- Clang error: unused variable 't4' in hlsl++_quaternion.h HOT 6
- Upgrade warnings to errors HOT 2
- round() on ARM Neon uses wrong rounding mode HOT 2
- mul() intrinsic is missing some overloads. HOT 2
- clamp() intrinsic is missing overloads for intN HOT 1
- Some non square matrix definitions are incorrect HOT 6
- Missing matrix constructors HOT 2
- Some vector double functions missing HOT 5
- Undefined behavior when accessing vector elements with operator[] HOT 10
- internal::round_float gives incorrect results HOT 4
- Build failure on G++13.2 HOT 11
- Errors on building Linux ARM64 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 hlslpp.