From vladimir.x.ivanov at oracle.com Tue Sep 5 18:30:33 2017 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Tue, 5 Sep 2017 21:30:33 +0300 Subject: Results: New panama Committer: Razvan Lupusoru Message-ID: <64b4ab97-2943-e0cf-cd2b-09b600271840@oracle.com> Voting for Razvan Lupusoru [1] is now closed. Yes: 5 Veto: 0 Abstain: 0 According to the Bylaws definition of Lazy Consensus, this is sufficient to approve the nomination. Best regards, Vladimir Ivanov [1] http://mail.openjdk.java.net/pipermail/panama-dev/2017-August/000680.html From vladimir.x.ivanov at oracle.com Tue Sep 5 18:33:11 2017 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Tue, 5 Sep 2017 21:33:11 +0300 Subject: Results: New panama Committer: Vivek Deshpande Message-ID: <92569f6a-76a1-e0e8-0bbd-ad37d0e254cb@oracle.com> Voting for Vivek Deshpande [1] is now closed. Yes: 5 Veto: 0 Abstain: 0 According to the Bylaws definition of Lazy Consensus, this is sufficient to approve the nomination. Best regards, Vladimir Ivanov [1] http://mail.openjdk.java.net/pipermail/panama-dev/2017-August/000679.html From vladimir.x.ivanov at oracle.com Tue Sep 5 18:38:03 2017 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Tue, 5 Sep 2017 21:38:03 +0300 Subject: Intrinsic Support for more vector APIs In-Reply-To: <53E8E64DB2403849AFD89B7D4DAC8B2A771A62A2@ORSMSX106.amr.corp.intel.com> References: <53E8E64DB2403849AFD89B7D4DAC8B2A771A62A2@ORSMSX106.amr.corp.intel.com> Message-ID: <698d2645-eb2f-560b-d81c-74746d3b3d57@oracle.com> Looks good. (Haven't done any testing. Please, at least, build product & fastdebug binaries on your side before pushing the change.) Best regards, Vladimir Ivanov On 8/30/17 4:31 AM, Deshpande, Vivek R wrote: > Hi All > > I have webrev for Intrinsic Support for some more vector APIs at this > location. > > http://cr.openjdk.java.net/~vdeshpande/Panama_VAPI/webrev.00/ > > I have added support for div, broadcast, zero, equal, lessThan, Blend > for types Int > > and div, lessThan, zero, broadcast for float and length vector APIs for > 256 bit vectors. > > Could you please take a look and review the patch. > > Thanks. > > Regards, > > Vivek > From razvan.a.lupusoru at intel.com Tue Sep 5 18:40:02 2017 From: razvan.a.lupusoru at intel.com (Lupusoru, Razvan A) Date: Tue, 5 Sep 2017 18:40:02 +0000 Subject: Intrinsic Support for more vector APIs In-Reply-To: <698d2645-eb2f-560b-d81c-74746d3b3d57@oracle.com> References: <53E8E64DB2403849AFD89B7D4DAC8B2A771A62A2@ORSMSX106.amr.corp.intel.com> <698d2645-eb2f-560b-d81c-74746d3b3d57@oracle.com> Message-ID: <48D92A70936F7946BE99F3FF5ECB6461D8DCECFB@ORSMSX113.amr.corp.intel.com> Yes, will do. Thanks for review! --Razvan -----Original Message----- From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com] Sent: Tuesday, September 05, 2017 11:38 AM To: Deshpande, Vivek R ; panama-dev at openjdk.java.net Cc: Lupusoru, Razvan A ; Viswanathan, Sandhya ; Paul Sandoz Subject: Re: Intrinsic Support for more vector APIs Looks good. (Haven't done any testing. Please, at least, build product & fastdebug binaries on your side before pushing the change.) Best regards, Vladimir Ivanov On 8/30/17 4:31 AM, Deshpande, Vivek R wrote: > Hi All > > I have webrev for Intrinsic Support for some more vector APIs at this > location. > > http://cr.openjdk.java.net/~vdeshpande/Panama_VAPI/webrev.00/ > > I have added support for div, broadcast, zero, equal, lessThan, Blend > for types Int > > and div, lessThan, zero, broadcast for float and length vector APIs > for > 256 bit vectors. > > Could you please take a look and review the patch. > > Thanks. > > Regards, > > Vivek > From maurizio.cimadamore at oracle.com Wed Sep 6 10:18:28 2017 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Wed, 06 Sep 2017 10:18:28 +0000 Subject: hg: panama/panama: Enhancement: update rpath of libjclang so that libclang is found automatically Message-ID: <201709061018.v86AISgX002099@aojmv0008.oracle.com> Changeset: 6bc124afaba7 Author: mcimadamore Date: 2017-09-06 11:15 +0100 URL: http://hg.openjdk.java.net/panama/panama/rev/6bc124afaba7 Enhancement: update rpath of libjclang so that libclang is found automatically ! common/autoconf/flags.m4 ! common/autoconf/generated-configure.sh ! common/autoconf/spec.gmk.in From maurizio.cimadamore at oracle.com Wed Sep 6 10:20:22 2017 From: maurizio.cimadamore at oracle.com (maurizio.cimadamore at oracle.com) Date: Wed, 06 Sep 2017 10:20:22 +0000 Subject: hg: panama/panama/jdk: Enhancement: update rpath of libjclang so that libclang is found automatically Message-ID: <201709061020.v86AKNfE003090@aojmv0008.oracle.com> Changeset: d44066a2b72f Author: mcimadamore Date: 2017-09-06 11:16 +0100 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/d44066a2b72f Enhancement: update rpath of libjclang so that libclang is found automatically Fix: test/java/nicl/System/UnixSystem.java does not compile Enhancement: include jextract tests in jdk_nicl jtreg group ! make/lib/Lib-jdk.internal.clang.gmk ! test/TEST.groups ! test/java/nicl/System/UnixSystem.java From sundararajan.athijegannathan at oracle.com Wed Sep 6 10:54:03 2017 From: sundararajan.athijegannathan at oracle.com (sundararajan.athijegannathan at oracle.com) Date: Wed, 06 Sep 2017 10:54:03 +0000 Subject: hg: panama/panama/jdk: disabling couple of asserts in jdk.internal.clang module. With this, jextract jtreg tests run fine with -ea and -esa options. Message-ID: <201709061054.v86As31g015857@aojmv0008.oracle.com> Changeset: d0295ee3f79c Author: sundar Date: 2017-09-06 16:24 +0530 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/d0295ee3f79c disabling couple of asserts in jdk.internal.clang module. With this, jextract jtreg tests run fine with -ea and -esa options. ! src/jdk.internal.clang/share/classes/jdk/internal/clang/Cursor.java ! src/jdk.internal.clang/share/classes/jdk/internal/clang/Type.java From paul.sandoz at oracle.com Thu Sep 7 18:27:39 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Thu, 07 Sep 2017 18:27:39 +0000 Subject: hg: panama/panama/jdk: Add mask accepting intoArray Message-ID: <201709071827.v87IRe3p023007@aojmv0008.oracle.com> Changeset: 319593c394e9 Author: psandoz Date: 2017-09-07 11:24 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/319593c394e9 Add mask accepting intoArray ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/ByteVector.java ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/DoubleVector.java ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/FloatVector.java ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/IntVector.java ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/LongVector.java ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/ShortVector.java ! test/panama/vector-draft-spec/src/main/java/com/oracle/vector/X-Vector.java.template From vivek.r.deshpande at intel.com Fri Sep 8 22:44:56 2017 From: vivek.r.deshpande at intel.com (Deshpande, Vivek R) Date: Fri, 8 Sep 2017 22:44:56 +0000 Subject: Intrinsic Support for more vector APIs In-Reply-To: <48D92A70936F7946BE99F3FF5ECB6461D8DCECFB@ORSMSX113.amr.corp.intel.com> References: <53E8E64DB2403849AFD89B7D4DAC8B2A771A62A2@ORSMSX106.amr.corp.intel.com> <698d2645-eb2f-560b-d81c-74746d3b3d57@oracle.com> <48D92A70936F7946BE99F3FF5ECB6461D8DCECFB@ORSMSX113.amr.corp.intel.com> Message-ID: <53E8E64DB2403849AFD89B7D4DAC8B2A771A9594@ORSMSX106.amr.corp.intel.com> Hi All I have updated the patch with some changes. http://cr.openjdk.java.net/~vdeshpande/Panama_VAPI/webrev.01 I am planning to commit the changes when I get added into the committer list in the census. Regards, Vivek -----Original Message----- From: Lupusoru, Razvan A Sent: Tuesday, September 5, 2017 11:40 AM To: Vladimir Ivanov ; Deshpande, Vivek R ; panama-dev at openjdk.java.net Cc: Viswanathan, Sandhya ; Paul Sandoz Subject: RE: Intrinsic Support for more vector APIs Yes, will do. Thanks for review! --Razvan -----Original Message----- From: Vladimir Ivanov [mailto:vladimir.x.ivanov at oracle.com] Sent: Tuesday, September 05, 2017 11:38 AM To: Deshpande, Vivek R ; panama-dev at openjdk.java.net Cc: Lupusoru, Razvan A ; Viswanathan, Sandhya ; Paul Sandoz Subject: Re: Intrinsic Support for more vector APIs Looks good. (Haven't done any testing. Please, at least, build product & fastdebug binaries on your side before pushing the change.) Best regards, Vladimir Ivanov On 8/30/17 4:31 AM, Deshpande, Vivek R wrote: > Hi All > > I have webrev for Intrinsic Support for some more vector APIs at this > location. > > http://cr.openjdk.java.net/~vdeshpande/Panama_VAPI/webrev.00/ > > I have added support for div, broadcast, zero, equal, lessThan, Blend > for types Int > > and div, lessThan, zero, broadcast for float and length vector APIs > for > 256 bit vectors. > > Could you please take a look and review the patch. > > Thanks. > > Regards, > > Vivek > From john.r.rose at oracle.com Thu Sep 14 04:49:28 2017 From: john.r.rose at oracle.com (John Rose) Date: Wed, 13 Sep 2017 21:49:28 -0700 Subject: FTR: mapping class-like APIs to interfaces In-Reply-To: References: Message-ID: <6E8BABB8-B3BB-40B6-8A7F-2BB5827C6942@oracle.com> On May 18, 2017, at 8:56 PM, John Rose wrote: > > Spurred by a conversation with some Intel colleagues, I wrote up an account > of how we can use Java interfaces to model various kinds of APIs. This file talks about the design of polymorphic data structures by means of the binder pattern. I just added to it: http://cr.openjdk.java.net/~jrose/panama/using-interfaces.html There is a couple of new pages at the end about reifying binders, via API points that ask a bound object which binder made it. This is for use cases where you *often* don't care about how an object is formatted (persistent memory, off-heap, POJO), but *sometimes* you do. (If you cared *always*, you'd use separate types for the separate cases. Using an interface that spans everything allows you to write relaxed-typed code, and generic algorithms. Using a type variable to reify the binder type opens the door to strongly typed generic code which can still "peek" at the binder, if it needs to.) This came up in today's quarterly Intel F2F, when Steve Dohrmann was explaining his recent work on persistent collections for Java, which is at . A surprising insight from today: For some bindable APIs, java.lang.String should not be used to represent text. Instead, it is better to use CharSequence since that is polymorphic. That way the binder may choose to leave the characters in the original backing storage, rather than marshaling them eagerly into the body of a java.lang.String. A POJO binder can just use String directly as its preferred implementation of CharSequence. I wonder if that insight applies to the strings we extract from C char* pointers? ? John From paul.sandoz at oracle.com Thu Sep 14 18:34:35 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Thu, 14 Sep 2017 18:34:35 +0000 Subject: hg: panama/panama/hotspot: More Vector API intrinsics patch Message-ID: <201709141834.v8EIYZDA020152@aojmv0008.oracle.com> Changeset: 3743b61ff4e8 Author: vdeshpande Date: 2017-09-14 11:18 -0700 URL: http://hg.openjdk.java.net/panama/panama/hotspot/rev/3743b61ff4e8 More Vector API intrinsics patch ! src/cpu/x86/vm/assembler_x86.cpp ! src/cpu/x86/vm/assembler_x86.hpp ! src/cpu/x86/vm/x86.ad ! src/share/vm/ci/ciType.cpp ! src/share/vm/ci/ciType.hpp ! src/share/vm/classfile/vmSymbols.hpp ! src/share/vm/opto/c2compiler.cpp ! src/share/vm/opto/doCall.cpp ! src/share/vm/opto/library_call.cpp ! src/share/vm/opto/type.hpp ! src/share/vm/opto/vectornode.hpp From paul.sandoz at oracle.com Thu Sep 14 18:50:31 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Thu, 14 Sep 2017 11:50:31 -0700 Subject: Move Vector API from scratch project to an incubator module Message-ID: Hi, The vector intrinsics work is making some good progress. I propose to move the Vector API from jdk/test/panama/vector-draft-spec to its own module in the JDK named jdk.incubator.vector with classes under a package of the same name. That way an OpenJDK ea distribution of panama will include the Vector API and developers can easily experiment. One awkward aspect is @HotSpotIntrinsicCandidate is internal to the JDK and only usable in java.base. We can export it?s package to the jdk.incubator.vector module and IIUC ensure classes in the vector module are loaded by the platform class loader, thus annotated methods that are intrinsic are acknowledged. (Ideally HotSpotIntrinsicCandidate should reside in the package jdk.internal.vm.annotation.) Paul. From mail at smogura.eu Fri Sep 15 04:28:48 2017 From: mail at smogura.eu (=?utf-8?B?UmFkb3PFgmF3IFNtb2d1cmE=?=) Date: Fri, 15 Sep 2017 04:28:48 +0000 Subject: Experimental support for CUDA Message-ID: Hi all, I would like to share an experimental support for CUDA. It?s based on expression api after major lifting (according to feedback plus some other findings) and simple transformation of lambda to CUDA via NVRTC (right now it?s just... "gluing strings?). Wit above I?ve been able to execute following kernel on GPU Runnable fillArrayKernel = () -> { // Trick to cast to int[], as we don't want to opeate via dataRegion int[] data = (int[]) (Object) dataRegion; // The starting index of data chunk int dataChunkBegin = blockIdx.x * elementsPerBlock + threadIdx.x; // Set values in looop for (int i = 0; i < loopsPerThread; i++) { data[dataChunkBegin + threadsCount * i] = valueToSet; } }; (There is one casting, which I allowed for fun) It?s maybe not production grade, but shows one possible approach, and later, I think, NVRTC can be replaced by direct PTX generation. Changes are for OSX, and samples has to be run in NVIDA/lib dir, until someone knows how to configure LD_LIBRARY_PATH on OS X... Sample of kernel can be found here: - https://github.com/rsmogura/cuda-java-samples (CUDA sample) And a changes: - https://bitbucket.org/radoslaw_smogura/panama-jdk/branch/cuda (jdk changes) - https://bitbucket.org/radoslaw_smogura/panama-langtools/branch/javax.expression-v2 (expression api) - https://bitbucket.org/radoslaw_smogura/panama-build/branch/javax.expression-v2 (top-level tree required by expression api) Best regards, Radek From paul.sandoz at oracle.com Fri Sep 15 22:01:00 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 15 Sep 2017 15:01:00 -0700 Subject: webrev Re: Move Vector API from scratch project to an incubator module In-Reply-To: References: Message-ID: <5AF3964B-6C2E-4EFE-A764-A737EBA10AF3@oracle.com> I created the incubating module, modified Hotspot appropriately, added @HotSpotIntrinsicCandidate on supported methods (to the template), and added just one simple test to verify (by eye for now): 2408 319 % AddTest::main @ 2 (54 bytes) @ 8 AddTest::workload (63 bytes) inline (hot) @ 5 jdk.incubator.vector.Vector::speciesInstance (289 bytes) inline (hot) @ 27 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) @ 36 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) @ 42 jdk.incubator.vector.FloatVector::add (11 bytes) (intrinsic) @ 49 jdk.incubator.vector.FloatVector::intoArray (12 bytes) (intrinsic) @ 54 jdk.incubator.vector.Float256Vector$Float256Species::length (4 bytes) inline (hot) http://cr.openjdk.java.net/~psandoz/panama/incubator_vector/webrev/ Paul. > On 14 Sep 2017, at 11:50, Paul Sandoz wrote: > > Hi, > > The vector intrinsics work is making some good progress. > > I propose to move the Vector API from jdk/test/panama/vector-draft-spec to its own module in the JDK named jdk.incubator.vector with classes under a package of the same name. That way an OpenJDK ea distribution of panama will include the Vector API and developers can easily experiment. > > One awkward aspect is @HotSpotIntrinsicCandidate is internal to the JDK and only usable in java.base. We can export it?s package to the jdk.incubator.vector module and IIUC ensure classes in the vector module are loaded by the platform class loader, thus annotated methods that are intrinsic are acknowledged. > > (Ideally HotSpotIntrinsicCandidate should reside in the package jdk.internal.vm.annotation.) > > Paul. From paul.sandoz at oracle.com Wed Sep 20 16:20:01 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 20 Sep 2017 09:20:01 -0700 Subject: webrev Re: Move Vector API from scratch project to an incubator module In-Reply-To: <5AF3964B-6C2E-4EFE-A764-A737EBA10AF3@oracle.com> References: <5AF3964B-6C2E-4EFE-A764-A737EBA10AF3@oracle.com> Message-ID: Unless there are objections i will push by the end of the week, as i want to have this ready and settled by JavaOne so that it is demo ready for our presentation. Paul. > On 15 Sep 2017, at 15:01, Paul Sandoz wrote: > > I created the incubating module, modified Hotspot appropriately, added @HotSpotIntrinsicCandidate on supported methods (to the template), and added just one simple test to verify (by eye for now): > > 2408 319 % AddTest::main @ 2 (54 bytes) > @ 8 AddTest::workload (63 bytes) inline (hot) > @ 5 jdk.incubator.vector.Vector::speciesInstance (289 bytes) inline (hot) > @ 27 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) > @ 36 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) > @ 42 jdk.incubator.vector.FloatVector::add (11 bytes) (intrinsic) > @ 49 jdk.incubator.vector.FloatVector::intoArray (12 bytes) (intrinsic) > @ 54 jdk.incubator.vector.Float256Vector$Float256Species::length (4 bytes) inline (hot) > > http://cr.openjdk.java.net/~psandoz/panama/incubator_vector/webrev/ > > Paul. > >> On 14 Sep 2017, at 11:50, Paul Sandoz wrote: >> >> Hi, >> >> The vector intrinsics work is making some good progress. >> >> I propose to move the Vector API from jdk/test/panama/vector-draft-spec to its own module in the JDK named jdk.incubator.vector with classes under a package of the same name. That way an OpenJDK ea distribution of panama will include the Vector API and developers can easily experiment. >> >> One awkward aspect is @HotSpotIntrinsicCandidate is internal to the JDK and only usable in java.base. We can export it?s package to the jdk.incubator.vector module and IIUC ensure classes in the vector module are loaded by the platform class loader, thus annotated methods that are intrinsic are acknowledged. >> >> (Ideally HotSpotIntrinsicCandidate should reside in the package jdk.internal.vm.annotation.) >> >> Paul. > From sandhya.viswanathan at intel.com Wed Sep 20 19:51:45 2017 From: sandhya.viswanathan at intel.com (Viswanathan, Sandhya) Date: Wed, 20 Sep 2017 19:51:45 +0000 Subject: webrev Re: Move Vector API from scratch project to an incubator module In-Reply-To: References: <5AF3964B-6C2E-4EFE-A764-A737EBA10AF3@oracle.com> Message-ID: <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AED2DE@FMSMSX112.amr.corp.intel.com> Hi Paul, The changes look good to us. Please do push as soon as possible. Thanks, Sandhya -----Original Message----- From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Paul Sandoz Sent: Wednesday, September 20, 2017 9:20 AM To: panama-dev at openjdk.java.net Subject: Re: webrev Re: Move Vector API from scratch project to an incubator module Unless there are objections i will push by the end of the week, as i want to have this ready and settled by JavaOne so that it is demo ready for our presentation. Paul. > On 15 Sep 2017, at 15:01, Paul Sandoz wrote: > > I created the incubating module, modified Hotspot appropriately, added @HotSpotIntrinsicCandidate on supported methods (to the template), and added just one simple test to verify (by eye for now): > > 2408 319 % AddTest::main @ 2 (54 bytes) > @ 8 AddTest::workload (63 bytes) inline (hot) > @ 5 jdk.incubator.vector.Vector::speciesInstance (289 bytes) inline (hot) > @ 27 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) > @ 36 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) > @ 42 jdk.incubator.vector.FloatVector::add (11 bytes) (intrinsic) > @ 49 jdk.incubator.vector.FloatVector::intoArray (12 bytes) (intrinsic) > @ 54 jdk.incubator.vector.Float256Vector$Float256Species::length (4 bytes) inline (hot) > > http://cr.openjdk.java.net/~psandoz/panama/incubator_vector/webrev/ > > Paul. > >> On 14 Sep 2017, at 11:50, Paul Sandoz wrote: >> >> Hi, >> >> The vector intrinsics work is making some good progress. >> >> I propose to move the Vector API from jdk/test/panama/vector-draft-spec to its own module in the JDK named jdk.incubator.vector with classes under a package of the same name. That way an OpenJDK ea distribution of panama will include the Vector API and developers can easily experiment. >> >> One awkward aspect is @HotSpotIntrinsicCandidate is internal to the JDK and only usable in java.base. We can export it?s package to the jdk.incubator.vector module and IIUC ensure classes in the vector module are loaded by the platform class loader, thus annotated methods that are intrinsic are acknowledged. >> >> (Ideally HotSpotIntrinsicCandidate should reside in the package jdk.internal.vm.annotation.) >> >> Paul. > From mandy.chung at oracle.com Wed Sep 20 20:03:21 2017 From: mandy.chung at oracle.com (mandy chung) Date: Wed, 20 Sep 2017 13:03:21 -0700 Subject: webrev Re: Move Vector API from scratch project to an incubator module In-Reply-To: References: <5AF3964B-6C2E-4EFE-A764-A737EBA10AF3@oracle.com> Message-ID: AFAICT, this looks fine.? While there will be more javadoc work to do, you may want to add a package-info.java for jdk.incubator.vector so that the module summary will show the description of the package. Mandy On 9/20/17 9:20 AM, Paul Sandoz wrote: > Unless there are objections i will push by the end of the week, as i want to have this ready and settled by JavaOne so that it is demo ready for our presentation. > > Paul. > >> On 15 Sep 2017, at 15:01, Paul Sandoz wrote: >> >> I created the incubating module, modified Hotspot appropriately, added @HotSpotIntrinsicCandidate on supported methods (to the template), and added just one simple test to verify (by eye for now): >> >> 2408 319 % AddTest::main @ 2 (54 bytes) >> @ 8 AddTest::workload (63 bytes) inline (hot) >> @ 5 jdk.incubator.vector.Vector::speciesInstance (289 bytes) inline (hot) >> @ 27 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) >> @ 36 jdk.incubator.vector.FloatVector$FloatSpecies::fromArray (12 bytes) (intrinsic) >> @ 42 jdk.incubator.vector.FloatVector::add (11 bytes) (intrinsic) >> @ 49 jdk.incubator.vector.FloatVector::intoArray (12 bytes) (intrinsic) >> @ 54 jdk.incubator.vector.Float256Vector$Float256Species::length (4 bytes) inline (hot) >> >> http://cr.openjdk.java.net/~psandoz/panama/incubator_vector/webrev/ >> >> Paul. >> >>> On 14 Sep 2017, at 11:50, Paul Sandoz wrote: >>> >>> Hi, >>> >>> The vector intrinsics work is making some good progress. >>> >>> I propose to move the Vector API from jdk/test/panama/vector-draft-spec to its own module in the JDK named jdk.incubator.vector with classes under a package of the same name. That way an OpenJDK ea distribution of panama will include the Vector API and developers can easily experiment. >>> >>> One awkward aspect is @HotSpotIntrinsicCandidate is internal to the JDK and only usable in java.base. We can export it?s package to the jdk.incubator.vector module and IIUC ensure classes in the vector module are loaded by the platform class loader, thus annotated methods that are intrinsic are acknowledged. >>> >>> (Ideally HotSpotIntrinsicCandidate should reside in the package jdk.internal.vm.annotation.) >>> >>> Paul. From paul.sandoz at oracle.com Wed Sep 20 21:23:00 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 20 Sep 2017 21:23:00 +0000 Subject: hg: panama/panama: Declare jdk.incubating.vector module as a platform module. Message-ID: <201709202123.v8KLN0Yi018024@aojmv0008.oracle.com> Changeset: 86a5c80f467f Author: psandoz Date: 2017-09-20 14:19 -0700 URL: http://hg.openjdk.java.net/panama/panama/rev/86a5c80f467f Declare jdk.incubating.vector module as a platform module. ! make/common/Modules.gmk From paul.sandoz at oracle.com Wed Sep 20 21:23:04 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 20 Sep 2017 21:23:04 +0000 Subject: hg: panama/panama/hotspot: Refer to classes and intrinsic methods in the jdk.incubating.vector module. Message-ID: <201709202123.v8KLN4B5018127@aojmv0008.oracle.com> Changeset: 15bbedf65113 Author: psandoz Date: 2017-09-15 14:39 -0700 URL: http://hg.openjdk.java.net/panama/panama/hotspot/rev/15bbedf65113 Refer to classes and intrinsic methods in the jdk.incubating.vector module. ! src/share/vm/ci/ciType.cpp ! src/share/vm/classfile/vmSymbols.hpp ! src/share/vm/oops/method.cpp From paul.sandoz at oracle.com Wed Sep 20 21:23:12 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 20 Sep 2017 21:23:12 +0000 Subject: hg: panama/panama/jdk: Define Vector API in an incubating module and mark intrinsic Message-ID: <201709202123.v8KLNCiS018284@aojmv0008.oracle.com> Changeset: 7d11046b7ba1 Author: psandoz Date: 2017-09-20 14:18 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/7d11046b7ba1 Define Vector API in an incubating module and mark intrinsic methods with @HotSpotIntrinsicCandidate ! src/java.base/share/classes/module-info.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte128Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte256Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte512Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double128Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double256Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double512Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float128Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float256Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float512Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/FloatVector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/GenericMask.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/GenericShuffle.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int128Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int256Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int512Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long128Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long256Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long512Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Shapes.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short128Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short256Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short512Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-VectorBits.java.template + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/package-info.java + src/jdk.incubator.vector/share/classes/module-info.java From paul.sandoz at oracle.com Wed Sep 20 21:21:27 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Wed, 20 Sep 2017 14:21:27 -0700 Subject: webrev Re: Move Vector API from scratch project to an incubator module In-Reply-To: References: <5AF3964B-6C2E-4EFE-A764-A737EBA10AF3@oracle.com> Message-ID: > On 20 Sep 2017, at 13:03, mandy chung wrote: > > AFAICT, this looks fine. While there will be more javadoc work to do, you may want to add a package-info.java for jdk.incubator.vector so that the module summary will show the description of the package. > I included a token package-info.java and pushed. Thanks. Paul. From razvan.a.lupusoru at intel.com Sun Sep 24 16:43:14 2017 From: razvan.a.lupusoru at intel.com (Lupusoru, Razvan A) Date: Sun, 24 Sep 2017 16:43:14 +0000 Subject: Vector API unboxing and masking support Message-ID: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> Hi everyone, Please review the following patch which adds more enhancements to the Vector API: http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/ Changes in hotspot: * Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue" * Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API * The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation. * Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type. * Added some support around masks and some double methods. * Cleaned up intrinsics code and created common methods for getting vector operands and setting output. * Added some support for Vector unboxing: o In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values o In all the rest of cases, a vector load is generated to get vector value. * Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created. Changes in jdk: * Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks. * Marks more methods as being hotspot intrinsic * Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side. Let me know if you have any comments or questions. Thanks, Razvan From sandhya.viswanathan at intel.com Sun Sep 24 22:14:33 2017 From: sandhya.viswanathan at intel.com (Viswanathan, Sandhya) Date: Sun, 24 Sep 2017 22:14:33 +0000 Subject: Vector API unboxing and masking support In-Reply-To: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> References: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> Message-ID: <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AEE502@FMSMSX112.amr.corp.intel.com> Hi Razvan, The files FloatVector.java and DoubleVector.java are generated from the template X-Vector.java.template. Please change the template instead of changing these files directly. Thanks, Sandhya -----Original Message----- From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A Sent: Sunday, September 24, 2017 9:43 AM To: panama-dev at openjdk.java.net Subject: Vector API unboxing and masking support Hi everyone, Please review the following patch which adds more enhancements to the Vector API: http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/ Changes in hotspot: * Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue" * Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API * The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation. * Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type. * Added some support around masks and some double methods. * Cleaned up intrinsics code and created common methods for getting vector operands and setting output. * Added some support for Vector unboxing: o In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values o In all the rest of cases, a vector load is generated to get vector value. * Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created. Changes in jdk: * Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks. * Marks more methods as being hotspot intrinsic * Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side. Let me know if you have any comments or questions. Thanks, Razvan From paul.sandoz at oracle.com Sun Sep 24 22:42:47 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Sun, 24 Sep 2017 15:42:47 -0700 Subject: Vector API unboxing and masking support In-Reply-To: <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AEE502@FMSMSX112.amr.corp.intel.com> References: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AEE502@FMSMSX112.amr.corp.intel.com> Message-ID: <39B65AAF-DDEA-4789-B649-563CE9395E70@oracle.com> > On 24 Sep 2017, at 15:14, Viswanathan, Sandhya wrote: > > Hi Razvan, > > The files FloatVector.java and DoubleVector.java are generated from the template X-Vector.java.template. Please change the template instead of changing these files directly. > +1 Razvan, i can help if need be. If so we could probably speed this up if we chat directly on Monday if you are free? Some other comments: - for the true/false masks we could add constants to the concrete species, same as we do for zero(), and you only need to do this once in the template X-VectorBits.java.template - I am not entirely confident about the correctness of the core reshape/cast implementations in relation to any AVX counter part. I dunno if you really want to use rebracket instead? then you don?t need the additional cast method. Paul. > Thanks, > Sandhya > > -----Original Message----- > From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A > Sent: Sunday, September 24, 2017 9:43 AM > To: panama-dev at openjdk.java.net > Subject: Vector API unboxing and masking support > > Hi everyone, > > Please review the following patch which adds more enhancements to the Vector API: > http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/ > > Changes in hotspot: > > * Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue" > > * Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API > > * The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation. > > * Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type. > > * Added some support around masks and some double methods. > > * Cleaned up intrinsics code and created common methods for getting vector operands and setting output. > > * Added some support for Vector unboxing: > > o In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values > > o In all the rest of cases, a vector load is generated to get vector value. > > * Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created. > > Changes in jdk: > > * Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks. > > * Marks more methods as being hotspot intrinsic > > * Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side. > > Let me know if you have any comments or questions. > > Thanks, > Razvan From paul.sandoz at oracle.com Tue Sep 26 18:12:50 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Tue, 26 Sep 2017 18:12:50 +0000 Subject: hg: panama/panama/jdk: Some simple tests Message-ID: <201709261812.v8QICpBv011675@aojmv0008.oracle.com> Changeset: dc256dcbfe5c Author: psandoz Date: 2017-09-26 11:10 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/dc256dcbfe5c Some simple tests + test/jdk/incubator/vector/MismatchTest.java + test/jdk/incubator/vector/VectorArrays.java From paul.sandoz at oracle.com Tue Sep 26 18:13:30 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Tue, 26 Sep 2017 18:13:30 +0000 Subject: hg: panama/panama/jdk: add test Message-ID: <201709261813.v8QIDU6W011977@aojmv0008.oracle.com> Changeset: 1e7707244dd9 Author: psandoz Date: 2017-09-26 11:10 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/1e7707244dd9 add test + test/jdk/incubator/vector/AddTest.java From paul.sandoz at oracle.com Wed Sep 27 00:21:08 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Wed, 27 Sep 2017 00:21:08 +0000 Subject: hg: panama/panama/jdk: Add 64 bit implementations. Add hashCode test Message-ID: <201709270021.v8R0L8iH020666@aojmv0008.oracle.com> Changeset: 1aff5d45abaf Author: psandoz Date: 2017-09-26 17:18 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/1aff5d45abaf Add 64 bit implementations. Add hashCode test + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Byte64Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Double64Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Float64Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Int64Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Long64Vector.java + src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Short64Vector.java ! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/Vector.java ! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/gen-src.sh + test/jdk/incubator/vector/VectorHash.java From paul.sandoz at oracle.com Thu Sep 28 00:26:36 2017 From: paul.sandoz at oracle.com (paul.sandoz at oracle.com) Date: Thu, 28 Sep 2017 00:26:36 +0000 Subject: hg: panama/panama/jdk: vector count runs Message-ID: <201709280026.v8S0QboW016739@aojmv0008.oracle.com> Changeset: 2737ffacb7c6 Author: psandoz Date: 2017-09-27 17:23 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/2737ffacb7c6 vector count runs + test/jdk/incubator/vector/VectorRuns.java From razvan.a.lupusoru at intel.com Thu Sep 28 23:04:40 2017 From: razvan.a.lupusoru at intel.com (Lupusoru, Razvan A) Date: Thu, 28 Sep 2017 23:04:40 +0000 Subject: Vector API unboxing and masking support In-Reply-To: <39B65AAF-DDEA-4789-B649-563CE9395E70@oracle.com> References: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AEE502@FMSMSX112.amr.corp.intel.com> <39B65AAF-DDEA-4789-B649-563CE9395E70@oracle.com> Message-ID: <48D92A70936F7946BE99F3FF5ECB6461D8DD65FD@ORSMSX113.amr.corp.intel.com> Hi everyone, Here are the updated hotspot and jdk patches with all of the comments addressed: http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.02/ In addition to addressing the comments, I have also made the following changes from last patch: - Stabilized VectorUnbox expansion - Allowed generation of VectorUnbox not just for phis - but anytime an input has not been converted to vector value - Added support for zero extension so that the GenericMask can also be unboxed into compiler's mask representation - Added disabled implementation for VectorBox generation including allocation and setting of values in fields. Currently disabled because VectorBox can be removed but will leave behind allocations. - Ensured that invariant nodes are hoistable. - Enabled more float, double, and int vector variants. Let me know if you have any comments. If it looks like by tomorrow there is no push back, I will go ahead and push this change so we have it in by Java One. Thanks, Razvan -----Original Message----- From: Paul Sandoz [mailto:paul.sandoz at oracle.com] Sent: Sunday, September 24, 2017 3:43 PM To: Viswanathan, Sandhya Cc: Lupusoru, Razvan A ; panama-dev at openjdk.java.net Subject: Re: Vector API unboxing and masking support > On 24 Sep 2017, at 15:14, Viswanathan, Sandhya wrote: > > Hi Razvan, > > The files FloatVector.java and DoubleVector.java are generated from the template X-Vector.java.template. Please change the template instead of changing these files directly. > +1 Razvan, i can help if need be. If so we could probably speed this up if we chat directly on Monday if you are free? Some other comments: - for the true/false masks we could add constants to the concrete species, same as we do for zero(), and you only need to do this once in the template X-VectorBits.java.template - I am not entirely confident about the correctness of the core reshape/cast implementations in relation to any AVX counter part. I dunno if you really want to use rebracket instead? then you don?t need the additional cast method. Paul. > Thanks, > Sandhya > > -----Original Message----- > From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A > Sent: Sunday, September 24, 2017 9:43 AM > To: panama-dev at openjdk.java.net > Subject: Vector API unboxing and masking support > > Hi everyone, > > Please review the following patch which adds more enhancements to the Vector API: > http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/ > > Changes in hotspot: > > * Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue" > > * Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API > > * The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation. > > * Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type. > > * Added some support around masks and some double methods. > > * Cleaned up intrinsics code and created common methods for getting vector operands and setting output. > > * Added some support for Vector unboxing: > > o In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values > > o In all the rest of cases, a vector load is generated to get vector value. > > * Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created. > > Changes in jdk: > > * Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks. > > * Marks more methods as being hotspot intrinsic > > * Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side. > > Let me know if you have any comments or questions. > > Thanks, > Razvan From shravya.rukmannagari at intel.com Fri Sep 29 00:01:31 2017 From: shravya.rukmannagari at intel.com (shravya.rukmannagari at intel.com) Date: Fri, 29 Sep 2017 00:01:31 +0000 Subject: hg: panama/panama/hotspot: Double256Vector Implementation for VectorAPI Message-ID: <201709290001.v8T01VID025339@aojmv0008.oracle.com> Changeset: 33ca830b84f1 Author: srukmannagar Date: 2017-09-28 16:58 -0700 URL: http://hg.openjdk.java.net/panama/panama/hotspot/rev/33ca830b84f1 Double256Vector Implementation for VectorAPI ! src/share/vm/ci/ciType.cpp ! src/share/vm/ci/ciType.hpp ! src/share/vm/classfile/vmSymbols.hpp ! src/share/vm/opto/c2compiler.cpp ! src/share/vm/opto/library_call.cpp From shravya.rukmannagari at intel.com Fri Sep 29 00:03:22 2017 From: shravya.rukmannagari at intel.com (shravya.rukmannagari at intel.com) Date: Fri, 29 Sep 2017 00:03:22 +0000 Subject: hg: panama/panama/jdk: Double256Vector JDK support for VectorAPI Implementation Message-ID: <201709290003.v8T03M7f026520@aojmv0008.oracle.com> Changeset: d83170db025b Author: srukmannagar Date: 2017-09-28 17:00 -0700 URL: http://hg.openjdk.java.net/panama/panama/jdk/rev/d83170db025b Double256Vector JDK support for VectorAPI Implementation ! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/DoubleVector.java ! src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template From paul.sandoz at oracle.com Fri Sep 29 14:59:06 2017 From: paul.sandoz at oracle.com (Paul Sandoz) Date: Fri, 29 Sep 2017 07:59:06 -0700 Subject: Vector API unboxing and masking support In-Reply-To: <48D92A70936F7946BE99F3FF5ECB6461D8DD65FD@ORSMSX113.amr.corp.intel.com> References: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AEE502@FMSMSX112.amr.corp.intel.com> <39B65AAF-DDEA-4789-B649-563CE9395E70@oracle.com> <48D92A70936F7946BE99F3FF5ECB6461D8DD65FD@ORSMSX113.amr.corp.intel.com> Message-ID: JDK bits look ok, we can tidy up some minor stuff later on. It?s interesting that you changed zero() to be non-abstract: 851 @Override 852 public $abstractvectortype$ zero() { 853 return op(i -> 0); 854 } 855 I eyeballed the HS changes but i can an expert. If you are others are ok push it! Paul. > On 28 Sep 2017, at 16:04, Lupusoru, Razvan A wrote: > > Hi everyone, > > Here are the updated hotspot and jdk patches with all of the comments addressed: > http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.02/ > > In addition to addressing the comments, I have also made the following changes from last patch: > - Stabilized VectorUnbox expansion > - Allowed generation of VectorUnbox not just for phis - but anytime an input has not been converted to vector value > - Added support for zero extension so that the GenericMask can also be unboxed into compiler's mask representation > - Added disabled implementation for VectorBox generation including allocation and setting of values in fields. Currently disabled because VectorBox can be removed but will leave behind allocations. > - Ensured that invariant nodes are hoistable. > - Enabled more float, double, and int vector variants. > > Let me know if you have any comments. If it looks like by tomorrow there is no push back, I will go ahead and push this change so we have it in by Java One. > > Thanks, > Razvan > > -----Original Message----- > From: Paul Sandoz [mailto:paul.sandoz at oracle.com] > Sent: Sunday, September 24, 2017 3:43 PM > To: Viswanathan, Sandhya > Cc: Lupusoru, Razvan A ; panama-dev at openjdk.java.net > Subject: Re: Vector API unboxing and masking support > > >> On 24 Sep 2017, at 15:14, Viswanathan, Sandhya wrote: >> >> Hi Razvan, >> >> The files FloatVector.java and DoubleVector.java are generated from the template X-Vector.java.template. Please change the template instead of changing these files directly. >> > > +1 > > Razvan, i can help if need be. If so we could probably speed this up if we chat directly on Monday if you are free? > > Some other comments: > > - for the true/false masks we could add constants to the concrete species, same as we do for zero(), and you only need to do this once in the template X-VectorBits.java.template > > - I am not entirely confident about the correctness of the core reshape/cast implementations in relation to any AVX counter part. I dunno if you really want to use rebracket instead? then you don?t need the additional cast method. > > Paul. > >> Thanks, >> Sandhya >> >> -----Original Message----- >> From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A >> Sent: Sunday, September 24, 2017 9:43 AM >> To: panama-dev at openjdk.java.net >> Subject: Vector API unboxing and masking support >> >> Hi everyone, >> >> Please review the following patch which adds more enhancements to the Vector API: >> http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/ >> >> Changes in hotspot: >> >> * Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue" >> >> * Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API >> >> * The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation. >> >> * Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type. >> >> * Added some support around masks and some double methods. >> >> * Cleaned up intrinsics code and created common methods for getting vector operands and setting output. >> >> * Added some support for Vector unboxing: >> >> o In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values >> >> o In all the rest of cases, a vector load is generated to get vector value. >> >> * Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created. >> >> Changes in jdk: >> >> * Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks. >> >> * Marks more methods as being hotspot intrinsic >> >> * Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side. >> >> Let me know if you have any comments or questions. >> >> Thanks, >> Razvan > From vladimir.x.ivanov at oracle.com Fri Sep 29 15:11:55 2017 From: vladimir.x.ivanov at oracle.com (Vladimir Ivanov) Date: Fri, 29 Sep 2017 18:11:55 +0300 Subject: Vector API unboxing and masking support In-Reply-To: <48D92A70936F7946BE99F3FF5ECB6461D8DD65FD@ORSMSX113.amr.corp.intel.com> References: <48D92A70936F7946BE99F3FF5ECB6461D8DD5505@ORSMSX113.amr.corp.intel.com> <02FCFB8477C4EF43A2AD8E0C60F3DA2B81AEE502@FMSMSX112.amr.corp.intel.com> <39B65AAF-DDEA-4789-B649-563CE9395E70@oracle.com> <48D92A70936F7946BE99F3FF5ECB6461D8DD65FD@ORSMSX113.amr.corp.intel.com> Message-ID: Looks fine. I skimmed through the hotspot part, but didn't spotted anything alarming. Best regards, Vladimir Ivanov On 9/29/17 2:04 AM, Lupusoru, Razvan A wrote: > Hi everyone, > > Here are the updated hotspot and jdk patches with all of the comments addressed: > http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.02/ > > In addition to addressing the comments, I have also made the following changes from last patch: > - Stabilized VectorUnbox expansion > - Allowed generation of VectorUnbox not just for phis - but anytime an input has not been converted to vector value > - Added support for zero extension so that the GenericMask can also be unboxed into compiler's mask representation > - Added disabled implementation for VectorBox generation including allocation and setting of values in fields. Currently disabled because VectorBox can be removed but will leave behind allocations. > - Ensured that invariant nodes are hoistable. > - Enabled more float, double, and int vector variants. > > Let me know if you have any comments. If it looks like by tomorrow there is no push back, I will go ahead and push this change so we have it in by Java One. > > Thanks, > Razvan > > -----Original Message----- > From: Paul Sandoz [mailto:paul.sandoz at oracle.com] > Sent: Sunday, September 24, 2017 3:43 PM > To: Viswanathan, Sandhya > Cc: Lupusoru, Razvan A ; panama-dev at openjdk.java.net > Subject: Re: Vector API unboxing and masking support > > >> On 24 Sep 2017, at 15:14, Viswanathan, Sandhya wrote: >> >> Hi Razvan, >> >> The files FloatVector.java and DoubleVector.java are generated from the template X-Vector.java.template. Please change the template instead of changing these files directly. >> > > +1 > > Razvan, i can help if need be. If so we could probably speed this up if we chat directly on Monday if you are free? > > Some other comments: > > - for the true/false masks we could add constants to the concrete species, same as we do for zero(), and you only need to do this once in the template X-VectorBits.java.template > > - I am not entirely confident about the correctness of the core reshape/cast implementations in relation to any AVX counter part. I dunno if you really want to use rebracket instead? then you don?t need the additional cast method. > > Paul. > >> Thanks, >> Sandhya >> >> -----Original Message----- >> From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Lupusoru, Razvan A >> Sent: Sunday, September 24, 2017 9:43 AM >> To: panama-dev at openjdk.java.net >> Subject: Vector API unboxing and masking support >> >> Hi everyone, >> >> Please review the following patch which adds more enhancements to the Vector API: >> http://cr.openjdk.java.net/~vdeshpande/VectorAPI/vectorapi.00/ >> >> Changes in hotspot: >> >> * Adds support to generate vptest and a node that represents these semantics. This is used for mask checking methods "anyTrue" and "allTrue" >> >> * Added enum bounds for Vector API methods to improve robustness in checking whether a method is Vector API >> >> * The intrinsics generator can now see which call node it is replacing (if one exists). This was needed to add in future functionality to analyze graph for boxing generation. >> >> * Fixed a bug related to wrong class being set for Vector Box. Namely, the receiver type was always set as the class but in reality, the return type is the correct type. >> >> * Added some support around masks and some double methods. >> >> * Cleaned up intrinsics code and created common methods for getting vector operands and setting output. >> >> * Added some support for Vector unboxing: >> >> o In cases where VectorBox nodes feed into phis used by a vector unbox, a new vector phi is created that merge vector values >> >> o In all the rest of cases, a vector load is generated to get vector value. >> >> * Added a flag to be able to turn off unstable_if speculation named "DisableUnstableIfOpt". This is useful because there is no vector boxing support yet and the speculation makes it so that if there is branching inside vector loop, some values live to runtime which cannot be created. >> >> Changes in jdk: >> >> * Adds capability to generate true and false masks directly without going through constantMask call. This makes it easier to initialize masks. >> >> * Marks more methods as being hotspot intrinsic >> >> * Creates a copy of cast in FloatVector due to some limitations in the intrinsics matching technology being used. In future this can probably be removed but I needed it to show how to support on compiler side. >> >> Let me know if you have any comments or questions. >> >> Thanks, >> Razvan >