blob: 15224451416b1846467644b9265a3174a91e6b96 [file] [log] [blame]
sewardj2019a972011-03-07 16:04:07 +00001/* -*- mode: C; c-basic-offset: 3; -*- */
2
3/*---------------------------------------------------------------*/
florian79af5752012-09-20 01:22:10 +00004/*--- begin s390_disasm.h ---*/
sewardj2019a972011-03-07 16:04:07 +00005/*---------------------------------------------------------------*/
6
7/*
8 This file is part of Valgrind, a dynamic binary instrumentation
9 framework.
10
sewardj89ae8472013-10-18 14:12:58 +000011 Copyright IBM Corp. 2010-2013
sewardj2019a972011-03-07 16:04:07 +000012
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 02110-1301, USA.
27
28 The GNU General Public License is contained in the file COPYING.
29*/
30
florian79af5752012-09-20 01:22:10 +000031#ifndef __VEX_S390_DISASM_H
32#define __VEX_S390_DISASM_H
sewardj2019a972011-03-07 16:04:07 +000033
34#include "libvex_basictypes.h"
35
36/* Macros to encode a command for s390_disasm. */
37#undef P
38#define P(a) (S390_ARG_##a)
39#undef ENC1
40#define ENC1(a) ((P(DONE) << 4) | P(a))
41#undef ENC2
42#define ENC2(a,b) ((P(DONE) << 8) | (P(b) << 4) | P(a))
43#undef ENC3
44#define ENC3(a,b,c) ((P(DONE) << 12) | (P(c) << 8) | (P(b) << 4) | P(a))
45#undef ENC4
46#define ENC4(a,b,c,d) ((P(DONE) << 16) | (P(d) << 12) | (P(c) << 8) | \
47 (P(b) << 4) | P(a))
48#undef ENC5
49#define ENC5(a,b,c,d,e) ((P(DONE) << 20) | (P(e) << 16) | (P(d) << 12) | \
50 (P(c) << 8) | (P(b) << 4) | P(a))
51#undef ENC6
52#define ENC6(a,b,c,d,e,f) ((P(DONE) << 24) | (P(f) << 20) | (P(e) << 16) | \
53 (P(d) << 12) | (P(c) << 8) | (P(b) << 4) | P(a))
54
55/* The different kinds of operands in an asm insn */
56enum {
57 S390_ARG_DONE = 0,
58 S390_ARG_GPR = 1,
59 S390_ARG_FPR = 2,
60 S390_ARG_AR = 3,
61 S390_ARG_INT = 4,
62 S390_ARG_UINT = 5,
63 S390_ARG_PCREL = 6,
64 S390_ARG_SDXB = 7,
65 S390_ARG_UDXB = 8,
66 S390_ARG_UDLB = 9,
67 S390_ARG_CABM = 10,
68 S390_ARG_MNM = 11,
69 S390_ARG_XMNM = 12
70};
71
72/* The different kinds of extended mnemonics */
73enum {
74 S390_XMNM_CAB = 0,
75 S390_XMNM_BCR = 1,
76 S390_XMNM_BC = 2,
77 S390_XMNM_BRC = 3,
sewardjd7bde722011-04-05 13:19:33 +000078 S390_XMNM_BRCL = 4,
79 S390_XMNM_LOCR = 5,
80 S390_XMNM_LOCGR = 6,
81 S390_XMNM_LOC = 7,
82 S390_XMNM_LOCG = 8,
83 S390_XMNM_STOC = 9,
84 S390_XMNM_STOCG = 10
sewardj2019a972011-03-07 16:04:07 +000085};
86
87void s390_disasm(UInt command, ...);
88
89/*---------------------------------------------------------------*/
florian79af5752012-09-20 01:22:10 +000090/*--- end s390_disasm.h ---*/
sewardj2019a972011-03-07 16:04:07 +000091/*---------------------------------------------------------------*/
92
florian79af5752012-09-20 01:22:10 +000093#endif /* __VEX_S390_DISASM_H */