Code Monkey home page Code Monkey logo

Comments (7)

redorav avatar redorav commented on June 2, 2024 1

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.

egorodet avatar egorodet commented on June 2, 2024 1

@redorav Thanks for quick turnaround! My tests are passing fine with this update on M1 ✅

from hlslpp.

redorav avatar redorav commented on June 2, 2024

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.

redorav avatar redorav commented on June 2, 2024

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

http://libdivide.com/

from hlslpp.

egorodet avatar egorodet commented on June 2, 2024

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.

egorodet avatar egorodet commented on June 2, 2024

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.

redorav avatar redorav commented on June 2, 2024

Thank you for detailed report, hlsl++ is a lot better thanks to your efforts

from hlslpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.