Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / common / ppc-opcode.h
1 /* Copyright (C) 2017 International Business Machines Corp.
2  * All rights reserved.
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 #ifndef __OPCODES_H
10 #define __OPCODES_H
11
12 #define __PPC_RA(a)             (((a) & 0x1f) << 16)
13 #define __PPC_RB(b)             (((b) & 0x1f) << 11)
14 #define __PPC_XA(a)             ((((a) & 0x1f) << 16) | (((a) & 0x20) >> 3))
15 #define __PPC_XB(b)             ((((b) & 0x1f) << 11) | (((b) & 0x20) >> 4))
16 #define __PPC_XS(s)             ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
17 #define __PPC_XT(s)             __PPC_XS(s)
18 #define VSX_XX3(t, a, b)        (__PPC_XT(t) | __PPC_XA(a) | __PPC_XB(b))
19 #define VSX_XX1(s, a, b)        (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
20
21 #define PPC_INST_VPMSUMW        0x10000488
22 #define PPC_INST_VPMSUMD        0x100004c8
23 #define PPC_INST_MFVSRD         0x7c000066
24 #define PPC_INST_MTVSRD         0x7c000166
25
26 #define VPMSUMW(t, a, b)        .long PPC_INST_VPMSUMW | VSX_XX3((t), a, b)
27 #define VPMSUMD(t, a, b)        .long PPC_INST_VPMSUMD | VSX_XX3((t), a, b)
28 #define MFVRD(a, t)             .long PPC_INST_MFVSRD | VSX_XX1((t)+32, a, 0)
29 #define MTVRD(t, a)             .long PPC_INST_MTVSRD | VSX_XX1((t)+32, a, 0)
30
31 #endif