Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: add vcmpequd/vcmpequb ppc instruction macro

Some old tool chains don't know about instructions like vcmpequd.

This patch adds .long macro for vcmpequd and vcmpequb, which is
a preparation to optimize ppc64 memcmp with VMX instructions.

Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Simon Guo and committed by
Michael Ellerman
f1ecbaf4 2d9ee327

+11
+11
arch/powerpc/include/asm/ppc-opcode.h
··· 367 367 #define PPC_INST_STFDX 0x7c0005ae 368 368 #define PPC_INST_LVX 0x7c0000ce 369 369 #define PPC_INST_STVX 0x7c0001ce 370 + #define PPC_INST_VCMPEQUD 0x100000c7 371 + #define PPC_INST_VCMPEQUB 0x10000006 370 372 371 373 /* macros to insert fields into opcodes */ 372 374 #define ___PPC_RA(a) (((a) & 0x1f) << 16) ··· 399 397 #define __PPC_BI(s) (((s) & 0x1f) << 16) 400 398 #define __PPC_CT(t) (((t) & 0x0f) << 21) 401 399 #define __PPC_SPR(r) ((((r) & 0x1f) << 16) | ((((r) >> 5) & 0x1f) << 11)) 400 + #define __PPC_RC21 (0x1 << 10) 402 401 403 402 /* 404 403 * Only use the larx hint bit on 64bit CPUs. e500v1/v2 based CPUs will treat a ··· 570 567 #define PPC_SLBIA(IH) stringify_in_c(.long PPC_INST_SLBIA | \ 571 568 ((IH & 0x7) << 21)) 572 569 #define PPC_INVALIDATE_ERAT PPC_SLBIA(7) 570 + 571 + #define VCMPEQUD_RC(vrt, vra, vrb) stringify_in_c(.long PPC_INST_VCMPEQUD | \ 572 + ___PPC_RT(vrt) | ___PPC_RA(vra) | \ 573 + ___PPC_RB(vrb) | __PPC_RC21) 574 + 575 + #define VCMPEQUB_RC(vrt, vra, vrb) stringify_in_c(.long PPC_INST_VCMPEQUB | \ 576 + ___PPC_RT(vrt) | ___PPC_RA(vra) | \ 577 + ___PPC_RB(vrb) | __PPC_RC21) 573 578 574 579 #endif /* _ASM_POWERPC_PPC_OPCODE_H */