diff --git a/CHANGELOG.md b/CHANGELOG.md index 70ea88f3331814fcbda6b4a4eeedd22682a45d5a..dd05a76c8b6add24c4ca1baf039c12b4907ba667 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Updated KernelManager to facilitate class extensions having constructors with non static parameters * Enable kernel profiling and execution simultaneously on multiple devices (multiple threads calling same kernel class on multiple devices) * Fixed JVM crash with multi-dimensional arrays in Local memory (2D and 3D local arrays are now supported) +* Fixed: Signed integer constants were being interpreted as unsigned values in instruction SIPUSH ## 1.7.0 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 84040ab351b91d7d553733e267789bf4fcec7a37..e0ef9adb73474858e0c128a3fd6d24dd6628f7b4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -49,4 +49,5 @@ Below are some of the specific details of various contributions. * Luis Mendes with suggestions by Automenta submited PR for issue #62 and implemented new thread-safe API for Kernel profiling * Luis Mendes submited PR for issue #101 - Possible deadlock in JTP mode * Luis Mendes submited PR to facilitate KernelManager class extension with non-static parameters in constructors -* Luis Mendes submited PR to Enable kernel profiling and execution simultaneously on multiple devices \ No newline at end of file +* Luis Mendes submited PR to Enable kernel profiling and execution simultaneously on multiple devices +* Luis Mendes submited PR to fix issue #78 - Signed integer constants were interpreted as unsigned values for instruction SIPUSH \ No newline at end of file diff --git a/src/main/java/com/aparapi/internal/instruction/InstructionSet.java b/src/main/java/com/aparapi/internal/instruction/InstructionSet.java index fa0f63f8cc6674800732c5a3247a4d02e1c0eef1..cc331733f2696dffdd509c804ccd1d31cc63ee92 100644 --- a/src/main/java/com/aparapi/internal/instruction/InstructionSet.java +++ b/src/main/java/com/aparapi/internal/instruction/InstructionSet.java @@ -3507,7 +3507,7 @@ public class InstructionSet{ public static class I_SIPUSH extends ImmediateConstant<Integer>{ public I_SIPUSH(MethodModel _methodPoolEntry, ByteReader _byteReader, boolean _wide) { super(_methodPoolEntry, ByteCode.SIPUSH, _byteReader, _wide); - value = _byteReader.u2(); + value = _byteReader.s2(); } @Override public String getDescription() { diff --git a/src/test/java/com/aparapi/runtime/NegativeIntegerTest.java b/src/test/java/com/aparapi/runtime/NegativeIntegerTest.java index ee07714aa44319a48170b3820a8c37613f900ff8..080048856a95d6cbd0761a6f63163b86a7c3cb31 100644 --- a/src/test/java/com/aparapi/runtime/NegativeIntegerTest.java +++ b/src/test/java/com/aparapi/runtime/NegativeIntegerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016 - 2017 Syncleus, Inc. + * Copyright (c) 2016 - 2018 Syncleus, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package com.aparapi.runtime; import static org.junit.Assert.assertEquals; @@ -59,7 +58,6 @@ public class NegativeIntegerTest openCLDevice = (OpenCLDevice) device; } - @Ignore("Test currently failing") @Test public void negativeIntegerTestPass() {