]> git.proxmox.com Git - ceph.git/blame - ceph/src/common/ppc-opcode.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / ppc-opcode.h
CommitLineData
20effc67
TL
1/*
2 * Copyright (C) 2015 Anton Blanchard <anton@au.ibm.com>, IBM
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of either:
6 *
7 * a) the GNU General Public License as published by the Free Software
8 * Foundation; either version 2 of the License, or (at your option)
9 * any later version, or
10 * b) the Apache License, Version 2.0
11 */
12#ifndef __OPCODES_H
13#define __OPCODES_H
14
15#define __PPC_RA(a) (((a) & 0x1f) << 16)
16#define __PPC_RB(b) (((b) & 0x1f) << 11)
17#define __PPC_XA(a) ((((a) & 0x1f) << 16) | (((a) & 0x20) >> 3))
18#define __PPC_XB(b) ((((b) & 0x1f) << 11) | (((b) & 0x20) >> 4))
19#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
20#define __PPC_XT(s) __PPC_XS(s)
21#define VSX_XX3(t, a, b) (__PPC_XT(t) | __PPC_XA(a) | __PPC_XB(b))
22#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
23
24#define PPC_INST_VPMSUMW 0x10000488
25#define PPC_INST_VPMSUMD 0x100004c8
26#define PPC_INST_MFVSRD 0x7c000066
27#define PPC_INST_MTVSRD 0x7c000166
28
29#define VPMSUMW(t, a, b) .long PPC_INST_VPMSUMW | VSX_XX3((t), a, b)
30#define VPMSUMD(t, a, b) .long PPC_INST_VPMSUMD | VSX_XX3((t), a, b)
31#define MFVRD(a, t) .long PPC_INST_MFVSRD | VSX_XX1((t)+32, a, 0)
32#define MTVRD(t, a) .long PPC_INST_MTVSRD | VSX_XX1((t)+32, a, 0)
33
34#endif
7c673cae
FG
35/* Copyright (C) 2017 International Business Machines Corp.
36 * All rights reserved.
37 *
38 * This program is free software; you can redistribute it and/or
39 * modify it under the terms of the GNU General Public License
40 * as published by the Free Software Foundation; either version
41 * 2 of the License, or (at your option) any later version.
42 */
43#ifndef __OPCODES_H
44#define __OPCODES_H
45
46#define __PPC_RA(a) (((a) & 0x1f) << 16)
47#define __PPC_RB(b) (((b) & 0x1f) << 11)
48#define __PPC_XA(a) ((((a) & 0x1f) << 16) | (((a) & 0x20) >> 3))
49#define __PPC_XB(b) ((((b) & 0x1f) << 11) | (((b) & 0x20) >> 4))
50#define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5))
51#define __PPC_XT(s) __PPC_XS(s)
52#define VSX_XX3(t, a, b) (__PPC_XT(t) | __PPC_XA(a) | __PPC_XB(b))
53#define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b))
54
55#define PPC_INST_VPMSUMW 0x10000488
56#define PPC_INST_VPMSUMD 0x100004c8
57#define PPC_INST_MFVSRD 0x7c000066
58#define PPC_INST_MTVSRD 0x7c000166
59
60#define VPMSUMW(t, a, b) .long PPC_INST_VPMSUMW | VSX_XX3((t), a, b)
61#define VPMSUMD(t, a, b) .long PPC_INST_VPMSUMD | VSX_XX3((t), a, b)
62#define MFVRD(a, t) .long PPC_INST_MFVSRD | VSX_XX1((t)+32, a, 0)
63#define MTVRD(t, a) .long PPC_INST_MTVSRD | VSX_XX1((t)+32, a, 0)
64
65#endif