openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

Handle masked operations in VectorAPIExpansion

Open gita-omr opened this issue 3 years ago • 14 comments

  • handle a simple test case where mask is produced by vector compare() and consumed by unary, binary, or ternary vector operation with mask
  • mask has internal, platform specific, representation
  • loading or storing of masks is not allowed since conversion to/from Java representation is needed.
  • WIP since we need to make sure masks cannot be loaded or stored

Depends on https://github.com/eclipse/omr/pull/6636

gita-omr avatar Aug 04 '22 02:08 gita-omr

For this test case:

        for (int i = 0; i < a.length; i += SPECIES.length()) {
             TYPE2Vector va = TYPE2Vector.fromArray(SPECIES, a, i);
             TYPE2Vector vb = TYPE2Vector.fromArray(SPECIES, b, i);
             va.lanewise(VectorOperators.ADD, vb, va.compare(VectorOperators.GT, vb)).intoArray(c, i);
        }

we create these trees:

 n5309n   (  0)  vstorei  <array-shadow>[#265  Shadow] [flags 0x80000615 0x0 ] ()                     [    0x72d5447c6b30] bci=[58,43,3075] rc=0 vc=1941 vn=- li=4 udi=- nc=2 flg=0x20
 n9802n   (  1)    aladd (X>=0 sharedMemory )                                                         [    0x72d40741e790] bci=[-1,0,48] rc=1 vc=1941 vn=- li=4 udi=- nc=2 flg=0x100
 n11466n  (  2)      ==>aRegLoad (in &GPR_0115) (SeenRealReference sharedMemory )
 n9738n   (  3)      lsub (X>=0 cannotOverflow )                                                      [    0x72d40741d390] bci=[-1,0,48] rc=3 vc=1941 vn=- li=4 udi=- nc=2 flg=0x1100
 n9736n   (  1)        lshl (X>=0 cannotOverflow )                                                    [    0x72d40741d2f0] bci=[-1,0,48] rc=1 vc=1941 vn=- li=4 udi=- nc=2 flg=0x1100
 n1536n   (  1)          i2l (highWordZero X>=0 )                                                     [    0x72d54440cfd0] bci=[11,4,3538] rc=1 vc=1941 vn=- li=4 udi=- nc=1 flg=0x4100
 n11463n  (  2)            ==>iRegLoad (in GPR_0112) (X>=0 cannotOverflow SeenRealReference )
 n9737n   (  1)          iconst 2 (Unsigned X!=0 X>=0 )                                               [    0x72d40741d340] bci=[-1,0,48] rc=1 vc=1941 vn=- li=4 udi=- nc=0 flg=0x4104
 n9739n   (  1)        lconst -16 (X!=0 X<=0 )                                                        [    0x72d40741d3e0] bci=[-1,0,48] rc=1 vc=1941 vn=- li=4 udi=- nc=0 flg=0x204
 n3772n   (  1)    vmaddVector128Float ()                                                             [    0x72d544688ac0] bci=[42,93,811] rc=1 vc=1941 vn=- li=4 udi=- nc=3 flg=0x20
 n1362n   (  2)      vloadi  <array-shadow>[#265  Shadow] [flags 0x80000615 0x0 ] ()                  [    0x72d544409970] bci=[6,32,3289] rc=2 vc=1941 vn=- li=4 udi=- nc=1 flg=0x20
 n9740n   (  1)        aladd (X>=0 sharedMemory )                                                     [    0x72d40741d430] bci=[-1,0,48] rc=1 vc=1941 vn=- li=4 udi=- nc=2 flg=0x100
 n11465n  (  2)          ==>aRegLoad (in &GPR_0114) (X!=0 SeenRealReference sharedMemory )
 n9738n   (  3)          ==>lsub (X>=0 cannotOverflow )
 n2248n   (  2)      vloadi  <array-shadow>[#265  Shadow] [flags 0x80000615 0x0 ] ()                  [    0x72d54451ae60] bci=[20,32,3289] rc=2 vc=1941 vn=- li=4 udi=- nc=1 flg=0x20
 n9758n   (  1)        aladd (X>=0 sharedMemory )                                                     [    0x72d40741d9d0] bci=[-1,0,48] rc=1 vc=1941 vn=- li=4 udi=- nc=2 flg=0x100
 n11467n  (  2)          ==>aRegLoad (in &GPR_0116) (SeenRealReference sharedMemory )
 n9738n   (  3)          ==>lsub (X>=0 cannotOverflow )
 n2765n   (  1)      vcmpgtVector128Float ()                                                          [    0x72d5445d5000] bci=[30,42,1905] rc=1 vc=1941 vn=- li=4 udi=- nc=2 flg=0x20
 n1362n   (  2)        ==>vloadi ()
 n2248n   (  2)        ==>vloadi ()

gita-omr avatar Aug 04 '22 02:08 gita-omr

Added more masked opcodes.

gita-omr avatar Aug 05 '22 02:08 gita-omr

Fixed line endings.

gita-omr avatar Aug 05 '22 02:08 gita-omr

Added new, Mask, type.

gita-omr avatar Aug 27 '22 19:08 gita-omr

Jenkins test sanity all jdk8,jdk19 depends eclipse/omr#6636

gita-omr avatar Aug 27 '22 23:08 gita-omr

Jenkins test sanity all jdk8,jdk19 depends eclipse/omr#6636

gita-omr avatar Aug 29 '22 02:08 gita-omr

Jenkins test sanity all jdk8,jdk19

gita-omr avatar Sep 02 '22 00:09 gita-omr

I think the OMR PR this PR depends on got propagated so will start the build again.

gita-omr avatar Sep 02 '22 18:09 gita-omr

Jenkins test sanity all jdk8,jdk19

gita-omr avatar Sep 02 '22 18:09 gita-omr

Ready for review.

gita-omr avatar Sep 06 '22 20:09 gita-omr

Rebased in order to address the comments.

gita-omr avatar Sep 15 '22 16:09 gita-omr

Addressed the comments above.

gita-omr avatar Sep 15 '22 18:09 gita-omr

Fixed line endings.

gita-omr avatar Sep 15 '22 18:09 gita-omr

Addressed latest comments.

gita-omr avatar Sep 19 '22 16:09 gita-omr

jenkins test sanity plinux,win,aix,zlinux jdk8,jdk11

zl-wang avatar Sep 22 '22 12:09 zl-wang

wondering if i need to launch some tests on vector api (which release? how to enable -- with specific options i figured?)

zl-wang avatar Sep 22 '22 12:09 zl-wang

wondering if i need to launch some tests on vector api (which release? how to enable -- with specific options i figured?)

No special options are needed. I believe openjdk tests run as part of acceptance test now (with some enforcing options).

I think I missed some cosmetic comments. I will address them next time I change this file. Thanks so much for the review!

gita-omr avatar Sep 23 '22 22:09 gita-omr