[PATCH] powerpc: Add POWER9 copy_page() loop

Michael Ellerman mpe at ellerman.id.au
Sat Jan 27 21:06:32 AEDT 2018


Anton Blanchard <anton at ozlabs.org> writes:

> From: Anton Blanchard <anton at samba.org>
>
> Add a POWER9 optimised copy_page() loop. This loop uses the new D form
> vector loads and stores, and uses dcbz to pre zero the destination.
>
...
> +
> +#ifdef CONFIG_ALTIVEC
> +	mflr	r0
> +	std	r3,-STACKFRAMESIZE+STK_REG(R31)(r1)
> +	std	r4,-STACKFRAMESIZE+STK_REG(R30)(r1)
> +	std	r0,16(r1)
> +	stdu	r1,-STACKFRAMESIZE(r1)
> +	bl	enter_vmx_copy
> +	cmpwi	r3,0
> +	ld	r0,STACKFRAMESIZE+16(r1)
> +	ld	r3,STK_REG(R31)(r1)
> +	ld	r4,STK_REG(R30)(r1)
> +	addi	r1,r1,STACKFRAMESIZE
> +	mtlr	r0
> +
> +	li	r0,((PAGE_SIZE/128)-2)
> +	mtctr	r0
> +
> +	li	r8,256
> +
> +	beq	.Lnonvmx_copy
> +
> +	.balign 16
> +1:	dcbz	r8,r3
> +	lxv	vs32,0(r4)
> +	lxv	vs33,16(r4)

Unfortunately this doesn't build:

  arch/powerpc/lib/copypage_power9.S: Assembler messages:
  arch/powerpc/lib/copypage_power9.S:66: Error: unrecognized opcode: `lxv'
  arch/powerpc/lib/copypage_power9.S:67: Error: unrecognized opcode: `lxv'
  arch/powerpc/lib/copypage_power9.S:68: Error: unrecognized opcode: `stxv'
  arch/powerpc/lib/copypage_power9.S:69: Error: unrecognized opcode: `stxv'


Presumably we need to a .long macro version for older toolchains?

cheers


More information about the Linuxppc-dev mailing list