* Fix cmpli usage in power6 memset
@ 2016-10-24 22:04 Joseph Myers
2016-10-25 15:44 ` Tulio Magno Quites Machado Filho
0 siblings, 1 reply; 3+ messages in thread
From: Joseph Myers @ 2016-10-24 22:04 UTC (permalink / raw)
To: libc-alpha; +Cc: munroesj
Building glibc for powerpc64 with recent (2.27.51.20161012) binutils,
with multi-arch enabled, I get the error:
../sysdeps/powerpc/powerpc64/power6/memset.S: Assembler messages:
../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (5 is not between 0 and 1)
../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (128 is not between 0 and 31)
../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: missing operand
Indeed, cmpli is documented as a four-operand instruction, and looking
at nearby code it seems likely cmpldi was intended. This patch fixes
this powerpc64 code accordingly, and makes a corresponding change to
the powerpc32 code.
Note: this patch is not tested beyond verifying that the powerpc64
code builds where it failed to build before the patch. In particular,
I have not done execution testing (the systems I usually use for
testing powerpc are pre-power6 so wouldn't use this code) or tested
the powerpc32 change.
2016-10-24 Joseph Myers <joseph@codesourcery.com>
* sysdeps/powerpc/powerpc32/power6/memset.S (memset): Use cmplwi
instead of cmpli.
* sysdeps/powerpc/powerpc64/power6/memset.S (memset): Use cmpldi
instead of cmpli.
diff --git a/sysdeps/powerpc/powerpc32/power6/memset.S b/sysdeps/powerpc/powerpc32/power6/memset.S
index b2a222e..d5dbe83 100644
--- a/sysdeps/powerpc/powerpc32/power6/memset.S
+++ b/sysdeps/powerpc/powerpc32/power6/memset.S
@@ -394,7 +394,7 @@ L(cacheAlignedx):
/* A simple loop for the longer (>640 bytes) lengths. This form limits
the branch miss-predicted to exactly 1 at loop exit.*/
L(cacheAligned512):
- cmpli cr1,rLEN,128
+ cmplwi cr1,rLEN,128
blt cr1,L(cacheAligned1)
dcbz 0,rMEMP
addi rLEN,rLEN,-128
diff --git a/sysdeps/powerpc/powerpc64/power6/memset.S b/sysdeps/powerpc/powerpc64/power6/memset.S
index c2d1c4e..d445b1e 100644
--- a/sysdeps/powerpc/powerpc64/power6/memset.S
+++ b/sysdeps/powerpc/powerpc64/power6/memset.S
@@ -251,7 +251,7 @@ L(cacheAlignedx):
/* A simple loop for the longer (>640 bytes) lengths. This form limits
the branch miss-predicted to exactly 1 at loop exit.*/
L(cacheAligned512):
- cmpli cr1,rLEN,128
+ cmpldi cr1,rLEN,128
blt cr1,L(cacheAligned1)
dcbz 0,rMEMP
addi rLEN,rLEN,-128
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fix cmpli usage in power6 memset
2016-10-24 22:04 Fix cmpli usage in power6 memset Joseph Myers
@ 2016-10-25 15:44 ` Tulio Magno Quites Machado Filho
2016-10-25 16:12 ` Peter Bergner
0 siblings, 1 reply; 3+ messages in thread
From: Tulio Magno Quites Machado Filho @ 2016-10-25 15:44 UTC (permalink / raw)
To: Joseph Myers, libc-alpha; +Cc: munroesj
Joseph Myers <joseph@codesourcery.com> writes:
> Building glibc for powerpc64 with recent (2.27.51.20161012) binutils,
> with multi-arch enabled, I get the error:
>
> ../sysdeps/powerpc/powerpc64/power6/memset.S: Assembler messages:
> ../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (5 is not between 0 and 1)
> ../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: operand out of range (128 is not between 0 and 31)
> ../sysdeps/powerpc/powerpc64/power6/memset.S:254: Error: missing operand
>
> Indeed, cmpli is documented as a four-operand instruction, and looking
> at nearby code it seems likely cmpldi was intended. This patch fixes
> this powerpc64 code accordingly, and makes a corresponding change to
> the powerpc32 code.
>
> Note: this patch is not tested beyond verifying that the powerpc64
> code builds where it failed to build before the patch. In particular,
> I have not done execution testing
Tested on powerpc, powerpc64 and powerpc64le.
LGTM.
> (the systems I usually use for
> testing powerpc are pre-power6 so wouldn't use this code) or tested
> the powerpc32 change.
In case you want to have access to POWER8 servers, some universities provide
free access to virtual machines for the open source community:
- MiniCloud - State University of Campinas (Unicamp), Brazil
http://openpower.ic.unicamp.br/minicloud/
- Open Power Hub - Brno University of Technology, Czech Republic
http://fit-rhlab.rhcloud.com/powerlinux-openpower-development-hosting/
- OSU Open Source Lab - Oregon State University, US
http://osuosl.org/services/powerdev/
- SuperVessel - IBM China
https://ptopenlab.com/cloudlabconsole
--
Tulio Magno
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fix cmpli usage in power6 memset
2016-10-25 15:44 ` Tulio Magno Quites Machado Filho
@ 2016-10-25 16:12 ` Peter Bergner
0 siblings, 0 replies; 3+ messages in thread
From: Peter Bergner @ 2016-10-25 16:12 UTC (permalink / raw)
To: Tulio Magno Quites Machado Filho, Joseph Myers; +Cc: libc-alpha, munroesj
On 10/25/16 10:43 AM, Tulio Magno Quites Machado Filho wrote:
> In case you want to have access to POWER8 servers, some universities provide
> free access to virtual machines for the open source community:
There are also the GCC Farm systems:
gcc110: POWER7, Linux, Big Endian
gcc111: POWER7, AIX
gcc112: POWER8, Linux, Little Endian
These are all large/fast systems, with lots of cpus, memory and disk.
Info at https://gcc.gnu.org/wiki/CompileFarm
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-25 16:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24 22:04 Fix cmpli usage in power6 memset Joseph Myers
2016-10-25 15:44 ` Tulio Magno Quites Machado Filho
2016-10-25 16:12 ` Peter Bergner
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 read-only IMAP folder(s) and NNTP newsgroup(s).