diff mbox

[PR,target/79170] fix memcmp builtin expansion sequence for rs6000 target.

Message ID CAKdteOaTRf9Hm+P0wir0+EN8+GoDc73XS=Dj0LsjX4i7yg4q5g@mail.gmail.com
State New
Headers show

Commit Message

Christophe Lyon Jan. 31, 2017, 12:42 p.m. UTC
Hi,

On 30 January 2017 at 17:00, Peter Bergner <bergner@vnet.ibm.com> wrote:
> On 1/27/17 5:43 PM, Segher Boessenkool wrote:
>>
>> On Fri, Jan 27, 2017 at 12:11:05PM -0600, Aaron Sawdey wrote:
>>>
>>> +            addi 9,4,7
>>> +            lwbrx 10,0,9
>>> +            addi 9,5,7
>>> +            lwbrx 9,0,9
>>
>>
>> It would be nice if this was
>>
>>         li 9,7
>>         lwbrx 10,9,4
>>         lwbrx 9,9,5
>
>
> Nicer still, we want the base address as the RA operand
> and the offset as the RB operand, so like so:
>
>         li 9,7
>         lwbrx 10,4,9
>         lwbrx 9,5,9
>
> On some processors, it matters performance wise.
>
> Peter
>

The updated test does not link when using newlib, missing random().

The small attached patch fixes this by calling rand() instead.
Tested on arm-none-eabi, aarch64-elf.

OK?

Christophe
gcc/testsuite/ChangeLog:

2017-01-31  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.dg/memcmp-1.c (static void test_driver_memcmp): Call
          rand() instead of random().

Comments

Segher Boessenkool Jan. 31, 2017, 1:25 p.m. UTC | #1
On Tue, Jan 31, 2017 at 01:42:31PM +0100, Christophe Lyon wrote:
> The updated test does not link when using newlib, missing random().
> 
> The small attached patch fixes this by calling rand() instead.
> Tested on arm-none-eabi, aarch64-elf.
> 
> OK?
> 
> Christophe

Okay, thanks!


Segher


> 2017-01-31  Christophe Lyon  <christophe.lyon@linaro.org>
> 
> 	* gcc.dg/memcmp-1.c (static void test_driver_memcmp): Call
>           rand() instead of random().
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/memcmp-1.c b/gcc/testsuite/gcc.dg/memcmp-1.c
index b4fd780..828a0ca 100644
--- a/gcc/testsuite/gcc.dg/memcmp-1.c
+++ b/gcc/testsuite/gcc.dg/memcmp-1.c
@@ -28,12 +28,12 @@  static void test_driver_memcmp (void (test_memcmp)(const char *, const char *, i
   for(l=0;l<sz;l++) {
     for(i=0;i<NRAND/sz;i++) {
       for(j=0;j<l;j++) {
-	buf1[j] = random() & 0xff;
+	buf1[j] = rand() & 0xff;
 	buf2[j] = buf1[j];
       }
       for(j=l;j<sz;j++) {
-	buf1[j] = random() & 0xff;
-	buf2[j] = random() & 0xff;
+	buf1[j] = rand() & 0xff;
+	buf2[j] = rand() & 0xff;
       }
     }
     e = lib_memcmp(buf1,buf2,sz);