Skip to content

Commit

Permalink
Allow length 0 in arrayTranslateTRTO for Power
Browse files Browse the repository at this point in the history
This commit changes arrayTranslateTRTO helper function for Power to
handle the case of length zero.
  • Loading branch information
knn-k committed Feb 7, 2025
1 parent 2852782 commit b82c2b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/compiler/p/runtime/J9PPCArrayTranslate.spp
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,15 @@ __arrayTranslateTRTO:
! Residue loop, single element per iter
.L.__vectorResidue_TRTO:
mfctr r6
rlwimi. r5, r6, 4, 0, 27 ! add remaining elements from vector loop to residue loop
beq cr0, .L.__done_TRTO ! if 0 elements left, we are done
rlwimi r5, r6, 4, 0, 27 ! add remaining elements from vector loop to residue loop
.L.__alignResidue_TRTO:
cmpi cr0, 0, r5, 0
beq cr0, .L.__done_TRTO ! if 0 elements left, we are done
mtctr r5
addi r3, r3, -2 ! adjust so we can use lhzu
.L.__residueLoop_TRTO:
lhzu r5, 2(r3)
and. r6, r5, r8
and. r6, r5, r8
bne- .L.__done_TRTO
stb r5, 0(r4)
addi r4, r4, 1
Expand Down

0 comments on commit b82c2b7

Please sign in to comment.