Skip to content

Commit

Permalink
s390x: update to upstream revision 7e9113cb7
Browse files Browse the repository at this point in the history
- Update genoffsets
  • Loading branch information
mephi42 authored and rhelmot committed Jan 22, 2020
1 parent 580a45f commit 85bccfc
Show file tree
Hide file tree
Showing 12 changed files with 10,149 additions and 1,857 deletions.
48 changes: 32 additions & 16 deletions auxprogs/genoffsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,22 +651,38 @@ int main(int argc, char **argv)
GENOFFSET(S390X,s390x,a13);
GENOFFSET(S390X,s390x,a14);
GENOFFSET(S390X,s390x,a15);
GENOFFSET(S390X,s390x,f0);
GENOFFSET(S390X,s390x,f1);
GENOFFSET(S390X,s390x,f2);
GENOFFSET(S390X,s390x,f3);
GENOFFSET(S390X,s390x,f4);
GENOFFSET(S390X,s390x,f5);
GENOFFSET(S390X,s390x,f6);
GENOFFSET(S390X,s390x,f7);
GENOFFSET(S390X,s390x,f8);
GENOFFSET(S390X,s390x,f9);
GENOFFSET(S390X,s390x,f10);
GENOFFSET(S390X,s390x,f11);
GENOFFSET(S390X,s390x,f12);
GENOFFSET(S390X,s390x,f13);
GENOFFSET(S390X,s390x,f14);
GENOFFSET(S390X,s390x,f15);
GENOFFSET(S390X,s390x,v0);
GENOFFSET(S390X,s390x,v1);
GENOFFSET(S390X,s390x,v2);
GENOFFSET(S390X,s390x,v3);
GENOFFSET(S390X,s390x,v4);
GENOFFSET(S390X,s390x,v5);
GENOFFSET(S390X,s390x,v6);
GENOFFSET(S390X,s390x,v7);
GENOFFSET(S390X,s390x,v8);
GENOFFSET(S390X,s390x,v9);
GENOFFSET(S390X,s390x,v10);
GENOFFSET(S390X,s390x,v11);
GENOFFSET(S390X,s390x,v12);
GENOFFSET(S390X,s390x,v13);
GENOFFSET(S390X,s390x,v14);
GENOFFSET(S390X,s390x,v15);
GENOFFSET(S390X,s390x,v16);
GENOFFSET(S390X,s390x,v17);
GENOFFSET(S390X,s390x,v18);
GENOFFSET(S390X,s390x,v19);
GENOFFSET(S390X,s390x,v20);
GENOFFSET(S390X,s390x,v21);
GENOFFSET(S390X,s390x,v22);
GENOFFSET(S390X,s390x,v23);
GENOFFSET(S390X,s390x,v24);
GENOFFSET(S390X,s390x,v25);
GENOFFSET(S390X,s390x,v26);
GENOFFSET(S390X,s390x,v27);
GENOFFSET(S390X,s390x,v28);
GENOFFSET(S390X,s390x,v29);
GENOFFSET(S390X,s390x,v30);
GENOFFSET(S390X,s390x,v31);
GENOFFSET(S390X,s390x,r0);
GENOFFSET(S390X,s390x,r1);
GENOFFSET(S390X,s390x,r2);
Expand Down
83 changes: 80 additions & 3 deletions priv/guest_s390_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Copyright IBM Corp. 2010-2015
Copyright IBM Corp. 2010-2017
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -80,7 +80,8 @@ ULong s390x_dirtyhelper_STCKF(ULong *addr);
ULong s390x_dirtyhelper_STCKE(ULong *addr);
ULong s390x_dirtyhelper_STFLE(VexGuestS390XState *guest_state, ULong *addr);
void s390x_dirtyhelper_CUxy(UChar *addr, ULong data, ULong num_bytes);

ULong s390x_dirtyhelper_vec_op(VexGuestS390XState *guest_state,
ULong details);
ULong s390_do_cu12_cu14_helper1(UInt byte1, UInt etf3_and_m3_is_1);
ULong s390_do_cu12_helper2(UInt byte1, UInt byte2, UInt byte3, UInt byte4,
ULong stuff);
Expand All @@ -94,7 +95,9 @@ UInt s390_do_cvb(ULong decimal);
ULong s390_do_cvd(ULong binary);
ULong s390_do_ecag(ULong op2addr);
UInt s390_do_pfpo(UInt gpr0);

void s390x_dirtyhelper_PPNO_query(VexGuestS390XState *guest_state, ULong r1, ULong r2);
ULong s390x_dirtyhelper_PPNO_sha512(VexGuestS390XState *guest_state, ULong r1, ULong r2);
void s390x_dirtyhelper_PPNO_sha512_load_param_block( void );
/* The various ways to compute the condition code. */
enum {
S390_CC_OP_BITWISE = 0,
Expand Down Expand Up @@ -254,6 +257,80 @@ UInt s390_calculate_cond(ULong mask, ULong op, ULong dep1, ULong dep2,
/* Last target instruction for the EX helper */
extern ULong last_execute_target;

/*------------------------------------------------------------*/
/*--- Vector helpers. ---*/
/*------------------------------------------------------------*/

/* Vector operatons passed to s390x_dirtyhelper_vec_op(...) helper.
Please don't change ordering of elements and append new items
before S390_VEC_OP_LAST. */
enum {
S390_VEC_OP_INVALID = 0,
S390_VEC_OP_VPKS = 1,
S390_VEC_OP_VPKLS = 2,
S390_VEC_OP_VFAE = 3,
S390_VEC_OP_VFEE = 4,
S390_VEC_OP_VFENE = 5,
S390_VEC_OP_VISTR = 6,
S390_VEC_OP_VSTRC = 7,
S390_VEC_OP_VCEQ = 8,
S390_VEC_OP_VTM = 9,
S390_VEC_OP_VGFM = 10,
S390_VEC_OP_VGFMA = 11,
S390_VEC_OP_VMAH = 12,
S390_VEC_OP_VMALH = 13,
S390_VEC_OP_VCH = 14,
S390_VEC_OP_VCHL = 15,
S390_VEC_OP_VFCE = 16,
S390_VEC_OP_VFCH = 17,
S390_VEC_OP_VFCHE = 18,
S390_VEC_OP_VFTCI = 19,
S390_VEC_OP_LAST = 20 // supposed to be the last element in enum
} s390x_vec_op_t;

/* Arguments of s390x_dirtyhelper_vec_op(...) which are packed into one
ULong variable.
*/
typedef union {
struct {
unsigned int op : 8; // should be an element of s390x_vec_op_t
unsigned int v1 : 5; // result of operation
unsigned int v2 : 5; // argument one of operation
unsigned int v3 : 5; // argument two of operation or
// zero for unary operations

unsigned int v4 : 5; // argument two of operation or
// zero for unary and binary operations

unsigned int m4 : 4; // field m4 of insn or zero if it's missing
unsigned int m5 : 4; // field m5 of insn or zero if it's missing
unsigned int m6 : 4; // field m6 of insn or zero if it's missing
unsigned int i3 : 12; // field i3 of insn or zero if it's missing
unsigned int read_only: 1; // don't write result to Guest State
unsigned int reserved : 11; // reserved for future
};
ULong serialized;
} s390x_vec_op_details_t;

STATIC_ASSERT(sizeof(s390x_vec_op_details_t) == sizeof(ULong));

/* Macro definitions for opcodes that are not generally available.
The values to be encoded in those fields must be integer values in
hexadecimal notation without a leading 0x.
E.g. VRX_VXBD(e7, 1, 0, 3, 0000, 0, 06) is equal to "vl %%v1, 0(%%r3)\n\t"
*/
#define VRX_VXBD(op1, v1, x2, b2, d2, rxb, op2) \
".short 0x" #op1 #v1 #x2 "\n\t .int 0x" #b2 #d2 "0" #rxb #op2 "\n\t"
#define VRR_VVVMM(op1, v1, v2, v3, m5, m4, rxb, op2) \
".short 0x" #op1 #v1 #v2 "\n\t .int 0x" #v3 "0" #m5 "0" #m4 #rxb #op2 "\n\t"

#define VL(v1, x2, b2, d2, rxb) VRX_VXBD(e7, v1, x2, b2, d2, rxb, 06)
#define VST(v1, x2, b2, d2, rxb) VRX_VXBD(e7, v1, x2, b2, d2, rxb, 0e)
#define VPKS(v1, v2, v3, m4, m5, rxb) VRR_VVVMM(e7, v1, v2, v3, m5, m4, rxb, 97)
#define VPKLS(v1, v2, v3, m4, m5, rxb) VRR_VVVMM(e7, v1, v2, v3, m5, m4, rxb, 95)


/*---------------------------------------------------------------*/
/*--- end guest_s390_defs.h ---*/
/*---------------------------------------------------------------*/
Expand Down
Loading

0 comments on commit 85bccfc

Please sign in to comment.