Accepting request 131091 from home:burnus:branches:devel:tools

Support TZCNT/LZCNT instructions, generated by GCC 4.8, by falling back to BSF/BSR. (bnc#776211)

OBS-URL: https://build.opensuse.org/request/show/131091
OBS-URL: https://build.opensuse.org/package/show/devel:tools/valgrind?expand=0&rev=76
This commit is contained in:
Marcus Meissner 2012-08-17 14:07:19 +00:00 committed by Git OBS Bridge
parent 154ef4c159
commit 622ea2b334
3 changed files with 37 additions and 0 deletions

28
tzcnt-lzcnt-inst.diff Normal file
View File

@ -0,0 +1,28 @@
GCC 4.8 emits TZCNT (== REP; BSF), expecting that older CPUs behave
like BSF and on newer CPUs as TZCNT.
This patch makes the intrstructions known to valgrind.
Cf. https://bugs.kde.org/show_bug.cgi?id=295808
--- VEX/priv/guest_amd64_toIR.c.orig 2011-10-26 23:24:49.000000000 +0200
+++ VEX/priv/guest_amd64_toIR.c 2012-08-17 11:38:20.000000000 +0200
@@ -17946,11 +17946,17 @@ DisResult disInstr_AMD64_WRK (
/* =-=-=-=-=-=-=-=-=- BSF/BSR -=-=-=-=-=-=-=-=-=-= */
case 0xBC: /* BSF Gv,Ev */
- if (haveF2orF3(pfx)) goto decode_failure;
+ if (haveF2(pfx)) goto decode_failure;
+ /* Treat TZCNT (= F3 0F BC = REP; BSF) as BSF
+ as required for old cpus - and for new ones as
+ valgrind doesn't handle TZCNT yet. */
delta = dis_bs_E_G ( vbi, pfx, sz, delta, True );
break;
case 0xBD: /* BSR Gv,Ev */
- if (haveF2orF3(pfx)) goto decode_failure;
+ if (haveF2(pfx)) goto decode_failure;
+ /* Treat LZCNT (= F3 0F BD = REP; BSR) as BSR
+ as required for old cpus - and for new ones as
+ valgrind doesn't handle LZCNT yet. */
delta = dis_bs_E_G ( vbi, pfx, sz, delta, False );
break;

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Aug 17 09:39:39 UTC 2012 - burnus@net-b.de
- Support TZCNT/LZCNT instructions, generated by GCC 4.8,
by falling back to BSF/BSR. (bnc#776211)
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Jul 22 06:31:31 UTC 2012 - aj@suse.de Sun Jul 22 06:31:31 UTC 2012 - aj@suse.de

View File

@ -42,6 +42,8 @@ Patch1: jit-register-unregister.diff
Patch2: glibc.diff Patch2: glibc.diff
# added automake 1.11.2 patch https://bugs.kde.org/show_bug.cgi?id=290719 algrind-3.7.0-automake-1.11.2.patch # added automake 1.11.2 patch https://bugs.kde.org/show_bug.cgi?id=290719 algrind-3.7.0-automake-1.11.2.patch
Patch3: valgrind-3.7.0-automake-1.11.2.patch Patch3: valgrind-3.7.0-automake-1.11.2.patch
# added GCC 4.8 patch https://bugs.kde.org/show_bug.cgi?id=295808
Patch4: tzcnt-lzcnt-inst.diff
# during building the major version of glibc is built into the suppression file # during building the major version of glibc is built into the suppression file
%define glibc_main_version %(getconf GNU_LIBC_VERSION | cut -d' ' -f2 | cut -d. -f1) %define glibc_main_version %(getconf GNU_LIBC_VERSION | cut -d' ' -f2 | cut -d. -f1)
%define glibc_major_version %(getconf GNU_LIBC_VERSION | cut -d' ' -f2 | cut -d. -f2) %define glibc_major_version %(getconf GNU_LIBC_VERSION | cut -d' ' -f2 | cut -d. -f2)
@ -141,6 +143,7 @@ cd ..
%patch1 %patch1
%patch2 %patch2
%patch3 -p1 %patch3 -p1
%patch4
%build %build
%ifarch %arm %ifarch %arm