Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accelerate StringCoding.countPositives on Z #20736

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dchopra001
Copy link
Contributor

This PR accelerates the StringCoding.countPositives API on z/codegen for JDK21+. This API is similar in implementation to the recently accelerated StringCoding.hasNegatives API so we leverage the existing implementation to add acceleration for StringCoding.countPositives as well.

Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks ok to me (Structure wise). Please add short description to commit.

I will give detail review once you confirm passing of functional tests. Also Can I request you to share the instruction selection snippet ?

@dchopra001
Copy link
Contributor Author

Instruction Log:

============================================================
; Live regs: GPR=3 FPR=0 VRF=0 {&GPR_0034, GPR_0033, GPR_0032}
------------------------------
 n7n      (  0)  treetop                                                                              [     0x3ff56c82880] bci=[-1,3,79] rc=0 vc=207 vn=- li=2 udi=- nc=1
 n6n      (  2)    icall  java/lang/StringCoding.countPositives([BII)I[#405  static Method] [flags 0x500 0x0 ] ()  [     0x3ff56c82830] bci=[-1,3,79] rc=2 vc=207 vn=- li=2 udi=- nc=3 flg=0x20
 n44n     (  1)      ==>aRegLoad (in &GPR_0034) (SeenRealReference )
 n43n     (  1)      ==>iRegLoad (in GPR_0033) (cannotOverflow SeenRealReference )
 n42n     (  1)      ==>iRegLoad (in GPR_0032) (cannotOverflow SeenRealReference )
------------------------------
------------------------------
 n7n      (  0)  treetop                                                                              [     0x3ff56c82880] bci=[-1,3,79] rc=0 vc=207 vn=- li=2 udi=- nc=1
 n6n      (  1)    icall  java/lang/StringCoding.countPositives([BII)I[#405  static Method] [flags 0x500 0x0 ] (in GPR_0041) ()  [     0x3ff56c82830] bci=[-1,3,79] rc=1 vc=207 vn=- li=2 udi=- nc=3 flg=0x20
 n44n     (  0)      ==>aRegLoad (in &GPR_0034) (SeenRealReference )
 n43n     (  0)      ==>iRegLoad (in GPR_0033) (cannotOverflow SeenRealReference )
 n42n     (  0)      ==>iRegLoad (in GPR_0032) (cannotOverflow SeenRealReference )
------------------------------

 [     0x3ff56d60e80]                          LR      GPR_0041,GPR_0032
 [     0x3ff56e1e000]                          Label L0035:     # (Start of internal control flow)
 [     0x3ff56e1e0e0]                          CIJ     GPR_0032,Label L0034,0,BH(mask=0x8),
 [     0x3ff56e1e1d0]                          AGFR    &GPR_0034,GPR_0033
 [     0x3ff56e1e2b0]                          LR      GPR_0038,GPR_0032
 [     0x3ff56e1e390]                          VREPIB  VRF_0036,0x7f
 [     0x3ff56e1e480]                          VREPIB  VRF_0037,0x20
 [     0x3ff56e1e570]                          CIJ     GPR_0038,Label L0033,16,BNL(mask=0xc),
 [     0x3ff56e1e660]                          Label L0032:
 [     0x3ff56e1e800]                          VL      VRF_0035,#407 8(&GPR_0034),0
 [     0x3ff56e1e8e0]                          VSTRCBS VRF_0039,VRF_0035,VRF_0036,VRF_0037,1
 [     0x3ff56e1e9c0]                          BRC     MASK5(0x4), Label L0036
 [     0x3ff56e1eb60]                          LA      &GPR_0034,#408 16(&GPR_0034)
 [     0x3ff56e1ec30]                          AHI     GPR_0038,0xfff0
 [     0x3ff56e1ed10]                          CIJ     GPR_0038,Label L0032,16,BL(mask=0x2),
 [     0x3ff56e1ee00]                          Label L0033:
 [     0x3ff56e1eee0]                          VGBM    VRF_0035,0x0
 [     0x3ff56e1efd0]                          AHI     GPR_0038,0xffff
 [     0x3ff56e1f170]                          VLL     VRF_0035,GPR_0038,#409 8(&GPR_0034)
 [     0x3ff56e1f250]                          VSTRCBS VRF_0039,VRF_0035,VRF_0036,VRF_0037,1
 [     0x3ff56e1f330]                          BRC     MASK5(0x4), Label L0037
 [     0x3ff56e1f410]                          BRC     NOP(0xf), Label L0034
 [     0x3ff56e1f4f0]                          Label L0037:
 [     0x3ff56e1f5d0]                          AHI     GPR_0038,0x1
 [     0x3ff56e1f6b0]                          Label L0036:
 [     0x3ff56e1f790]                          SRK     GPR_0041,GPR_0032,GPR_0038
 [     0x3ff56e1f930]                          VLGVB   GPR_0040,VRF_0039,#410 7
 [     0x3ff56e1fa10]                          AR      GPR_0041,GPR_0040
 [     0x3ff56e20200]                          assocreg
 [     0x3ff56e1fc40]                          Label L0034:     # (End of internal control flow)
 POST:
 {AssignAny:GPR_0040:R} {AssignAny:GPR_0032:R} {AssignAny:VRF_0035:R} {AssignAny:VRF_0039:R} {AssignAny:VRF_0036:R} {AssignAny:VRF_0037:R} {AssignAny:&GPR_0034:R} {AssignAny:GPR_0038:R}
 {AssignAny:GPR_0041:R} {AssignAny:GPR_0033:R}

@dchopra001
Copy link
Contributor Author

@r30shah Sanity build is clean now so this is ready for detailed review. The instruction log I posted earlier is consistent with the latest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants