Skip to content

Commit

Permalink
Fix java CP
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHua269 committed Aug 6, 2024
1 parent 8830d65 commit 58d45e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
19 changes: 9 additions & 10 deletions patches/api/0005-Pufferfish-SMID-Utilities.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ index 540fe7e2c110e79c3742f229b3ed8c54b101d260..3f04b36591899040a8b602db6475de49
into("META-INF/maven/${project.group}/${project.name}")
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
new file mode 100644
index 0000000000000000000000000000000000000000..3441cdad70da1bd523c5933b1a914688718c2657
index 0000000000000000000000000000000000000000..f00c008c03e2533f568085838cf13cb9b5b32cd9
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
@@ -0,0 +1,40 @@
@@ -0,0 +1,39 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import jdk.incubator.vector.FloatVector;
+import jdk.incubator.vector.IntVector;
+import jdk.incubator.vector.VectorSpecies;
+import org.slf4j.Logger;
+
+/**
+ * Basically, java is annoying and we have to push this out to its own class.
Expand All @@ -52,12 +51,12 @@ index 0000000000000000000000000000000000000000..3441cdad70da1bd523c5933b1a914688
+
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
+
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
+
+ logger.info("Max SIMD vector size on this system is {} bits (int)", ISPEC.vectorBitSize());
+ logger.info("Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
+
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
+ logger.warn("SIMD is not properly supported on this system!");
+ return false;
+ }
+
Expand All @@ -70,13 +69,13 @@ index 0000000000000000000000000000000000000000..3441cdad70da1bd523c5933b1a914688
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
new file mode 100644
index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c6070711b
index 0000000000000000000000000000000000000000..cd953435a6179eaae7c9cc250a791cae26c5567b
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
@@ -0,0 +1,35 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Logger;
+import org.slf4j.Logger;
+
+@Deprecated
+public class SIMDDetection {
Expand Down
5 changes: 3 additions & 2 deletions patches/server/0037-Pufferfish-SMID-Utilities.patch
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ index c2d3d699edfd60d773af96116c5663c812c691e9..1049681dfa7e48b4b6c29f4b1a09c689

diff --git a/src/main/java/me/earthme/luminol/config/modules/optimizations/SMIDConfig.java b/src/main/java/me/earthme/luminol/config/modules/optimizations/SMIDConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..b2b4a91925145b331a604384afee23ab276d76be
index 0000000000000000000000000000000000000000..b2e24ba49eaf7858bbd13872208b1beb7606b52d
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/config/modules/optimizations/SMIDConfig.java
@@ -0,0 +1,52 @@
@@ -0,0 +1,53 @@
+package me.earthme.luminol.config.modules.optimizations;
+
+import com.electronwill.nightconfig.core.file.CommentedFileConfig;
+import com.mojang.logging.LogUtils;
+import gg.pufferfish.pufferfish.simd.SIMDDetection;
+import me.earthme.luminol.config.ConfigInfo;
+import me.earthme.luminol.config.DoNotLoad;
+import me.earthme.luminol.config.EnumConfigCategory;
Expand Down

0 comments on commit 58d45e3

Please sign in to comment.