Skip to content

Commit

Permalink
Fix SIMD when pixel counts aren't divisible by 8
Browse files Browse the repository at this point in the history
  • Loading branch information
kev626 committed Feb 14, 2022
1 parent 22f20b2 commit 81f546b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/api/0005-Optimize-map-rendering.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ classes and methods added by this patch should NOT be used in plugins.

diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
new file mode 100644
index 0000000000000000000000000000000000000000..48b67864752d6da4e2cc626e746eeb7c32b6524f
index 0000000000000000000000000000000000000000..2341b564b6383d5eca5fafe80273e046bfea070e
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
@@ -0,0 +1,79 @@
Expand All @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..48b67864752d6da4e2cc626e746eeb7c
+ public static void matchColorVectorized(int[] in, byte[] out) {
+ int speciesLength = IntVector.SPECIES_256.length();
+ int i;
+ for (i = 0; i < in.length; i += speciesLength) {
+ for (i = 0; i < in.length - speciesLength; i += speciesLength) {
+ float[] redsArr = new float[speciesLength];
+ float[] bluesArr = new float[speciesLength];
+ float[] greensArr = new float[speciesLength];
Expand Down

0 comments on commit 81f546b

Please sign in to comment.