From: Fortini Matteo <matteo.fortini@mta.it>
To: linux-ppc list <linuxppc-dev@ozlabs.org>
Subject: e300 (MPC5121) dlmzb
Date: Fri, 25 Sep 2009 13:07:00 +0200 [thread overview]
Message-ID: <4ABCA454.5030807@mta.it> (raw)
I was trying to insert an optimized strlen() function using the
following code taken from the ibm site on an MPC5121, but it crashes the
kernel.
Is it because it's an unsupported op, or because I'm missing some needed
steps?
Thank you,
Matteo
_GLOBAL(strlen)
addi r4,0,8 // Load byte count of 8
mtxer r4 // Set byte count for load string
xor r4,r4,r4 // r4 = 0, r4 == accumulator
1:
lswx r5,r3,r4 // load string into r5 & r6
dlmzb. r12,r5,r6 // find NULL byte and record in r7.
add r4,r4,r12 // Update accumulator.
beq 1b // Loop if NULL not found.
addi r3,r4,-1 // Subtract 1 for NULL byte.
blr // Return length
next reply other threads:[~2009-09-25 11:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 11:07 Fortini Matteo [this message]
2009-09-25 16:34 ` e300 (MPC5121) dlmzb Kumar Gala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ABCA454.5030807@mta.it \
--to=matteo.fortini@mta.it \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).