This is the mail archive of the
mailing list for the glibc project.
[PATCH v2 2/2] powerpc: Fix operand prefixes
- From: "Gabriel F. T. Gomes" <gftg at linux dot vnet dot ibm dot com>
- To: munroesj at linux dot vnet dot ibm dot com
- Cc: libc-alpha at sourceware dot org, tuliom at linux dot vnet dot ibm dot com
- Date: Tue, 26 Apr 2016 11:51:46 -0300
- Subject: [PATCH v2 2/2] powerpc: Fix operand prefixes
- Authentication-results: sourceware.org; auth=none
- References: <1461190256 dot 10094 dot 3 dot camel at oc7878010663>
On Wed, 20 Apr 2016 17:10:56 -0500
Steven Munroe <firstname.lastname@example.org> wrote:
> On Wed, 2016-04-20 at 17:55 -0300, Gabriel F. T. Gomes wrote:
> > The file sysdeps/powerpc/sysdeps.h defines aliases for control register
> > operands. E.g.: 'cr7' means control register 7. On the one hand, this
> > increases readability, as it makes it easier for readers to know whether the
> > operand is a control register, a general purpose register or an immediate. On
> > the other hand, this permits that control register be written as if they were
> > general purpose, and vice-versa, thus reducing the readability of the code.
> I think you mean condition registers, and there are instructions that
> will correctly update a specific cr# (cmpdi for example).
> But li and ld are not examples of instructions that do that.
Indeed, I meant condition register.
This new version should fix it. Thank you!
The file sysdeps/powerpc/sysdeps.h defines aliases for condition register
operands. E.g.: 'cr7' means condition register 7. On the one hand, this
increases readability, as it makes it easier for readers to know whether the
operand is a condition register, a general purpose register or an immediate.
On the other hand, this permits that condition registers be written as if they
were general purpose, and vice-versa, thus reducing the readability of the
This commit removes some of these unintentional misuses.
The changes have no effect on the final code. Checked with objdump.
2016-04-18 Gabriel F. T. Gomes <email@example.com>
* sysdeps/powerpc/powerpc64/power8/strncpy.S: Fix use of condition
registers specifiers where general purpose registers specifiers should
have been used.
sysdeps/powerpc/powerpc64/power8/strncpy.S | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sysdeps/powerpc/powerpc64/power8/strncpy.S b/sysdeps/powerpc/powerpc64/power8/strncpy.S
index 0bb3bd4..437edeb 100644
@@ -294,7 +294,7 @@ L(pagecross):
orc r9,r7,r9 /* Mask bits that are not part of the
- li cr7,0
+ li r7,0
cmpb r9,r9,r7 /* Check for null bytes in DWORD1. */
@@ -305,14 +305,14 @@ L(pagecross):
/* For next checks we have aligned address, so we check for more
three doublewords to make sure we can read 16 unaligned bytes
to start the bulk copy with 16 aligned addresses. */
- ld cr7,8(r11)
+ ld r7,8(r11)
- addi cr7,r8,-8
+ addi r7,r8,-8
- ld cr7,16(r11)
+ ld r7,16(r11)