- mr r9,r3 // use r9 for dest ptr (must return r3 intact)
- beq Lword0loop // dest is aligned
- subfic r0,r0,4 // r0 <- #bytes to word align dest
- mtctr r0 // set up byte loop
-
-// Loop over bytes looking for 0-byte marking end of dest, until dest is
-// word aligned.
-// r4 = source ptr (unaligned)
-// r5 = count (unchanged so far)
-// r6 = 0xFEFEFEFF
-// r7 = 0x80808080
-// r9 = dest ptr (unaligned)
-// ctr = byte count
-
-Lbyte0loop:
- lbz r8,0(r9) // r8 <- next dest byte
- addi r9,r9,1
- cmpwi r8,0 // test for 0
- bdnzf eq,Lbyte0loop // loop until (ctr==0) | (r8==0)
-
- bne Lword0loop // haven't found 0, so enter word-aligned loop
- andi. r0,r4,3 // is source aligned?
- subi r9,r9,1 // point to the 0-byte we just stored
- beq Laligned // source is already aligned
- subfic r0,r0,4 // r0 <- #bytes to word align source
- b Lbyteloop // must align source
+#else
+ ld r6,_COMM_PAGE_MAGIC_FE(0) // get 0xFEFEFEFE FEFEFEFF from commpage
+ ld r7,_COMM_PAGE_MAGIC_80(0) // get 0x80808080 80808080 from commpage
+ srd r10,r10,r11 // create a mask of 0xFF bytes for operand in r8
+#endif
+ orc r8,r8,r10 // make sure bytes preceeding operand are nonzero
+ b Lword0loopEnter