All

Based on Don Greiner's SHARE presentation here:

http://share.confex.com/share/115/webprogram/Session7034.html

I've published test version of z390 v1.5.01fx1 here:

http://www.z390.org/test/z390_popcnt_test.zip

This test version zip includes the z390.jar and the following 3 test
programs:

1.  TESTINS1.MLC - test assembly of all opcodes including POPCNT.

2.  TESTINS4.MLC - test execution of first z196 instruction POPCNT.  Note
this test program caught undetected error in P22DSH1.MLC for translate
table for hex 5X values (EBCDIC text did not use that line in table).

3.  P22DSH2.MLC - solution to mainframe assembler coding contest problem
22 using loop with LG, POPCNT, MSGR, SRLG, AR, and BXLE execution total of
282 instructions including code to handle odd bytes at start and end of
string.

The pz390.java code for the POPCNT instruction is as follows:

             case 0xE1:  // 5115 "B9E1" "POPCNT" "RRE" 14 RPI 1125
                     psw_check = false;
                         ins_setup_rre();
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         reg.put(rf1++,bit_cnt[reg.get(rf2++) & 0xff]);
                         break;
                }

Any suggestions for faster versions running J2SE Java are welcome.

We can't benchmark this program on a z10, but it sure will be interesting
to see how all 4 solutions run on a z196.  Now I'll wait for POP to
implement the rest of the new problem state instructions.

Don Higgins
[email protected]

Reply via email to