Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * Copyright 2009 Freescale Semiconductor, Inc.
0004  *
0005  * provides masks and opcode images for use by code generation, emulation
0006  * and for instructions that older assemblers might not know about
0007  */
0008 #ifndef _ASM_POWERPC_PPC_OPCODE_H
0009 #define _ASM_POWERPC_PPC_OPCODE_H
0010 
0011 
0012 #  define stringify_in_c(...)   __VA_ARGS__
0013 #  define ASM_CONST(x)      x
0014 
0015 
0016 #define PPC_INST_VCMPEQUD_RC        0x100000c7
0017 #define PPC_INST_VCMPEQUB_RC        0x10000006
0018 
0019 #define __PPC_RC21     (0x1 << 10)
0020 
0021 /* macros to insert fields into opcodes */
0022 #define ___PPC_RA(a)    (((a) & 0x1f) << 16)
0023 #define ___PPC_RB(b)    (((b) & 0x1f) << 11)
0024 #define ___PPC_RS(s)    (((s) & 0x1f) << 21)
0025 #define ___PPC_RT(t)    ___PPC_RS(t)
0026 
0027 #define VCMPEQUD_RC(vrt, vra, vrb)  stringify_in_c(.long PPC_INST_VCMPEQUD_RC | \
0028                   ___PPC_RT(vrt) | ___PPC_RA(vra) | \
0029                   ___PPC_RB(vrb) | __PPC_RC21)
0030 
0031 #define VCMPEQUB_RC(vrt, vra, vrb)  stringify_in_c(.long PPC_INST_VCMPEQUB_RC | \
0032                   ___PPC_RT(vrt) | ___PPC_RA(vra) | \
0033                   ___PPC_RB(vrb) | __PPC_RC21)
0034 
0035 #endif /* _ASM_POWERPC_PPC_OPCODE_H */