Re: [PATCH 3/8] MIPS: R6: Fix PREF instruction usage by memcpy for MIPS R6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 28 Jun 2017, Ralf Baechle wrote:

> > Wouldn't the more correct thing be to modify the memcpy loop such that
> > prefetches do not fetch the larger offset? Just turning off prefetch
> > altogether in memcpy for r6 seems like a heavy hammer to me...
> 
> It's the same heavy hammer we've been using for ages to deal with this
> problem for other configurations as well.  So while you're right I don't
> want to force Aleksandar to come up with The One Perfect Fix.  Though
> that would be lovely :)

 The The One Perfect Fix is to switch to the `at' assembly mode as with 
PREFE (which suffers from the same limitation and uses the same internal 
operand code even), as GAS does the right thing automagically if allowed, 
even for R6:

$ cat pref.s
	.text
foo:
	pref	0, 32767($2)
$ as -32 -mips32 -o pref.o pref.s
$ as -32 -mips32r6 -o pref6.o pref.s
$ objdump -d pref*.o

pref.o:     file format elf32-tradbigmips


Disassembly of section .text:

00000000 <foo>:
   0:	cc407fff 	pref	0x0,32767(v0)
	...

pref6.o:     file format elf32-tradbigmips


Disassembly of section .text:

00000000 <foo>:
   0:	24417fff 	addiu	at,v0,32767
   4:	7c200035 	pref	0x0,0(at)
	...

Implementing it should be a trivial exercise given the existing example.

  Maciej




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux