1 /*
2  * Copyright 2009 Freescale Semiconductor, Inc.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version
7  * 2 of the License, or (at your option) any later version.
8  *
9  * provides masks and opcode images for use by code generation, emulation
10  * and for instructions that older assemblers might not know about
11  */
12 #ifndef _ASM_POWERPC_PPC_OPCODE_H
13 #define _ASM_POWERPC_PPC_OPCODE_H
14 
15 
16 #  define stringify_in_c(...)	__VA_ARGS__
17 #  define ASM_CONST(x)		x
18 
19 
20 #define PPC_INST_VCMPEQUD_RC		0x100000c7
21 #define PPC_INST_VCMPEQUB_RC		0x10000006
22 
23 #define __PPC_RC21     (0x1 << 10)
24 
25 /* macros to insert fields into opcodes */
26 #define ___PPC_RA(a)	(((a) & 0x1f) << 16)
27 #define ___PPC_RB(b)	(((b) & 0x1f) << 11)
28 #define ___PPC_RS(s)	(((s) & 0x1f) << 21)
29 #define ___PPC_RT(t)	___PPC_RS(t)
30 
31 #define VCMPEQUD_RC(vrt, vra, vrb)	stringify_in_c(.long PPC_INST_VCMPEQUD_RC | \
32 			      ___PPC_RT(vrt) | ___PPC_RA(vra) | \
33 			      ___PPC_RB(vrb) | __PPC_RC21)
34 
35 #define VCMPEQUB_RC(vrt, vra, vrb)	stringify_in_c(.long PPC_INST_VCMPEQUB_RC | \
36 			      ___PPC_RT(vrt) | ___PPC_RA(vra) | \
37 			      ___PPC_RB(vrb) | __PPC_RC21)
38 
39 #endif /* _ASM_POWERPC_PPC_OPCODE_H */
40