SIMD Instruction Set for OLC completed and tested. #318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Phase 1 release
Hi Team, Yes its back! and working as expected now:
There are a bunch of new SIMD instruction for the team to play with and enjoy. I have added a few extra methods for merging of sprites, have fun.
You can see a demo here I will work on updates here, and you can get a preview of things to come.
Phase 2 will have NEON(ARM) support, I may introduce threading (using different CPUs to execute SIMD), but it may need a lot of changes to the engine, so I will need to reach out to @OneLoneCoder before I do anything, it may not be straight forward and my goal is to ensure backward compatibly.
This document should explain everything, I am continuously updating it and will also upload drafts to Discord
OLC PGE How to implement SIMD.docx
Finally please give it a good test, please please please break it and report bugs to me.
CHANGES:
#include <intrin.h>
Public: Class Sprite
Updated ~Sprite to clear any stored vector sprites
Inline void: void setStoreSubSprites(bool bStore)
Inline bool: bool getStoreSubSprites()
Inline void: void setInsturctionSet(SIMD_INSTRUCTON_OPTION option)
Inline int: SIMD_INSTRUCTON_OPTION getInsturctionSet()
Inline: bool CheckForSSESupport()
Inline: bool CheckForAVXSupport()
Inline: bool CheckForAVX512Support()
Inline: bool CheckForARMSupport() Placeholder not implemented yet
olc::Sprite* Duplicate(olc::Sprite::Flip flip);
olc::Sprite* Duplicate(uint32_t scale);
olc::Sprite* DuplicateMerge(const olc::vi2d& vTargetPos, olc::Sprite* pTargetSprite, olc::Pixel p = olc::BLANK);
olc::Sprite* Duplicate_SIMD();
olc::Sprite* Duplicate_SIMD(olc::Sprite::Flip flip);
olc::Sprite* Duplicate_SIMD(uint32_t scale); // John Galvin
olc::Sprite* Duplicate_SIMD(const olc::vi2d& vPos, const olc::vi2d& vSize);
olc::Sprite* DrawToTarget_SIMD(const olc::vi2d& vPos, olc::Sprite* pdrawTarget);
olc::Sprite* DrawToTarget_SIMD(const olc::vi2d& vPos, olc::Sprite* pdrawTarget, uint8_t flip);
olc::Sprite* DrawToTarget_SIMD(const olc::vi2d& vPos, olc::Sprite* pdrawTarget, uint32_t scale, uint8_t flip);
olc::Sprite* DuplicateMerge_SIMD(const olc::vi2d& vTargetPos, olc::Sprite* pTargetSprite, olc::Pixel p = olc::BLANK);
std::vector<std::tuple<olc::vi2d, olc::vi2d, uint32_t, uint8_t, Sprite*>> vecSubSprites;
Private: Class Sprite
Public: Class PixelGameEngine
Private: Class PixelGameEngine