Skip to content

Commit

Permalink
s390x: update to upstream revision 379c62017
Browse files Browse the repository at this point in the history
  • Loading branch information
mephi42 authored and rhelmot committed Jan 22, 2020
1 parent 85bccfc commit 074d71b
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 58 deletions.
8 changes: 4 additions & 4 deletions priv/guest_s390_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
along with this program; if not, see <http://www.gnu.org/licenses/>.
The GNU General Public License is contained in the file COPYING.
*/
Expand Down Expand Up @@ -160,7 +158,9 @@ enum {
S390_CC_OP_DFP_128_TO_INT_64 = 57,
S390_CC_OP_PFPO_32 = 58,
S390_CC_OP_PFPO_64 = 59,
S390_CC_OP_PFPO_128 = 60
S390_CC_OP_PFPO_128 = 60,
S390_CC_OP_MUL_32 = 61,
S390_CC_OP_MUL_64 = 62
};

/*------------------------------------------------------------*/
Expand Down
20 changes: 17 additions & 3 deletions priv/guest_s390_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
along with this program; if not, see <http://www.gnu.org/licenses/>.
The GNU General Public License is contained in the file COPYING.
*/
Expand Down Expand Up @@ -992,6 +990,16 @@ decode_bfp_rounding_mode(UInt irrm)
psw >> 28; /* cc */ \
})

#define S390_CC_FOR_TERNARY(opcode,cc_dep1,cc_dep2) \
({ \
__asm__ volatile ( \
opcode ",%[op1],%[op1],%[op2],0\n\t" \
"ipm %[psw]\n\t" : [psw] "=d"(psw), [op1] "+d"(cc_dep1) \
: [op2] "d"(cc_dep2) \
: "cc");\
psw >> 28; /* cc */ \
})

#define S390_CC_FOR_TERNARY_SUBB(opcode,cc_dep1,cc_dep2,cc_ndep) \
({ \
/* Recover the original DEP2 value. See comment near s390_cc_thunk_put3 \
Expand Down Expand Up @@ -1804,6 +1812,12 @@ s390_calculate_cc(ULong cc_op, ULong cc_dep1, ULong cc_dep2, ULong cc_ndep)
return psw >> 28; /* cc */
}

case S390_CC_OP_MUL_32:
return S390_CC_FOR_TERNARY(".insn rrf,0xb9fd0000", cc_dep1, cc_dep2);

case S390_CC_OP_MUL_64:
return S390_CC_FOR_TERNARY(".insn rrf,0xb9ed0000", cc_dep1, cc_dep2);

default:
break;
}
Expand Down
Loading

0 comments on commit 074d71b

Please sign in to comment.