Bug 369439

Summary: S390x: Unhandled insns RISBLG/RISBHG and LDE/LDER
Product: [Developer tools] valgrind Reporter: Andreas Arnez <arnez>
Component: vexAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: borntraeger
Priority: NOR    
Version: 3.12 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Support LDE/LDER, and RISBHG/RISBLG
Support LDE/LDER, and RISBHG/RISBLG (v2)

Description Andreas Arnez 2016-09-27 17:57:43 UTC
An upstream GCC may emit the hex floating-point instructions LDE and LDER (for loading usual binary floating-point values), and LLVM may emit the high-word facility instructions RISBLG and RISBHG.  All of these are currently not handled by Valgrind.

Reproducible: Always
Comment 1 Andreas Arnez 2016-09-27 18:02:40 UTC
Created attachment 101320 [details]
Support LDE/LDER, and RISBHG/RISBLG

This patch adds support for the missing instructions.  In addition, it also handles MVCIN and BRCTH and updates the instruction table.
Comment 2 Christian Borntraeger 2016-09-28 12:10:15 UTC
> VEX/priv/guest_s390_toIR.c        |  150 ++++++++++
> docs/internals/s390-opcodes.csv   |  531 +++++++++++++++++++++++++++++++++++++-
> none/tests/s390x/Makefile.am      |    1 
> none/tests/s390x/bfp-2.c          |   26 +
> none/tests/s390x/bfp-2.stdout.exp |    4 
> none/tests/s390x/mvc.c            |    9 
> none/tests/s390x/mvc.stdout.exp   |    4 
> none/tests/s390x/opcodes.h        |    2 
> 8 files changed, 713 insertions(+), 14 deletions(-)

[...]
>===================================================================
>--- valgrind.orig/none/tests/s390x/Makefile.am
>+++ valgrind/none/tests/s390x/Makefile.am
>@@ -12,6 +12,7 @@ INSN_TESTS = clc clcle cvb cvd icm lpr t
>              rounding-1 rounding-2 rounding-3 rounding-4 rounding-5 bfp-1 \
>              bfp-2 bfp-3 bfp-4 srnm srnmb comp-1 comp-2 exrl tmll tm stmg \
> 	     ex clst mvc test_fork test_sig rounding-6 rxsbg popcnt \
>+	     high-word \

added to the makefile, but the high-word.c is missing
Comment 3 Andreas Arnez 2016-09-28 13:57:55 UTC
Created attachment 101330 [details]
Support LDE/LDER, and RISBHG/RISBLG (v2)

Now includes "high-word.c".
Comment 4 Christian Borntraeger 2016-10-07 07:11:16 UTC
thanks, applied as vex: r3259 valgrind  16027
Comment 5 Christian Borntraeger 2016-10-07 07:14:38 UTC
FWIW, I had to remove the static from inner and outer iter in high_word.c as gcc did not recognize the dependency with some compilers:
high-word.c:8:13: warning: ‘inner_iter’ defined but not used [-Wunused-function]
 static void inner_iter() { putchar('.'); }
             ^
high-word.c:9:13: warning: ‘outer_iter’ defined but not used [-Wunused-function]
 static void outer_iter() { putchar('+'); }
             ^