1 /* -*- mode: C; c-basic-offset: 3; -*- */
3 /*---------------------------------------------------------------*/
4 /*--- begin host_s390_defs.h ---*/
5 /*---------------------------------------------------------------*/
8 This file is part of Valgrind, a dynamic binary instrumentation
11 Copyright IBM Corp. 2010-2017
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.
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.
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
28 The GNU General Public License is contained in the file COPYING.
31 /* Contributed by Florian Krohm */
33 #ifndef __VEX_HOST_S390_DEFS_H
34 #define __VEX_HOST_S390_DEFS_H
36 #include "libvex_basictypes.h" /* Bool */
37 #include "libvex.h" /* VexArchInfo */
38 #include "host_generic_regs.h" /* HReg */
39 #include "s390_defs.h" /* s390_cc_t */
41 /* --------- Registers --------- */
42 const HChar
*s390_hreg_as_string(HReg
);
43 HReg
s390_hreg_gpr(UInt regno
);
44 HReg
s390_hreg_fpr(UInt regno
);
45 HReg
s390_hreg_vr(UInt regno
);
47 /* Dedicated registers */
48 HReg
s390_hreg_guest_state_pointer(void);
49 HReg
s390_hreg_stack_pointer(void);
52 /* Given the index of a function argument, return the number of the
53 general purpose register in which it is being passed. Arguments are
54 counted 0, 1, 2, ... and they are being passed in r2, r3, r4, ... */
55 static __inline__ UInt
56 s390_gprno_from_arg_index(UInt ix
)
61 /* --------- Memory address expressions (amodes). --------- */
63 /* These are the address modes:
64 (1) b12: base register + 12-bit unsigned offset (e.g. RS)
65 (2) b20: base register + 20-bit signed offset (e.g. RSY)
66 (3) bx12: base register + index register + 12-bit unsigned offset (e.g. RX)
67 (4) bx20: base register + index register + 20-bit signed offset (e.g. RXY)
68 fixs390: There is also pc-relative stuff.. e.g. LARL
81 HReg x
; /* hregNumber(x) == 0 for S390_AMODE_B12/B20 kinds */
82 Int d
; /* 12 bit unsigned or 20 bit signed */
86 s390_amode
*s390_amode_b12(Int d
, HReg b
);
87 s390_amode
*s390_amode_b20(Int d
, HReg b
);
88 s390_amode
*s390_amode_bx12(Int d
, HReg b
, HReg x
);
89 s390_amode
*s390_amode_bx20(Int d
, HReg b
, HReg x
);
90 s390_amode
*s390_amode_for_guest_state(Int d
);
91 s390_amode
*s390_amode_for_stack_pointer(Int d
);
92 Bool
s390_amode_is_sane(const s390_amode
*);
94 const HChar
*s390_amode_as_string(const s390_amode
*);
96 /* ------------- 2nd (right) operand of binary operation ---------------- */
105 /* Naming convention for operand locations:
108 M - memory (any Amode may be used)
111 /* An operand that is either in a GPR or is addressable via a BX20 amode */
122 /* The kind of instructions */
124 S390_INSN_LOAD
, /* load register from memory */
125 S390_INSN_STORE
, /* store register to memory */
126 S390_INSN_MOVE
, /* from register to register */
127 S390_INSN_MEMCPY
, /* from memory to memory */
128 S390_INSN_COND_MOVE
, /* conditonal "move" to register */
129 S390_INSN_LOAD_IMMEDIATE
,
131 S390_INSN_SMUL
, /* signed multiply; n-bit operands; 2n-bit result */
132 S390_INSN_UMUL
, /* unsigned multiply; n-bit operands; 2n-bit result */
133 S390_INSN_SDIV
, /* signed division; 2n-bit / n-bit -> n-bit quot/rem */
134 S390_INSN_UDIV
, /* unsigned division; 2n-bit / n-bit -> n-bit quot/rem */
135 S390_INSN_DIVS
, /* n-bit dividend; n-bit divisor; n-bit quot/rem */
136 S390_INSN_CLZ
, /* count left-most zeroes */
138 S390_INSN_TEST
, /* test operand and set cc */
139 S390_INSN_CC2BOOL
,/* convert condition code to 0/1 */
141 S390_INSN_HELPER_CALL
,
142 S390_INSN_CAS
, /* compare and swap */
143 S390_INSN_CDAS
, /* compare double and swap */
144 S390_INSN_BFP_BINOP
, /* Binary floating point */
147 S390_INSN_BFP_COMPARE
,
148 S390_INSN_BFP_CONVERT
,
149 S390_INSN_DFP_BINOP
, /* Decimal floating point */
152 S390_INSN_DFP_COMPARE
,
153 S390_INSN_DFP_CONVERT
,
154 S390_INSN_DFP_REROUND
,
155 S390_INSN_FP_CONVERT
,
157 S390_INSN_MIMM
, /* Assign an immediate constant to a memory location */
158 S390_INSN_MADD
, /* Add a value to a memory location */
159 S390_INSN_SET_FPC_BFPRM
, /* Set the bfp rounding mode in the FPC */
160 S390_INSN_SET_FPC_DFPRM
, /* Set the dfp rounding mode in the FPC */
161 /* The following 5 insns are mandated by translation chaining */
162 S390_INSN_XDIRECT
, /* direct transfer to guest address */
163 S390_INSN_XINDIR
, /* indirect transfer to guest address */
164 S390_INSN_XASSISTED
, /* assisted transfer to guest address */
165 S390_INSN_EVCHECK
, /* Event check */
166 S390_INSN_PROFINC
, /* 64-bit profile counter increment */
167 S390_INSN_VEC_AMODEOP
,
168 S390_INSN_VEC_AMODEINTOP
,
175 /* The kind of ALU instructions */
179 S390_ALU_MUL
, /* n-bit operands; result is lower n-bit of product */
185 S390_ALU_RSHA
/* arithmetic */
189 /* The kind of unary integer operations */
204 /* The kind of ternary BFP operations */
210 /* The kind of binary BFP operations */
218 /* The kind of unary BFP operations */
226 /* Type conversion operations: to and/or from binary floating point */
230 S390_BFP_I32_TO_F128
,
233 S390_BFP_I64_TO_F128
,
236 S390_BFP_U32_TO_F128
,
239 S390_BFP_U64_TO_F128
,
245 S390_BFP_F32_TO_F128
,
251 S390_BFP_F64_TO_F128
,
252 S390_BFP_F128_TO_I32
,
253 S390_BFP_F128_TO_I64
,
254 S390_BFP_F128_TO_U32
,
255 S390_BFP_F128_TO_U64
,
256 S390_BFP_F128_TO_F32
,
257 S390_BFP_F128_TO_F64
,
258 S390_BFP_F32_TO_F32I
,
259 S390_BFP_F64_TO_F64I
,
260 S390_BFP_F128_TO_F128I
263 /* Type conversion operations: to and/or from decimal floating point */
267 S390_DFP_D64_TO_D128
,
268 S390_DFP_D128_TO_D64
,
270 S390_DFP_I32_TO_D128
,
272 S390_DFP_I64_TO_D128
,
274 S390_DFP_U32_TO_D128
,
276 S390_DFP_U64_TO_D128
,
281 S390_DFP_D128_TO_I32
,
282 S390_DFP_D128_TO_I64
,
283 S390_DFP_D128_TO_U32
,
296 S390_FP_F128_TO_D128
,
308 /* The kind of binary DFP operations */
317 /* The kind of unary DFP operations */
319 S390_DFP_EXTRACT_EXP_D64
,
320 S390_DFP_EXTRACT_EXP_D128
,
321 S390_DFP_EXTRACT_SIG_D64
,
322 S390_DFP_EXTRACT_SIG_D128
,
325 /* The DFP operations with 2 operands one of them being integer */
328 S390_DFP_SHIFT_RIGHT
,
332 /* The kind of DFP compare operations */
335 S390_DFP_COMPARE_EXP
,
338 /* The vector operations with 2 operands one of them being amode */
341 } s390_vec_amodeop_t
;
343 /* The vector operations with three (vector, amode and integer) operands */
346 } s390_vec_amodeintop_t
;
348 /* The vector operations with two operands */
351 S390_VEC_PACK_SATURS
,
352 S390_VEC_PACK_SATURU
,
353 S390_VEC_COMPARE_EQUAL
,
361 /* The vector operations with three operands */
366 /* The details of a CDAS insn. Carved out to keep the size of
379 /* The details of a binary DFP insn. Carved out to keep the size of
382 s390_dfp_binop_t tag
;
383 s390_dfp_round_t rounding_mode
;
384 HReg dst_hi
; /* 128-bit result high part; 64-bit result */
385 HReg dst_lo
; /* 128-bit result low part */
386 HReg op2_hi
; /* 128-bit operand high part; 64-bit opnd 1 */
387 HReg op2_lo
; /* 128-bit operand low part */
388 HReg op3_hi
; /* 128-bit operand high part; 64-bit opnd 2 */
389 HReg op3_lo
; /* 128-bit operand low part */
394 s390_dfp_round_t rounding_mode
;
395 HReg dst_hi
; /* 128-bit result high part; 32/64-bit result */
396 HReg dst_lo
; /* 128-bit result low part */
397 HReg op_hi
; /* 128-bit operand high part; 32/64-bit opnd */
398 HReg op_lo
; /* 128-bit operand low part */
399 HReg r1
; /* clobbered register GPR #1 */
402 /* Pseudo-insn for representing a helper call.
403 TARGET is the absolute address of the helper function
404 NUM_ARGS says how many arguments are being passed.
405 All arguments have integer type and are being passed according to ABI,
406 i.e. in registers r2, r3, r4, r5, and r6, with argument #0 being
407 passed in r2 and so forth. */
411 RetLoc rloc
; /* where the return value will be */
413 const HChar
*name
; /* callee's name (for debugging) */
418 /* Usually, this is the size of the result of an operation.
420 - for comparisons it is the size of the operand
447 ULong value
; /* not sign extended */
449 /* add, and, or, xor */
456 HReg dst_hi
; /* r10 */
457 HReg dst_lo
; /* also op1 r11 */
461 HReg op1_hi
; /* also remainder r10 */
462 HReg op1_lo
; /* also quotient r11 */
466 HReg rem
; /* remainder r10 */
467 HReg op1
; /* also quotient r11 */
471 HReg num_bits
; /* number of leftmost '0' bits r10 */
472 HReg clobber
; /* unspecified r11 */
481 Bool signed_comparison
;
488 /* Convert the condition code to a boolean value. */
503 s390_helper_call
*details
;
506 /* Floating point instructions (including conversion to/from floating
509 128-bit floating point requires register pairs. As the registers
510 in a register pair cannot be chosen independently it would suffice
511 to store only one register of the pair in order to represent it.
512 We chose not to do that as being explicit about all registers
513 helps with debugging and does not require special handling in
514 e.g. s390_insn_get_reg_usage, It'd be all too easy to forget about
515 the "other" register in a pair if it is implicit.
517 The convention for all fp s390_insn is that the _hi register will
518 be used to store the result / operand of a 32/64-bit operation.
519 The _hi register holds the 8 bytes of HIgher significance of a
520 128-bit value (hence the suffix). However, it is the lower numbered
521 register of a register pair. POP says that the lower numbered
522 register is used to identify the pair in an insn encoding. So,
523 when an insn is emitted, only the _hi registers need to be looked
524 at. Nothing special is needed for 128-bit BFP which is nice.
527 /* There are currently no ternary 128-bit BFP operations. */
529 s390_bfp_triop_t tag
;
535 s390_bfp_binop_t tag
;
536 HReg dst_hi
; /* 128-bit result high part; 32/64-bit result */
537 HReg dst_lo
; /* 128-bit result low part */
538 HReg op2_hi
; /* 128-bit operand high part; 32/64-bit opnd */
539 HReg op2_lo
; /* 128-bit operand low part */
543 HReg dst_hi
; /* 128-bit result high part; 32/64-bit result */
544 HReg dst_lo
; /* 128-bit result low part */
545 HReg op_hi
; /* 128-bit operand high part; 32/64-bit opnd */
546 HReg op_lo
; /* 128-bit operand low part */
550 s390_bfp_round_t rounding_mode
;
551 HReg dst_hi
; /* 128-bit result high part; 32/64-bit result */
552 HReg dst_lo
; /* 128-bit result low part */
553 HReg op_hi
; /* 128-bit operand high part; 32/64-bit opnd */
554 HReg op_lo
; /* 128-bit operand low part */
557 HReg dst
; /* condition code in s390 encoding */
558 HReg op1_hi
; /* 128-bit operand high part; 32/64-bit opnd */
559 HReg op1_lo
; /* 128-bit operand low part */
560 HReg op2_hi
; /* 128-bit operand high part; 32/64-bit opnd */
561 HReg op2_lo
; /* 128-bit operand low part */
564 s390_dfp_binop
*details
;
568 HReg dst_hi
; /* 128-bit result high part; 64-bit result */
569 HReg dst_lo
; /* 128-bit result low part */
570 HReg op_hi
; /* 128-bit operand high part; 64-bit opnd */
571 HReg op_lo
; /* 128-bit operand low part */
574 s390_dfp_intop_t tag
;
575 HReg dst_hi
; /* 128-bit result high part; 64-bit result */
576 HReg dst_lo
; /* 128-bit result low part */
577 HReg op2
; /* integer operand */
578 HReg op3_hi
; /* 128-bit operand high part; 64-bit opnd */
579 HReg op3_lo
; /* 128-bit operand low part */
583 s390_dfp_round_t rounding_mode
;
584 HReg dst_hi
; /* 128-bit result high part; 64-bit result */
585 HReg dst_lo
; /* 128-bit result low part */
586 HReg op_hi
; /* 128-bit operand high part; 64-bit opnd */
587 HReg op_lo
; /* 128-bit operand low part */
590 s390_fp_convert
*details
;
594 HReg dst
; /* condition code in s390 encoding */
595 HReg op1_hi
; /* 128-bit operand high part; 64-bit opnd 1 */
596 HReg op1_lo
; /* 128-bit operand low part */
597 HReg op2_hi
; /* 128-bit operand high part; 64-bit opnd 2 */
598 HReg op2_lo
; /* 128-bit operand low part */
601 s390_dfp_round_t rounding_mode
;
602 HReg dst_hi
; /* 128-bit result high part; 64-bit result */
603 HReg dst_lo
; /* 128-bit result low part */
604 HReg op2
; /* integer operand */
605 HReg op3_hi
; /* 128-bit operand high part; 64-bit opnd */
606 HReg op3_lo
; /* 128-bit operand low part */
612 ULong value
; /* sign extended */
617 ULong value
; /* for debugging only */
626 /* The next 5 entries are generic to support translation chaining */
628 /* Update the guest IA value, then exit requesting to chain
629 to it. May be conditional. */
632 Bool to_fast_entry
; /* chain to the what entry point? */
633 Addr64 dst
; /* next guest address */
634 s390_amode
*guest_IA
;
636 /* Boring transfer to a guest address not known at JIT time.
637 Not chainable. May be conditional. */
641 s390_amode
*guest_IA
;
643 /* Assisted transfer to a guest address, most general case.
644 Not chainable. May be conditional. */
649 s390_amode
*guest_IA
;
652 /* fixs390: I don't think these are really needed
653 as the gsp and the offset are fixed no ? */
654 s390_amode
*counter
; /* dispatch counter */
655 s390_amode
*fail_addr
;
658 /* No fields. The address of the counter to increment is
659 installed later, post-translation, by patching it in,
660 as it is not known at translation time. */
663 s390_vec_amodeop_t tag
;
664 HReg dst
; /* 64-bit result */
665 HReg op1
; /* 128-bit operand */
666 s390_amode
*op2
; /* amode operand */
669 s390_vec_amodeintop_t tag
;
670 HReg dst
; /* 128-bit result */
671 s390_amode
*op2
; /* amode operand */
672 HReg op3
; /* integer operand */
675 s390_vec_binop_t tag
;
676 HReg dst
; /* 128-bit result */
677 HReg op1
; /* 128-bit first operand */
678 HReg op2
; /* 128-bit second operand */
681 s390_vec_triop_t tag
;
682 HReg dst
; /* 128-bit result */
683 HReg op1
; /* 128-bit first operand */
684 HReg op2
; /* 128-bit second operand */
685 HReg op3
; /* 128-bit third operand */
690 s390_insn
*s390_insn_load(UChar size
, HReg dst
, s390_amode
*src
);
691 s390_insn
*s390_insn_store(UChar size
, s390_amode
*dst
, HReg src
);
692 s390_insn
*s390_insn_move(UChar size
, HReg dst
, HReg src
);
693 s390_insn
*s390_insn_memcpy(UChar size
, s390_amode
*dst
, s390_amode
*src
);
694 s390_insn
*s390_insn_cond_move(UChar size
, s390_cc_t cond
, HReg dst
,
696 s390_insn
*s390_insn_load_immediate(UChar size
, HReg dst
, ULong val
);
697 s390_insn
*s390_insn_alu(UChar size
, s390_alu_t
, HReg dst
,
699 s390_insn
*s390_insn_mul(UChar size
, HReg dst_hi
, HReg dst_lo
,
700 s390_opnd_RMI op2
, Bool signed_multiply
);
701 s390_insn
*s390_insn_div(UChar size
, HReg op1_hi
, HReg op1_lo
,
702 s390_opnd_RMI op2
, Bool signed_divide
);
703 s390_insn
*s390_insn_divs(UChar size
, HReg rem
, HReg op1
, s390_opnd_RMI op2
);
704 s390_insn
*s390_insn_clz(UChar size
, HReg num_bits
, HReg clobber
,
706 s390_insn
*s390_insn_cas(UChar size
, HReg op1
, s390_amode
*op2
, HReg op3
,
708 s390_insn
*s390_insn_cdas(UChar size
, HReg op1_high
, HReg op1_low
,
709 s390_amode
*op2
, HReg op3_high
, HReg op3_low
,
710 HReg old_high
, HReg old_low
, HReg scratch
);
711 s390_insn
*s390_insn_unop(UChar size
, s390_unop_t tag
, HReg dst
,
713 s390_insn
*s390_insn_cc2bool(HReg dst
, s390_cc_t src
);
714 s390_insn
*s390_insn_test(UChar size
, s390_opnd_RMI src
);
715 s390_insn
*s390_insn_compare(UChar size
, HReg dst
, s390_opnd_RMI opnd
,
716 Bool signed_comparison
);
717 s390_insn
*s390_insn_helper_call(s390_cc_t cond
, Addr64 target
, UInt num_args
,
718 const HChar
*name
, RetLoc rloc
);
719 s390_insn
*s390_insn_bfp_triop(UChar size
, s390_bfp_triop_t
, HReg dst
,
721 s390_insn
*s390_insn_bfp_binop(UChar size
, s390_bfp_binop_t
, HReg dst
,
723 s390_insn
*s390_insn_bfp_unop(UChar size
, s390_bfp_unop_t tag
, HReg dst
,
725 s390_insn
*s390_insn_bfp_compare(UChar size
, HReg dst
, HReg op1
, HReg op2
);
726 s390_insn
*s390_insn_bfp_convert(UChar size
, s390_bfp_conv_t tag
, HReg dst
,
727 HReg op
, s390_bfp_round_t
);
728 s390_insn
*s390_insn_bfp128_convert(UChar size
, s390_bfp_conv_t tag
, HReg dst_hi
,
729 HReg dst_lo
, HReg op_hi
, HReg op_lo
,
730 s390_bfp_round_t rounding_mode
);
731 s390_insn
*s390_insn_bfp128_binop(UChar size
, s390_bfp_binop_t
, HReg dst_hi
,
732 HReg dst_lo
, HReg op2_hi
, HReg op2_lo
);
733 s390_insn
*s390_insn_bfp128_unop(UChar size
, s390_bfp_unop_t
, HReg dst_hi
,
734 HReg dst_lo
, HReg op_hi
, HReg op_lo
);
735 s390_insn
*s390_insn_bfp128_compare(UChar size
, HReg dst
, HReg op1_hi
,
736 HReg op1_lo
, HReg op2_hi
, HReg op2_lo
);
737 s390_insn
*s390_insn_bfp128_convert_to(UChar size
, s390_bfp_conv_t
,
738 HReg dst_hi
, HReg dst_lo
, HReg op
);
739 s390_insn
*s390_insn_bfp128_convert_from(UChar size
, s390_bfp_conv_t
,
740 HReg dst_hi
, HReg dst_lo
, HReg op_hi
,
741 HReg op_lo
, s390_bfp_round_t
);
742 s390_insn
*s390_insn_dfp_binop(UChar size
, s390_dfp_binop_t
, HReg dst
,
744 s390_dfp_round_t rounding_mode
);
745 s390_insn
*s390_insn_dfp_unop(UChar size
, s390_dfp_unop_t
, HReg dst
, HReg op
);
746 s390_insn
*s390_insn_dfp_intop(UChar size
, s390_dfp_intop_t
, HReg dst
,
748 s390_insn
*s390_insn_dfp_compare(UChar size
, s390_dfp_cmp_t
, HReg dst
,
750 s390_insn
*s390_insn_dfp_convert(UChar size
, s390_dfp_conv_t tag
, HReg dst
,
751 HReg op
, s390_dfp_round_t
);
752 s390_insn
*s390_insn_dfp_reround(UChar size
, HReg dst
, HReg op2
, HReg op3
,
754 s390_insn
*s390_insn_fp_convert(UChar size
, s390_fp_conv_t tag
,
755 HReg dst
, HReg op
, HReg r1
, s390_dfp_round_t
);
756 s390_insn
*s390_insn_fp128_convert(UChar size
, s390_fp_conv_t tag
,
757 HReg dst_hi
, HReg dst_lo
, HReg op_hi
,
758 HReg op_lo
, HReg r1
, s390_dfp_round_t
);
759 s390_insn
*s390_insn_dfp128_binop(UChar size
, s390_dfp_binop_t
, HReg dst_hi
,
760 HReg dst_lo
, HReg op2_hi
, HReg op2_lo
,
761 HReg op3_hi
, HReg op3_lo
,
762 s390_dfp_round_t rounding_mode
);
763 s390_insn
*s390_insn_dfp128_unop(UChar size
, s390_dfp_unop_t
, HReg dst
,
764 HReg op_hi
, HReg op_lo
);
765 s390_insn
*s390_insn_dfp128_intop(UChar size
, s390_dfp_intop_t
, HReg dst_hi
,
766 HReg dst_lo
, HReg op2
,
767 HReg op3_hi
, HReg op3_lo
);
768 s390_insn
*s390_insn_dfp128_compare(UChar size
, s390_dfp_cmp_t
, HReg dst
,
769 HReg op1_hi
, HReg op1_lo
, HReg op2_hi
,
771 s390_insn
*s390_insn_dfp128_convert_to(UChar size
, s390_dfp_conv_t
,
772 HReg dst_hi
, HReg dst_lo
, HReg op
);
773 s390_insn
*s390_insn_dfp128_convert_from(UChar size
, s390_dfp_conv_t
,
774 HReg dst_hi
, HReg dst_lo
, HReg op_hi
,
775 HReg op_lo
, s390_dfp_round_t
);
776 s390_insn
*s390_insn_dfp128_reround(UChar size
, HReg dst_hi
, HReg dst_lo
,
777 HReg op2
, HReg op3_hi
, HReg op3_lo
,
779 s390_insn
*s390_insn_mfence(void);
780 s390_insn
*s390_insn_mimm(UChar size
, s390_amode
*dst
, ULong value
);
781 s390_insn
*s390_insn_madd(UChar size
, s390_amode
*dst
, UChar delta
,
783 s390_insn
*s390_insn_set_fpc_bfprm(UChar size
, HReg mode
);
784 s390_insn
*s390_insn_set_fpc_dfprm(UChar size
, HReg mode
);
786 /* Five for translation chaining */
787 s390_insn
*s390_insn_xdirect(s390_cc_t cond
, Addr64 dst
, s390_amode
*guest_IA
,
789 s390_insn
*s390_insn_xindir(s390_cc_t cond
, HReg dst
, s390_amode
*guest_IA
);
790 s390_insn
*s390_insn_xassisted(s390_cc_t cond
, HReg dst
, s390_amode
*guest_IA
,
792 s390_insn
*s390_insn_evcheck(s390_amode
*counter
, s390_amode
*fail_addr
);
793 s390_insn
*s390_insn_profinc(void);
794 s390_insn
*s390_insn_vec_amodeop(UChar size
, s390_vec_amodeop_t
, HReg dst
,
795 HReg op1
, s390_amode
* op2
);
796 s390_insn
*s390_insn_vec_amodeintop(UChar size
, s390_vec_amodeintop_t
, HReg dst
,
797 s390_amode
* op2
, HReg op3
);
798 s390_insn
*s390_insn_vec_binop(UChar size
, s390_vec_binop_t
, HReg dst
, HReg op1
,
800 s390_insn
*s390_insn_vec_triop(UChar size
, s390_vec_triop_t
, HReg dst
, HReg op1
,
803 const HChar
*s390_insn_as_string(const s390_insn
*);
805 /*--------------------------------------------------------*/
806 /* --- Interface exposed to VEX --- */
807 /*--------------------------------------------------------*/
809 void ppS390AMode(const s390_amode
*);
810 void ppS390Instr(const s390_insn
*, Bool mode64
);
811 UInt
ppHRegS390(HReg
);
813 /* Some functions that insulate the register allocator from details
814 of the underlying instruction set. */
815 void getRegUsage_S390Instr( HRegUsage
*, const s390_insn
*, Bool
);
816 void mapRegs_S390Instr ( HRegRemap
*, s390_insn
*, Bool
);
817 Int
emit_S390Instr ( Bool
*, UChar
*, Int
, const s390_insn
*, Bool
,
818 VexEndness
, const void *, const void *,
819 const void *, const void *);
820 const RRegUniverse
*getRRegUniverse_S390( void );
821 void genSpill_S390 ( HInstr
**, HInstr
**, HReg
, Int
, Bool
);
822 void genReload_S390 ( HInstr
**, HInstr
**, HReg
, Int
, Bool
);
823 extern s390_insn
* genMove_S390(HReg from
, HReg to
, Bool mode64
);
824 HInstrArray
*iselSB_S390 ( const IRSB
*, VexArch
, const VexArchInfo
*,
825 const VexAbiInfo
*, Int
, Int
, Bool
, Bool
, Addr
);
827 /* Return the number of bytes of code needed for an event check */
828 Int
evCheckSzB_S390(void);
830 /* Perform a chaining and unchaining of an XDirect jump. */
831 VexInvalRange
chainXDirect_S390(VexEndness endness_host
,
832 void *place_to_chain
,
833 const void *disp_cp_chain_me_EXPECTED
,
834 const void *place_to_jump_to
);
836 VexInvalRange
unchainXDirect_S390(VexEndness endness_host
,
837 void *place_to_unchain
,
838 const void *place_to_jump_to_EXPECTED
,
839 const void *disp_cp_chain_me
);
841 /* Patch the counter location into an existing ProfInc point. */
842 VexInvalRange
patchProfInc_S390(VexEndness endness_host
,
844 const ULong
*location_of_counter
);
846 /* KLUDGE: See detailled comment in host_s390_defs.c. */
847 extern UInt s390_host_hwcaps
;
849 /* Convenience macros to test installed facilities */
850 #define s390_host_has_ldisp \
851 (s390_host_hwcaps & (VEX_HWCAPS_S390X_LDISP))
852 #define s390_host_has_eimm \
853 (s390_host_hwcaps & (VEX_HWCAPS_S390X_EIMM))
854 #define s390_host_has_gie \
855 (s390_host_hwcaps & (VEX_HWCAPS_S390X_GIE))
856 #define s390_host_has_dfp \
857 (s390_host_hwcaps & (VEX_HWCAPS_S390X_DFP))
858 #define s390_host_has_fgx \
859 (s390_host_hwcaps & (VEX_HWCAPS_S390X_FGX))
860 #define s390_host_has_etf2 \
861 (s390_host_hwcaps & (VEX_HWCAPS_S390X_ETF2))
862 #define s390_host_has_stfle \
863 (s390_host_hwcaps & (VEX_HWCAPS_S390X_STFLE))
864 #define s390_host_has_etf3 \
865 (s390_host_hwcaps & (VEX_HWCAPS_S390X_ETF3))
866 #define s390_host_has_stckf \
867 (s390_host_hwcaps & (VEX_HWCAPS_S390X_STCKF))
868 #define s390_host_has_fpext \
869 (s390_host_hwcaps & (VEX_HWCAPS_S390X_FPEXT))
870 #define s390_host_has_lsc \
871 (s390_host_hwcaps & (VEX_HWCAPS_S390X_LSC))
872 #define s390_host_has_pfpo \
873 (s390_host_hwcaps & (VEX_HWCAPS_S390X_PFPO))
874 #define s390_host_has_vx \
875 (s390_host_hwcaps & (VEX_HWCAPS_S390X_VX))
877 #endif /* ndef __VEX_HOST_S390_DEFS_H */
879 /*---------------------------------------------------------------*/
880 /*--- end host_s390_defs.h ---*/
881 /*---------------------------------------------------------------*/