You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(10) |
2
(3) |
3
(25) |
4
(8) |
|
5
(13) |
6
(8) |
7
(9) |
8
(10) |
9
(8) |
10
(13) |
11
(12) |
|
12
|
13
(7) |
14
(8) |
15
(11) |
16
(13) |
17
(13) |
18
(11) |
|
19
(13) |
20
(7) |
21
(1) |
22
(1) |
23
(1) |
24
(8) |
25
(15) |
|
26
(16) |
27
(20) |
28
(17) |
29
(10) |
30
(2) |
|
|
|
From: Julian S. <js...@ac...> - 2011-06-15 21:42:13
|
On Saturday, June 11, 2011, Philippe Waroquiers wrote: > Hello Christian, > > > valgrind: m_libcfile.c:73 (vgPlain_safe_fd): Assertion 'newfd >= > > VG_(fd_hard_limit)' failed. > > I have added a patch with a fix and a test for the above problem > (cfr bug 214909 comment 103). > [...] Committed as r11818. Christian, the problem should be gone now. J |
|
From: <sv...@va...> - 2011-06-15 21:35:46
|
Author: sewardj
Date: 2011-06-15 22:30:55 +0100 (Wed, 15 Jun 2011)
New Revision: 11818
Log:
Fix safe_fd exhaustion in fork chain caused by non closing of shared_mem_fd
Patch that fixes the problem reported by Christian Borntraeger.
The problem was created by keeping the shared memory mapped file opened
without reason till the process does an exec.
In case of a chain of forked processes (without exec), the range of safe_fd
reserved for Valgrind own usage becomes exhausted.
* coregrind/m_gdbserver/remote-utils.c :
do not VG_(safe_fd) shared_mem_fd (as it is now closed directly)
close shared_mem_fd once file is mmap-ed and written.
* gdbserver_tests/nlfork_chain.stderr.exp,nlfork_chain.vgtest,
fork_chain.c,nlfork_chain.stdout.exp:
new files
* gdbserver_tests/Makefile.am:
modified for new nlfork_chain test
(patch from #214909 c 103,
Philippe Waroquiers, phi...@sk...)
Added:
trunk/gdbserver_tests/fork_chain.c
trunk/gdbserver_tests/nlfork_chain.stderr.exp
trunk/gdbserver_tests/nlfork_chain.stdout.exp
trunk/gdbserver_tests/nlfork_chain.vgtest
Modified:
trunk/coregrind/m_gdbserver/remote-utils.c
trunk/gdbserver_tests/Makefile.am
Modified: trunk/coregrind/m_gdbserver/remote-utils.c
===================================================================
--- trunk/coregrind/m_gdbserver/remote-utils.c 2011-06-15 19:07:26 UTC (rev 11817)
+++ trunk/coregrind/m_gdbserver/remote-utils.c 2011-06-15 21:30:55 UTC (rev 11818)
@@ -279,10 +279,6 @@
fatal("error writing %d bytes to shared mem %s\n",
(int) sizeof(VgdbShared), shared_mem);
}
- shared_mem_fd = VG_(safe_fd)(shared_mem_fd);
- if (shared_mem_fd == -1) {
- fatal("safe_fd for vgdb shared_mem %s failed\n", shared_mem);
- }
{
SysRes res = VG_(am_shared_mmap_file_float_valgrind)
(sizeof(VgdbShared), VKI_PROT_READ|VKI_PROT_WRITE,
@@ -295,6 +291,7 @@
addr_shared = sr_Res (res);
}
shared = (VgdbShared*) addr_shared;
+ VG_(close) (shared_mem_fd);
}
/* we open the read side FIFO in non blocking mode
Modified: trunk/gdbserver_tests/Makefile.am
===================================================================
--- trunk/gdbserver_tests/Makefile.am 2011-06-15 19:07:26 UTC (rev 11817)
+++ trunk/gdbserver_tests/Makefile.am 2011-06-15 21:30:55 UTC (rev 11818)
@@ -72,10 +72,14 @@
nlcontrolc.stderr.exp \
nlcontrolc.stdinB.gdb \
nlcontrolc.stdoutB.exp \
- nlcontrolc.vgtest
+ nlcontrolc.vgtest \
+ nlfork_chain.stderr.exp \
+ nlfork_chain.stdout.exp \
+ nlfork_chain.vgtest
check_PROGRAMS = \
clean_after_fork \
+ fork_chain \
sleepers \
t \
watchpoints
Added: trunk/gdbserver_tests/fork_chain.c
===================================================================
--- trunk/gdbserver_tests/fork_chain.c (rev 0)
+++ trunk/gdbserver_tests/fork_chain.c 2011-06-15 21:30:55 UTC (rev 11818)
@@ -0,0 +1,37 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/wait.h>
+void fork_chain(int level)
+{
+ int pid;
+
+ printf ("forking level %d\n", level);
+ fflush (stdout);
+ pid = fork();
+ if (pid == -1) {
+ perror("fork");
+ exit(1);
+ }
+
+ if (pid == 0) {
+ if (level > 0) {
+ fork_chain (level - 1);
+ }
+ } else {
+ int ret;
+ int status;
+ while((ret = waitpid(pid, &status, 0)) != pid) {
+ if (errno != EINTR) {
+ perror("waitpid");
+ exit(1);
+ }
+ }
+ }
+}
+int main()
+{
+ fork_chain (20);
+ return 0;
+}
Added: trunk/gdbserver_tests/nlfork_chain.stderr.exp
===================================================================
--- trunk/gdbserver_tests/nlfork_chain.stderr.exp (rev 0)
+++ trunk/gdbserver_tests/nlfork_chain.stderr.exp 2011-06-15 21:30:55 UTC (rev 11818)
@@ -0,0 +1,24 @@
+Nulgrind, the minimal Valgrind tool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Added: trunk/gdbserver_tests/nlfork_chain.stdout.exp
===================================================================
--- trunk/gdbserver_tests/nlfork_chain.stdout.exp (rev 0)
+++ trunk/gdbserver_tests/nlfork_chain.stdout.exp 2011-06-15 21:30:55 UTC (rev 11818)
@@ -0,0 +1,21 @@
+forking level 20
+forking level 19
+forking level 18
+forking level 17
+forking level 16
+forking level 15
+forking level 14
+forking level 13
+forking level 12
+forking level 11
+forking level 10
+forking level 9
+forking level 8
+forking level 7
+forking level 6
+forking level 5
+forking level 4
+forking level 3
+forking level 2
+forking level 1
+forking level 0
Added: trunk/gdbserver_tests/nlfork_chain.vgtest
===================================================================
--- trunk/gdbserver_tests/nlfork_chain.vgtest (rev 0)
+++ trunk/gdbserver_tests/nlfork_chain.vgtest 2011-06-15 21:30:55 UTC (rev 11818)
@@ -0,0 +1,4 @@
+# test that gdbserver properly cleans up its resources in a chain
+# of forked processes.
+prog: fork_chain
+vgopts: --tool=none --vgdb=yes --trace-children=yes --vgdb-prefix=./vgdb-prefix-nlfork_chain
|
|
From: Christian B. <bor...@de...> - 2011-06-15 20:27:41
|
Nightly build on fedora390 ( Fedora 13/14/15 mix with gcc 3.5.3 on z196 (s390x) )
Started at 2011-06-15 22:10:01 CEST
Ended at 2011-06-15 22:26:47 CEST
Results differ from 24 hours ago
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... failed
Regression test results follow
== 476 tests, 6 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
helgrind/tests/tc06_two_races_xml (stderr)
helgrind/tests/tc20_verifywrap (stderr)
helgrind/tests/tc23_bogus_condwait (stderr)
drd/tests/tc04_free_lock (stderr)
drd/tests/tc09_bad_unlock (stderr)
drd/tests/tc23_bogus_condwait (stderr)
=================================================
== Results from 24 hours ago ==
=================================================
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... failed
Last 20 lines of verbose log follow echo
mc_translate.c:2009:12: error: 'Iop_QNarrow16Ux4' undeclared (first use in this function)
mc_translate.c: In function 'expr2vbits_Binop':
mc_translate.c:2346:12: error: 'Iop_QNarrow32Sx2' undeclared (first use in this function)
mc_translate.c:2347:12: error: 'Iop_QNarrow16Sx4' undeclared (first use in this function)
mc_translate.c:2348:12: error: 'Iop_QNarrow16Ux4' undeclared (first use in this function)
mc_translate.c:2702:12: error: 'Iop_QNarrow32Sx4' undeclared (first use in this function)
mc_translate.c:2703:12: error: 'Iop_QNarrow32Ux4' undeclared (first use in this function)
mc_translate.c:2704:12: error: 'Iop_QNarrow16Sx8' undeclared (first use in this function)
mc_translate.c:2705:12: error: 'Iop_QNarrow16Ux8' undeclared (first use in this function)
make[3]: *** [memcheck_s390x_linux-mc_translate.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/memcheck_s390x_linux-mc_malloc_wrappers.Tpo .deps/memcheck_s390x_linux-mc_malloc_wrappers.Po
mv -f .deps/memcheck_s390x_linux-mc_leakcheck.Tpo .deps/memcheck_s390x_linux-mc_leakcheck.Po
mv -f .deps/memcheck_s390x_linux-mc_main.Tpo .deps/memcheck_s390x_linux-mc_main.Po
make[3]: Leaving directory `/home/cborntra/valgrind-nightly/valgrind-old/memcheck'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/cborntra/valgrind-nightly/valgrind-old/memcheck'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/cborntra/valgrind-nightly/valgrind-old'
make: *** [all] Error 2
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short Wed Jun 15 22:11:03 2011
--- new.short Wed Jun 15 22:26:47 2011
***************
*** 3,26 ****
Configuring valgrind ... done
! Building valgrind ... failed
- Last 20 lines of verbose log follow echo
- mc_translate.c:2009:12: error: 'Iop_QNarrow16Ux4' undeclared (first use in this function)
- mc_translate.c: In function 'expr2vbits_Binop':
- mc_translate.c:2346:12: error: 'Iop_QNarrow32Sx2' undeclared (first use in this function)
- mc_translate.c:2347:12: error: 'Iop_QNarrow16Sx4' undeclared (first use in this function)
- mc_translate.c:2348:12: error: 'Iop_QNarrow16Ux4' undeclared (first use in this function)
- mc_translate.c:2702:12: error: 'Iop_QNarrow32Sx4' undeclared (first use in this function)
- mc_translate.c:2703:12: error: 'Iop_QNarrow32Ux4' undeclared (first use in this function)
- mc_translate.c:2704:12: error: 'Iop_QNarrow16Sx8' undeclared (first use in this function)
- mc_translate.c:2705:12: error: 'Iop_QNarrow16Ux8' undeclared (first use in this function)
- make[3]: *** [memcheck_s390x_linux-mc_translate.o] Error 1
- make[3]: *** Waiting for unfinished jobs....
- mv -f .deps/memcheck_s390x_linux-mc_malloc_wrappers.Tpo .deps/memcheck_s390x_linux-mc_malloc_wrappers.Po
- mv -f .deps/memcheck_s390x_linux-mc_leakcheck.Tpo .deps/memcheck_s390x_linux-mc_leakcheck.Po
- mv -f .deps/memcheck_s390x_linux-mc_main.Tpo .deps/memcheck_s390x_linux-mc_main.Po
- make[3]: Leaving directory `/home/cborntra/valgrind-nightly/valgrind-old/memcheck'
- make[2]: *** [all-recursive] Error 1
- make[2]: Leaving directory `/home/cborntra/valgrind-nightly/valgrind-old/memcheck'
- make[1]: *** [all-recursive] Error 1
- make[1]: Leaving directory `/home/cborntra/valgrind-nightly/valgrind-old'
- make: *** [all] Error 2
--- 3,16 ----
Configuring valgrind ... done
! Building valgrind ... done
! Running regression tests ... failed
!
! Regression test results follow
!
! == 476 tests, 6 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
! helgrind/tests/tc06_two_races_xml (stderr)
! helgrind/tests/tc20_verifywrap (stderr)
! helgrind/tests/tc23_bogus_condwait (stderr)
! drd/tests/tc04_free_lock (stderr)
! drd/tests/tc09_bad_unlock (stderr)
! drd/tests/tc23_bogus_condwait (stderr)
|
|
From: Christian B. <bor...@de...> - 2011-06-15 20:24:40
|
Nightly build on sless390 ( SUSE Linux Enterprise Server 11 SP1 gcc 4.3.4 on z196 (s390x) )
Started at 2011-06-15 22:10:01 CEST
Ended at 2011-06-15 22:24:21 CEST
Results differ from 24 hours ago
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... failed
Regression test results follow
== 476 tests, 6 stderr failures, 0 stdout failures, 3 stderrB failures, 0 stdoutB failures, 0 post failures ==
gdbserver_tests/mcbreak (stderrB)
gdbserver_tests/mcclean_after_fork (stderrB)
gdbserver_tests/mssnapshot (stderrB)
none/tests/faultstatus (stderr)
helgrind/tests/tc06_two_races_xml (stderr)
helgrind/tests/tc23_bogus_condwait (stderr)
drd/tests/tc04_free_lock (stderr)
drd/tests/tc09_bad_unlock (stderr)
drd/tests/tc23_bogus_condwait (stderr)
=================================================
== Results from 24 hours ago ==
=================================================
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... failed
Last 20 lines of verbose log follow echo
mc_translate.c:2347: error: 'Iop_QNarrow16Sx4' undeclared (first use in this function)
mc_translate.c:2348: error: 'Iop_QNarrow16Ux4' undeclared (first use in this function)
mc_translate.c:2702: error: 'Iop_QNarrow32Sx4' undeclared (first use in this function)
mc_translate.c:2703: error: 'Iop_QNarrow32Ux4' undeclared (first use in this function)
mc_translate.c:2704: error: 'Iop_QNarrow16Sx8' undeclared (first use in this function)
mc_translate.c:2705: error: 'Iop_QNarrow16Ux8' undeclared (first use in this function)
mv -f .deps/memcheck_s390x_linux-mc_machine.Tpo .deps/memcheck_s390x_linux-mc_machine.Po
make[3]: *** [memcheck_s390x_linux-mc_translate.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/memcheck_s390x_linux-mc_malloc_wrappers.Tpo .deps/memcheck_s390x_linux-mc_malloc_wrappers.Po
mv -f .deps/memcheck_s390x_linux-mc_leakcheck.Tpo .deps/memcheck_s390x_linux-mc_leakcheck.Po
mv -f .deps/memcheck_s390x_linux-mc_errors.Tpo .deps/memcheck_s390x_linux-mc_errors.Po
mv -f .deps/vgpreload_memcheck_s390x_linux_so-mc_replace_strmem.Tpo .deps/vgpreload_memcheck_s390x_linux_so-mc_replace_strmem.Po
mv -f .deps/memcheck_s390x_linux-mc_main.Tpo .deps/memcheck_s390x_linux-mc_main.Po
make[3]: Leaving directory `/home0/cborntra/valgrind-nightly/valgrind-old/memcheck'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home0/cborntra/valgrind-nightly/valgrind-old/memcheck'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home0/cborntra/valgrind-nightly/valgrind-old'
make: *** [all] Error 2
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short Wed Jun 15 22:11:02 2011
--- new.short Wed Jun 15 22:24:21 2011
***************
*** 3,26 ****
Configuring valgrind ... done
! Building valgrind ... failed
- Last 20 lines of verbose log follow echo
- mc_translate.c:2347: error: 'Iop_QNarrow16Sx4' undeclared (first use in this function)
- mc_translate.c:2348: error: 'Iop_QNarrow16Ux4' undeclared (first use in this function)
- mc_translate.c:2702: error: 'Iop_QNarrow32Sx4' undeclared (first use in this function)
- mc_translate.c:2703: error: 'Iop_QNarrow32Ux4' undeclared (first use in this function)
- mc_translate.c:2704: error: 'Iop_QNarrow16Sx8' undeclared (first use in this function)
- mc_translate.c:2705: error: 'Iop_QNarrow16Ux8' undeclared (first use in this function)
- mv -f .deps/memcheck_s390x_linux-mc_machine.Tpo .deps/memcheck_s390x_linux-mc_machine.Po
- make[3]: *** [memcheck_s390x_linux-mc_translate.o] Error 1
- make[3]: *** Waiting for unfinished jobs....
- mv -f .deps/memcheck_s390x_linux-mc_malloc_wrappers.Tpo .deps/memcheck_s390x_linux-mc_malloc_wrappers.Po
- mv -f .deps/memcheck_s390x_linux-mc_leakcheck.Tpo .deps/memcheck_s390x_linux-mc_leakcheck.Po
- mv -f .deps/memcheck_s390x_linux-mc_errors.Tpo .deps/memcheck_s390x_linux-mc_errors.Po
- mv -f .deps/vgpreload_memcheck_s390x_linux_so-mc_replace_strmem.Tpo .deps/vgpreload_memcheck_s390x_linux_so-mc_replace_strmem.Po
- mv -f .deps/memcheck_s390x_linux-mc_main.Tpo .deps/memcheck_s390x_linux-mc_main.Po
- make[3]: Leaving directory `/home0/cborntra/valgrind-nightly/valgrind-old/memcheck'
- make[2]: *** [all-recursive] Error 1
- make[2]: Leaving directory `/home0/cborntra/valgrind-nightly/valgrind-old/memcheck'
- make[1]: *** [all-recursive] Error 1
- make[1]: Leaving directory `/home0/cborntra/valgrind-nightly/valgrind-old'
- make: *** [all] Error 2
--- 3,19 ----
Configuring valgrind ... done
! Building valgrind ... done
! Running regression tests ... failed
!
! Regression test results follow
!
! == 476 tests, 6 stderr failures, 0 stdout failures, 3 stderrB failures, 0 stdoutB failures, 0 post failures ==
! gdbserver_tests/mcbreak (stderrB)
! gdbserver_tests/mcclean_after_fork (stderrB)
! gdbserver_tests/mssnapshot (stderrB)
! none/tests/faultstatus (stderr)
! helgrind/tests/tc06_two_races_xml (stderr)
! helgrind/tests/tc23_bogus_condwait (stderr)
! drd/tests/tc04_free_lock (stderr)
! drd/tests/tc09_bad_unlock (stderr)
! drd/tests/tc23_bogus_condwait (stderr)
|
|
From: <sv...@va...> - 2011-06-15 19:12:16
|
Author: sewardj
Date: 2011-06-15 20:07:26 +0100 (Wed, 15 Jun 2011)
New Revision: 11817
Log:
Unbreak Altivec code following vex r2159 (renaming of
vector saturating narrowing primops)
Modified:
trunk/memcheck/mc_translate.c
Modified: trunk/memcheck/mc_translate.c
===================================================================
--- trunk/memcheck/mc_translate.c 2011-06-15 16:07:15 UTC (rev 11816)
+++ trunk/memcheck/mc_translate.c 2011-06-15 19:07:26 UTC (rev 11817)
@@ -1991,6 +1991,7 @@
case Iop_QNarrow32Uto16Ux8: pcast = mkPCast32x4; break;
case Iop_QNarrow32Sto16Ux8: pcast = mkPCast32x4; break;
case Iop_QNarrow16Sto8Sx16: pcast = mkPCast16x8; break;
+ case Iop_QNarrow16Uto8Ux16: pcast = mkPCast16x8; break;
case Iop_QNarrow16Sto8Ux16: pcast = mkPCast16x8; break;
default: VG_(tool_panic)("vectorNarrowV128");
}
@@ -2708,6 +2709,7 @@
case Iop_QNarrow32Uto16Ux8:
case Iop_QNarrow32Sto16Ux8:
case Iop_QNarrow16Sto8Sx16:
+ case Iop_QNarrow16Uto8Ux16:
case Iop_QNarrow16Sto8Ux16:
return vectorNarrowV128(mce, op, vatom1, vatom2);
|
|
From: <sv...@va...> - 2011-06-15 19:11:27
|
Author: sewardj
Date: 2011-06-15 20:06:36 +0100 (Wed, 15 Jun 2011)
New Revision: 2161
Log:
Unbreak Altivec support following r2159 (rename of saturating
narrowing primops)
Modified:
trunk/priv/ir_defs.c
Modified: trunk/priv/ir_defs.c
===================================================================
--- trunk/priv/ir_defs.c 2011-06-15 16:05:07 UTC (rev 2160)
+++ trunk/priv/ir_defs.c 2011-06-15 19:06:36 UTC (rev 2161)
@@ -846,6 +846,7 @@
case Iop_Narrow16x8: vex_printf("Narrow16x8"); return;
case Iop_Narrow32x4: vex_printf("Narrow32x4"); return;
+ case Iop_QNarrow16Uto8Ux16: vex_printf("QNarrow16Uto8Ux16"); return;
case Iop_QNarrow32Sto16Ux8: vex_printf("QNarrow32Sto16Ux8"); return;
case Iop_QNarrow16Sto8Ux16: vex_printf("QNarrow16Sto8Ux16"); return;
case Iop_QNarrow32Uto16Ux8: vex_printf("QNarrow32Uto16Ux8"); return;
@@ -2421,7 +2422,7 @@
case Iop_Rol8x16: case Iop_Rol16x8: case Iop_Rol32x4:
case Iop_QNarrow16Sto8Ux16: case Iop_QNarrow32Sto16Ux8:
case Iop_QNarrow16Sto8Sx16: case Iop_QNarrow32Sto16Sx8:
- case Iop_QNarrow32Uto16Ux8:
+ case Iop_QNarrow16Uto8Ux16: case Iop_QNarrow32Uto16Ux8:
case Iop_Narrow16x8: case Iop_Narrow32x4:
case Iop_InterleaveHI8x16: case Iop_InterleaveHI16x8:
case Iop_InterleaveHI32x4: case Iop_InterleaveHI64x2:
|
|
From: <sv...@va...> - 2011-06-15 16:12:08
|
Author: sewardj
Date: 2011-06-15 17:07:15 +0100 (Wed, 15 Jun 2011)
New Revision: 11816
Log:
Valgrind-side fixes and tests for PACKUSDW, to track r2160.
Modified:
trunk/memcheck/mc_translate.c
trunk/none/tests/amd64/sse4-64.c
trunk/none/tests/amd64/sse4-64.stdout.exp
Modified: trunk/memcheck/mc_translate.c
===================================================================
--- trunk/memcheck/mc_translate.c 2011-06-15 15:11:50 UTC (rev 11815)
+++ trunk/memcheck/mc_translate.c 2011-06-15 16:07:15 UTC (rev 11816)
@@ -1989,6 +1989,7 @@
switch (narrow_op) {
case Iop_QNarrow32Sto16Sx8: pcast = mkPCast32x4; break;
case Iop_QNarrow32Uto16Ux8: pcast = mkPCast32x4; break;
+ case Iop_QNarrow32Sto16Ux8: pcast = mkPCast32x4; break;
case Iop_QNarrow16Sto8Sx16: pcast = mkPCast16x8; break;
case Iop_QNarrow16Sto8Ux16: pcast = mkPCast16x8; break;
default: VG_(tool_panic)("vectorNarrowV128");
@@ -2705,6 +2706,7 @@
case Iop_QNarrow32Sto16Sx8:
case Iop_QNarrow32Uto16Ux8:
+ case Iop_QNarrow32Sto16Ux8:
case Iop_QNarrow16Sto8Sx16:
case Iop_QNarrow16Sto8Ux16:
return vectorNarrowV128(mce, op, vatom1, vatom2);
Modified: trunk/none/tests/amd64/sse4-64.c
===================================================================
--- trunk/none/tests/amd64/sse4-64.c 2011-06-15 15:11:50 UTC (rev 11815)
+++ trunk/none/tests/amd64/sse4-64.c 2011-06-15 16:07:15 UTC (rev 11816)
@@ -3791,7 +3791,6 @@
test_INSERTPS(); // done Apr.01.2010
// MOVNTDQA ***
//test_MPSADBW();
- //test_PACKUSDW();
//test_PCMPEQQ();
test_PEXTRB(); // done Apr.15.2010
test_PEXTRD(); // done Apr.14.2010
@@ -3839,11 +3838,11 @@
// ------ SSE 4.2 ------
test_PCMPGTQ();
// CRC32B,Q
+ test_PACKUSDW();
#else
#if 0
test_MPSADBW();
- test_PACKUSDW();
test_PCMPEQQ();
test_PHMINPOSUW();
test_PMULDQ();
Modified: trunk/none/tests/amd64/sse4-64.stdout.exp
===================================================================
--- trunk/none/tests/amd64/sse4-64.stdout.exp 2011-06-15 15:11:50 UTC (rev 11815)
+++ trunk/none/tests/amd64/sse4-64.stdout.exp 2011-06-15 16:07:15 UTC (rev 11816)
@@ -4704,3 +4704,23 @@
m pcmpgtq ffffffffffffffff0000000000000000 fffffffffffffffe0000000000000001 0000000000000000ffffffffffffffff
r pcmpgtq ffffffffffffffff0000000000000000 ffffffffffffffff0000000000000000 00000000000000000000000000000000
m pcmpgtq ffffffffffffffff0000000000000000 ffffffffffffffff0000000000000000 00000000000000000000000000000000
+r packusdw 53bb728e020c15a5c22982db4a24e5a7 d9ae1386622d3d7a2db15a13bf7970b0 ffffffff0000ffff0000ffffffff0000
+m packusdw 53bb728e020c15a5c22982db4a24e5a7 d9ae1386622d3d7a2db15a13bf7970b0 ffffffff0000ffff0000ffffffff0000
+r packusdw a1bcb4ea56fa55737eac60eb8aded33c c43f261642363414e2c3f191206475a2 0000ffffffff00000000ffff0000ffff
+m packusdw a1bcb4ea56fa55737eac60eb8aded33c c43f261642363414e2c3f191206475a2 0000ffffffff00000000ffff0000ffff
+r packusdw 3ef118c86a00924363014f93d37d9f97 eceb191ff1dc0745eece99ded8fa7731 ffffffffffff00000000000000000000
+m packusdw 3ef118c86a00924363014f93d37d9f97 eceb191ff1dc0745eece99ded8fa7731 ffffffffffff00000000000000000000
+r packusdw 88a79996daaa09c04df3cdbf420d06e5 aefee70d0aabf1ba2d9ccce404463289 00000000ffffffff0000ffffffffffff
+m packusdw 88a79996daaa09c04df3cdbf420d06e5 aefee70d0aabf1ba2d9ccce404463289 00000000ffffffff0000ffffffffffff
+r packusdw d92a33bf4382f6971850565bf298c352 66c48c4b2a302f1e7bfa0890c05462d6 0000ffffffff0000ffffffffffff0000
+m packusdw d92a33bf4382f6971850565bf298c352 66c48c4b2a302f1e7bfa0890c05462d6 0000ffffffff0000ffffffffffff0000
+r packusdw 8fc5e2af41169474a0e26453002c9409 70880548ecf6fd1eb4b3c8cf2731c242 0000ffff0000ffffffff00000000ffff
+m packusdw 8fc5e2af41169474a0e26453002c9409 70880548ecf6fd1eb4b3c8cf2731c242 0000ffff0000ffffffff00000000ffff
+r packusdw 04c6a3d26ff12002c176759387d43337 28984c6ded8a9666b495898c55e80ffc ffffffff00000000ffff00000000ffff
+m packusdw 04c6a3d26ff12002c176759387d43337 28984c6ded8a9666b495898c55e80ffc ffffffff00000000ffff00000000ffff
+r packusdw 9677719469a0d6ee57d80407a49d5d07 ea3e5f27c87637a1566ac5b36785042e 0000ffffffff000000000000ffffffff
+m packusdw 9677719469a0d6ee57d80407a49d5d07 ea3e5f27c87637a1566ac5b36785042e 0000ffffffff000000000000ffffffff
+r packusdw 9f264862ccaef2e43ed48d9c7292cda6 11c739e219481c7c7800fa3079155f05 00000000ffffffffffffffffffffffff
+m packusdw 9f264862ccaef2e43ed48d9c7292cda6 11c739e219481c7c7800fa3079155f05 00000000ffffffffffffffffffffffff
+r packusdw 00008877000066550000443300002211 0000b2a10000ffee0000ddcc0000bbaa 8877665544332211b2a1ffeeddccbbaa
+m packusdw 00008877000066550000443300002211 0000b2a10000ffee0000ddcc0000bbaa 8877665544332211b2a1ffeeddccbbaa
|
|
From: <sv...@va...> - 2011-06-15 16:09:58
|
Author: sewardj
Date: 2011-06-15 17:05:07 +0100 (Wed, 15 Jun 2011)
New Revision: 2160
Log:
Implement PACKUSDW (SSE4.1). Fixes #274776.
Modified:
trunk/priv/guest_amd64_toIR.c
trunk/priv/host_amd64_isel.c
trunk/priv/host_generic_simd128.c
trunk/priv/host_generic_simd128.h
trunk/priv/ir_defs.c
trunk/pub/libvex_ir.h
Modified: trunk/priv/guest_amd64_toIR.c
===================================================================
--- trunk/priv/guest_amd64_toIR.c 2011-06-15 15:09:37 UTC (rev 2159)
+++ trunk/priv/guest_amd64_toIR.c 2011-06-15 16:05:07 UTC (rev 2160)
@@ -15999,6 +15999,40 @@
goto decode_success;
}
+ /* 66 0f 38 2B /r = PACKUSDW xmm1, xmm2/m128
+ 2x 32x4 S->U saturating narrow from xmm2/m128 to xmm1 */
+ if ( have66noF2noF3( pfx )
+ && sz == 2
+ && insn[0] == 0x0F && insn[1] == 0x38 && insn[2] == 0x2B ) {
+
+ modrm = insn[3];
+
+ IRTemp argL = newTemp(Ity_V128);
+ IRTemp argR = newTemp(Ity_V128);
+
+ if ( epartIsReg(modrm) ) {
+ assign( argL, getXMMReg( eregOfRexRM(pfx, modrm) ) );
+ delta += 3+1;
+ DIP( "packusdw %s,%s\n",
+ nameXMMReg( eregOfRexRM(pfx, modrm) ),
+ nameXMMReg( gregOfRexRM(pfx, modrm) ) );
+ } else {
+ addr = disAMode( &alen, vbi, pfx, delta+3, dis_buf, 0 );
+ gen_SEGV_if_not_16_aligned( addr );
+ assign( argL, loadLE( Ity_V128, mkexpr(addr) ));
+ delta += 3+alen;
+ DIP( "packusdw %s,%s\n",
+ dis_buf, nameXMMReg( gregOfRexRM(pfx, modrm) ) );
+ }
+
+ assign(argR, getXMMReg( gregOfRexRM(pfx, modrm) ));
+
+ putXMMReg( gregOfRexRM(pfx, modrm),
+ binop( Iop_QNarrow32Sto16Ux8, mkexpr(argL), mkexpr(argR)) );
+
+ goto decode_success;
+ }
+
/* ---------------------------------------------------- */
/* --- end of the SSE4 decoder --- */
/* ---------------------------------------------------- */
Modified: trunk/priv/host_amd64_isel.c
===================================================================
--- trunk/priv/host_amd64_isel.c 2011-06-15 15:09:37 UTC (rev 2159)
+++ trunk/priv/host_amd64_isel.c 2011-06-15 16:05:07 UTC (rev 2160)
@@ -3660,6 +3660,9 @@
goto do_SseAssistedBinary;
case Iop_CmpGT64Sx2: fn = (HWord)h_generic_calc_CmpGT64Sx2;
goto do_SseAssistedBinary;
+ case Iop_QNarrow32Sto16Ux8:
+ fn = (HWord)h_generic_calc_QNarrow32Sto16Ux8;
+ goto do_SseAssistedBinary;
do_SseAssistedBinary: {
/* RRRufff! RRRufff code is what we're generating here. Oh
well. */
Modified: trunk/priv/host_generic_simd128.c
===================================================================
--- trunk/priv/host_generic_simd128.c 2011-06-15 15:09:37 UTC (rev 2159)
+++ trunk/priv/host_generic_simd128.c 2011-06-15 16:05:07 UTC (rev 2160)
@@ -104,6 +104,14 @@
return toUChar(((Char)v) >> n);
}
+static inline UShort qnarrow32Sto16U ( UInt xx0 )
+{
+ Int xx = (Int)xx0;
+ if (xx < 0) xx = 0;
+ if (xx > 65535) xx = 65535;
+ return (UShort)xx;
+}
+
void h_generic_calc_Mul32x4 ( /*OUT*/V128* res,
V128* argL, V128* argR )
{
@@ -263,6 +271,20 @@
res->w8[15] = sar8(argL->w8[15], nn);
}
+void h_generic_calc_QNarrow32Sto16Ux8 ( /*OUT*/V128* res,
+ V128* argL, V128* argR )
+{
+ res->w16[0] = qnarrow32Sto16U(argR->w32[0]);
+ res->w16[1] = qnarrow32Sto16U(argR->w32[1]);
+ res->w16[2] = qnarrow32Sto16U(argR->w32[2]);
+ res->w16[3] = qnarrow32Sto16U(argR->w32[3]);
+ res->w16[4] = qnarrow32Sto16U(argL->w32[0]);
+ res->w16[5] = qnarrow32Sto16U(argL->w32[1]);
+ res->w16[6] = qnarrow32Sto16U(argL->w32[2]);
+ res->w16[7] = qnarrow32Sto16U(argL->w32[3]);
+}
+
+
/*---------------------------------------------------------------*/
/*--- end host_generic_simd128.c ---*/
/*---------------------------------------------------------------*/
Modified: trunk/priv/host_generic_simd128.h
===================================================================
--- trunk/priv/host_generic_simd128.h 2011-06-15 15:09:37 UTC (rev 2159)
+++ trunk/priv/host_generic_simd128.h 2011-06-15 16:05:07 UTC (rev 2160)
@@ -61,7 +61,10 @@
extern void h_generic_calc_SarN64x2 ( /*OUT*/V128*, V128*, UInt );
extern void h_generic_calc_SarN8x16 ( /*OUT*/V128*, V128*, UInt );
+extern void h_generic_calc_QNarrow32Sto16Ux8
+ ( /*OUT*/V128*, V128*, V128* );
+
#endif /* ndef __VEX_HOST_GENERIC_SIMD128_H */
/*---------------------------------------------------------------*/
Modified: trunk/priv/ir_defs.c
===================================================================
--- trunk/priv/ir_defs.c 2011-06-15 15:09:37 UTC (rev 2159)
+++ trunk/priv/ir_defs.c 2011-06-15 16:05:07 UTC (rev 2160)
@@ -846,6 +846,7 @@
case Iop_Narrow16x8: vex_printf("Narrow16x8"); return;
case Iop_Narrow32x4: vex_printf("Narrow32x4"); return;
+ case Iop_QNarrow32Sto16Ux8: vex_printf("QNarrow32Sto16Ux8"); return;
case Iop_QNarrow16Sto8Ux16: vex_printf("QNarrow16Sto8Ux16"); return;
case Iop_QNarrow32Uto16Ux8: vex_printf("QNarrow32Uto16Ux8"); return;
case Iop_QNarrow16Sto8Sx16: vex_printf("QNarrow16Sto8Sx16"); return;
@@ -2418,7 +2419,7 @@
case Iop_Sar8x16: case Iop_Sar16x8: case Iop_Sar32x4: case Iop_Sar64x2:
case Iop_Sal8x16: case Iop_Sal16x8: case Iop_Sal32x4: case Iop_Sal64x2:
case Iop_Rol8x16: case Iop_Rol16x8: case Iop_Rol32x4:
- case Iop_QNarrow16Sto8Ux16:
+ case Iop_QNarrow16Sto8Ux16: case Iop_QNarrow32Sto16Ux8:
case Iop_QNarrow16Sto8Sx16: case Iop_QNarrow32Sto16Sx8:
case Iop_QNarrow32Uto16Ux8:
case Iop_Narrow16x8: case Iop_Narrow32x4:
Modified: trunk/pub/libvex_ir.h
===================================================================
--- trunk/pub/libvex_ir.h 2011-06-15 15:09:37 UTC (rev 2159)
+++ trunk/pub/libvex_ir.h 2011-06-15 16:05:07 UTC (rev 2160)
@@ -1195,7 +1195,7 @@
/* NARROWING -- narrow 2xV128 into 1xV128, hi half from left arg */
/* See comments above w.r.t. U vs S issues in saturated narrowing. */
- Iop_QNarrow16Sto8Ux16,
+ Iop_QNarrow16Sto8Ux16, Iop_QNarrow32Sto16Ux8,
Iop_QNarrow16Sto8Sx16, Iop_QNarrow32Sto16Sx8,
Iop_QNarrow16Uto8Ux16, Iop_QNarrow32Uto16Ux8,
Iop_Narrow16x8, Iop_Narrow32x4,
|
|
From: <sv...@va...> - 2011-06-15 15:16:41
|
Author: sewardj
Date: 2011-06-15 16:11:50 +0100 (Wed, 15 Jun 2011)
New Revision: 11815
Log:
Add debugging hack, if 0'd, to print a stack trace at each syscall.
Modified:
trunk/coregrind/m_syswrap/syswrap-main.c
Modified: trunk/coregrind/m_syswrap/syswrap-main.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-main.c 2011-06-15 15:11:07 UTC (rev 11814)
+++ trunk/coregrind/m_syswrap/syswrap-main.c 2011-06-15 15:11:50 UTC (rev 11815)
@@ -1429,6 +1429,13 @@
is interrupted by a signal. */
sysno = sci->orig_args.sysno;
+ /* It's sometimes useful, as a crude debugging hack, to get a
+ stack trace at each (or selected) syscalls. */
+ if (0 /* sysno == __NR_mmap */) {
+ VG_(umsg)("\n");
+ VG_(get_and_pp_StackTrace)(tid, 10);
+ }
+
# if defined(VGO_darwin)
/* Record syscall class. But why? Because the syscall might be
interrupted by a signal, and in the signal handler (which will
|
|
From: <sv...@va...> - 2011-06-15 15:15:57
|
Author: sewardj
Date: 2011-06-15 16:11:07 +0100 (Wed, 15 Jun 2011)
New Revision: 11814
Log:
Track renaming of vector saturating narrowing primops in r2159.
Modified:
trunk/memcheck/mc_translate.c
Modified: trunk/memcheck/mc_translate.c
===================================================================
--- trunk/memcheck/mc_translate.c 2011-06-13 13:36:59 UTC (rev 11813)
+++ trunk/memcheck/mc_translate.c 2011-06-15 15:11:07 UTC (rev 11814)
@@ -1975,6 +1975,10 @@
So: In short, pessimise the args, then apply the original narrowing
op.
+
+ FIXME JRS 2011-Jun-15: figure out if this is still correct
+ following today's rationalisation/cleanup of vector narrowing
+ primops.
*/
static
IRAtom* vectorNarrowV128 ( MCEnv* mce, IROp narrow_op,
@@ -1983,10 +1987,10 @@
IRAtom *at1, *at2, *at3;
IRAtom* (*pcast)( MCEnv*, IRAtom* );
switch (narrow_op) {
- case Iop_QNarrow32Sx4: pcast = mkPCast32x4; break;
- case Iop_QNarrow32Ux4: pcast = mkPCast32x4; break;
- case Iop_QNarrow16Sx8: pcast = mkPCast16x8; break;
- case Iop_QNarrow16Ux8: pcast = mkPCast16x8; break;
+ case Iop_QNarrow32Sto16Sx8: pcast = mkPCast32x4; break;
+ case Iop_QNarrow32Uto16Ux8: pcast = mkPCast32x4; break;
+ case Iop_QNarrow16Sto8Sx16: pcast = mkPCast16x8; break;
+ case Iop_QNarrow16Sto8Ux16: pcast = mkPCast16x8; break;
default: VG_(tool_panic)("vectorNarrowV128");
}
tl_assert(isShadowAtom(mce,vatom1));
@@ -2004,9 +2008,9 @@
IRAtom *at1, *at2, *at3;
IRAtom* (*pcast)( MCEnv*, IRAtom* );
switch (narrow_op) {
- case Iop_QNarrow32Sx2: pcast = mkPCast32x2; break;
- case Iop_QNarrow16Sx4: pcast = mkPCast16x4; break;
- case Iop_QNarrow16Ux4: pcast = mkPCast16x4; break;
+ case Iop_QNarrow32Sto16Sx4: pcast = mkPCast32x2; break;
+ case Iop_QNarrow16Sto8Sx8: pcast = mkPCast16x4; break;
+ case Iop_QNarrow16Sto8Ux8: pcast = mkPCast16x4; break;
default: VG_(tool_panic)("vectorNarrow64");
}
tl_assert(isShadowAtom(mce,vatom1));
@@ -2343,9 +2347,9 @@
complainIfUndefined(mce, atom2);
return assignNew('V', mce, Ity_I64, binop(op, vatom1, atom2));
- case Iop_QNarrow32Sx2:
- case Iop_QNarrow16Sx4:
- case Iop_QNarrow16Ux4:
+ case Iop_QNarrow32Sto16Sx4:
+ case Iop_QNarrow16Sto8Sx8:
+ case Iop_QNarrow16Sto8Ux8:
return vectorNarrow64(mce, op, vatom1, vatom2);
case Iop_Min8Ux8:
@@ -2699,10 +2703,10 @@
case Iop_QSub64Sx2:
return binary64Ix2(mce, vatom1, vatom2);
- case Iop_QNarrow32Sx4:
- case Iop_QNarrow32Ux4:
- case Iop_QNarrow16Sx8:
- case Iop_QNarrow16Ux8:
+ case Iop_QNarrow32Sto16Sx8:
+ case Iop_QNarrow32Uto16Ux8:
+ case Iop_QNarrow16Sto8Sx16:
+ case Iop_QNarrow16Sto8Ux16:
return vectorNarrowV128(mce, op, vatom1, vatom2);
case Iop_Sub64Fx2:
|
|
From: <sv...@va...> - 2011-06-15 15:14:28
|
Author: sewardj
Date: 2011-06-15 16:09:37 +0100 (Wed, 15 Jun 2011)
New Revision: 2159
Log:
Partially fix underspecification of saturating narrowing primops that
became apparent whilst looking into the problem of implementing the
SSE4 packusdw instruction. Probably breaks Altivec.
Modified:
trunk/priv/guest_amd64_toIR.c
trunk/priv/guest_ppc_toIR.c
trunk/priv/guest_x86_toIR.c
trunk/priv/host_amd64_isel.c
trunk/priv/host_generic_simd64.c
trunk/priv/host_generic_simd64.h
trunk/priv/host_ppc_isel.c
trunk/priv/host_x86_isel.c
trunk/priv/ir_defs.c
trunk/pub/libvex_ir.h
trunk/test_main.c
Modified: trunk/priv/guest_amd64_toIR.c
===================================================================
--- trunk/priv/guest_amd64_toIR.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/guest_amd64_toIR.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -6504,9 +6504,9 @@
case 0x65: op = Iop_CmpGT16Sx4; break;
case 0x66: op = Iop_CmpGT32Sx2; break;
- case 0x6B: op = Iop_QNarrow32Sx2; eLeft = True; break;
- case 0x63: op = Iop_QNarrow16Sx4; eLeft = True; break;
- case 0x67: op = Iop_QNarrow16Ux4; eLeft = True; break;
+ case 0x6B: op = Iop_QNarrow32Sto16Sx4; eLeft = True; break;
+ case 0x63: op = Iop_QNarrow16Sto8Sx8; eLeft = True; break;
+ case 0x67: op = Iop_QNarrow16Sto8Ux8; eLeft = True; break;
case 0x68: op = Iop_InterleaveHI8x8; eLeft = True; break;
case 0x69: op = Iop_InterleaveHI16x4; eLeft = True; break;
@@ -11786,7 +11786,8 @@
if (have66noF2noF3(pfx) && sz == 2
&& insn[0] == 0x0F && insn[1] == 0x6B) {
delta = dis_SSEint_E_to_G( vbi, pfx, delta+2,
- "packssdw", Iop_QNarrow32Sx4, True );
+ "packssdw",
+ Iop_QNarrow32Sto16Sx8, True );
goto decode_success;
}
@@ -11794,7 +11795,8 @@
if (have66noF2noF3(pfx) && sz == 2
&& insn[0] == 0x0F && insn[1] == 0x63) {
delta = dis_SSEint_E_to_G( vbi, pfx, delta+2,
- "packsswb", Iop_QNarrow16Sx8, True );
+ "packsswb",
+ Iop_QNarrow16Sto8Sx16, True );
goto decode_success;
}
@@ -11802,7 +11804,8 @@
if (have66noF2noF3(pfx) && sz == 2
&& insn[0] == 0x0F && insn[1] == 0x67) {
delta = dis_SSEint_E_to_G( vbi, pfx, delta+2,
- "packuswb", Iop_QNarrow16Ux8, True );
+ "packuswb",
+ Iop_QNarrow16Sto8Ux16, True );
goto decode_success;
}
Modified: trunk/priv/guest_ppc_toIR.c
===================================================================
--- trunk/priv/guest_ppc_toIR.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/guest_ppc_toIR.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -9418,7 +9418,7 @@
mkU8(15))) );
putVReg( vD_addr,
- binop(Iop_QNarrow32Sx4, mkexpr(zHi), mkexpr(zLo)) );
+ binop(Iop_QNarrow32Sto16Sx8, mkexpr(zHi), mkexpr(zLo)) );
break;
}
case 0x21: { // vmhraddshs (Mult High Round, Add Signed HW Saturate, AV p186)
@@ -9452,7 +9452,8 @@
mkexpr(aHi), mkexpr(bHi))),
mkU8(15))) );
- putVReg( vD_addr, binop(Iop_QNarrow32Sx4, mkexpr(zHi), mkexpr(zLo)) );
+ putVReg( vD_addr,
+ binop(Iop_QNarrow32Sto16Sx8, mkexpr(zHi), mkexpr(zLo)) );
break;
}
case 0x22: { // vmladduhm (Mult Low, Add Unsigned HW Modulo, AV p194)
@@ -9965,14 +9966,14 @@
case 0x08E: // vpkuhus (Pack Unsigned HW Unsigned Saturate, AV p225)
DIP("vpkuhus v%d,v%d,v%d\n", vD_addr, vA_addr, vB_addr);
putVReg( vD_addr,
- binop(Iop_QNarrow16Ux8, mkexpr(vA), mkexpr(vB)) );
+ binop(Iop_QNarrow16Uto8Ux16, mkexpr(vA), mkexpr(vB)) );
// TODO: set VSCR[SAT]
return True;
case 0x0CE: // vpkuwus (Pack Unsigned W Unsigned Saturate, AV p227)
DIP("vpkuwus v%d,v%d,v%d\n", vD_addr, vA_addr, vB_addr);
putVReg( vD_addr,
- binop(Iop_QNarrow32Ux4, mkexpr(vA), mkexpr(vB)) );
+ binop(Iop_QNarrow32Uto16Ux8, mkexpr(vA), mkexpr(vB)) );
// TODO: set VSCR[SAT]
return True;
@@ -9991,7 +9992,7 @@
unop(Iop_NotV128,
binop(Iop_SarN16x8,
mkexpr(vB), mkU8(15)))) );
- putVReg( vD_addr, binop(Iop_QNarrow16Ux8,
+ putVReg( vD_addr, binop(Iop_QNarrow16Uto8Ux16,
mkexpr(vA_tmp), mkexpr(vB_tmp)) );
// TODO: set VSCR[SAT]
return True;
@@ -10011,7 +10012,7 @@
unop(Iop_NotV128,
binop(Iop_SarN32x4,
mkexpr(vB), mkU8(31)))) );
- putVReg( vD_addr, binop(Iop_QNarrow32Ux4,
+ putVReg( vD_addr, binop(Iop_QNarrow32Uto16Ux8,
mkexpr(vA_tmp), mkexpr(vB_tmp)) );
// TODO: set VSCR[SAT]
return True;
@@ -10019,14 +10020,14 @@
case 0x18E: // vpkshss (Pack Signed HW Signed Saturate, AV p220)
DIP("vpkshss v%d,v%d,v%d\n", vD_addr, vA_addr, vB_addr);
putVReg( vD_addr,
- binop(Iop_QNarrow16Sx8, mkexpr(vA), mkexpr(vB)) );
+ binop(Iop_QNarrow16Sto8Sx16, mkexpr(vA), mkexpr(vB)) );
// TODO: set VSCR[SAT]
return True;
case 0x1CE: // vpkswss (Pack Signed W Signed Saturate, AV p222)
DIP("vpkswss v%d,v%d,v%d\n", vD_addr, vA_addr, vB_addr);
putVReg( vD_addr,
- binop(Iop_QNarrow32Sx4, mkexpr(vA), mkexpr(vB)) );
+ binop(Iop_QNarrow32Sto16Sx8, mkexpr(vA), mkexpr(vB)) );
// TODO: set VSCR[SAT]
return True;
Modified: trunk/priv/guest_x86_toIR.c
===================================================================
--- trunk/priv/guest_x86_toIR.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/guest_x86_toIR.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -5475,9 +5475,9 @@
case 0x65: op = Iop_CmpGT16Sx4; break;
case 0x66: op = Iop_CmpGT32Sx2; break;
- case 0x6B: op = Iop_QNarrow32Sx2; eLeft = True; break;
- case 0x63: op = Iop_QNarrow16Sx4; eLeft = True; break;
- case 0x67: op = Iop_QNarrow16Ux4; eLeft = True; break;
+ case 0x6B: op = Iop_QNarrow32Sto16Sx4; eLeft = True; break;
+ case 0x63: op = Iop_QNarrow16Sto8Sx8; eLeft = True; break;
+ case 0x67: op = Iop_QNarrow16Sto8Ux8; eLeft = True; break;
case 0x68: op = Iop_InterleaveHI8x8; eLeft = True; break;
case 0x69: op = Iop_InterleaveHI16x4; eLeft = True; break;
@@ -10532,21 +10532,24 @@
/* 66 0F 6B = PACKSSDW */
if (sz == 2 && insn[0] == 0x0F && insn[1] == 0x6B) {
delta = dis_SSEint_E_to_G( sorb, delta+2,
- "packssdw", Iop_QNarrow32Sx4, True );
+ "packssdw",
+ Iop_QNarrow32Sto16Sx8, True );
goto decode_success;
}
/* 66 0F 63 = PACKSSWB */
if (sz == 2 && insn[0] == 0x0F && insn[1] == 0x63) {
delta = dis_SSEint_E_to_G( sorb, delta+2,
- "packsswb", Iop_QNarrow16Sx8, True );
+ "packsswb",
+ Iop_QNarrow16Sto8Sx16, True );
goto decode_success;
}
/* 66 0F 67 = PACKUSWB */
if (sz == 2 && insn[0] == 0x0F && insn[1] == 0x67) {
delta = dis_SSEint_E_to_G( sorb, delta+2,
- "packuswb", Iop_QNarrow16Ux8, True );
+ "packuswb",
+ Iop_QNarrow16Sto8Ux16, True );
goto decode_success;
}
Modified: trunk/priv/host_amd64_isel.c
===================================================================
--- trunk/priv/host_amd64_isel.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/host_amd64_isel.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -1094,12 +1094,12 @@
case Iop_QAdd16Ux4:
fn = (HWord)h_generic_calc_QAdd16Ux4; break;
- case Iop_QNarrow32Sx2:
- fn = (HWord)h_generic_calc_QNarrow32Sx2; break;
- case Iop_QNarrow16Sx4:
- fn = (HWord)h_generic_calc_QNarrow16Sx4; break;
- case Iop_QNarrow16Ux4:
- fn = (HWord)h_generic_calc_QNarrow16Ux4; break;
+ case Iop_QNarrow32Sto16Sx4:
+ fn = (HWord)h_generic_calc_QNarrow32Sto16Sx4; break;
+ case Iop_QNarrow16Sto8Sx8:
+ fn = (HWord)h_generic_calc_QNarrow16Sto8Sx8; break;
+ case Iop_QNarrow16Sto8Ux8:
+ fn = (HWord)h_generic_calc_QNarrow16Sto8Ux8; break;
case Iop_QSub8Sx8:
fn = (HWord)h_generic_calc_QSub8Sx8; break;
@@ -3544,11 +3544,11 @@
return dst;
}
- case Iop_QNarrow32Sx4:
+ case Iop_QNarrow32Sto16Sx8:
op = Asse_PACKSSD; arg1isEReg = True; goto do_SseReRg;
- case Iop_QNarrow16Sx8:
+ case Iop_QNarrow16Sto8Sx16:
op = Asse_PACKSSW; arg1isEReg = True; goto do_SseReRg;
- case Iop_QNarrow16Ux8:
+ case Iop_QNarrow16Sto8Ux16:
op = Asse_PACKUSW; arg1isEReg = True; goto do_SseReRg;
case Iop_InterleaveHI8x16:
Modified: trunk/priv/host_generic_simd64.c
===================================================================
--- trunk/priv/host_generic_simd64.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/host_generic_simd64.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -272,7 +272,7 @@
return toUChar(xx==0 ? 0 : 0xFF);
}
-static inline Short qnarrow32Sto16 ( UInt xx0 )
+static inline Short qnarrow32Sto16S ( UInt xx0 )
{
Int xx = (Int)xx0;
if (xx < -32768) xx = -32768;
@@ -280,7 +280,7 @@
return (Short)xx;
}
-static inline Char qnarrow16Sto8 ( UShort xx0 )
+static inline Char qnarrow16Sto8S ( UShort xx0 )
{
Short xx = (Short)xx0;
if (xx < -128) xx = -128;
@@ -288,7 +288,7 @@
return (Char)xx;
}
-static inline UChar qnarrow16Uto8 ( UShort xx0 )
+static inline UChar qnarrow16Sto8U ( UShort xx0 )
{
Short xx = (Short)xx0;
if (xx < 0) xx = 0;
@@ -759,21 +759,21 @@
/* ------------ Saturating narrowing ------------ */
-ULong h_generic_calc_QNarrow32Sx2 ( ULong aa, ULong bb )
+ULong h_generic_calc_QNarrow32Sto16Sx4 ( ULong aa, ULong bb )
{
UInt d = sel32x2_1(aa);
UInt c = sel32x2_0(aa);
UInt b = sel32x2_1(bb);
UInt a = sel32x2_0(bb);
return mk16x4(
- qnarrow32Sto16(d),
- qnarrow32Sto16(c),
- qnarrow32Sto16(b),
- qnarrow32Sto16(a)
+ qnarrow32Sto16S(d),
+ qnarrow32Sto16S(c),
+ qnarrow32Sto16S(b),
+ qnarrow32Sto16S(a)
);
}
-ULong h_generic_calc_QNarrow16Sx4 ( ULong aa, ULong bb )
+ULong h_generic_calc_QNarrow16Sto8Sx8 ( ULong aa, ULong bb )
{
UShort h = sel16x4_3(aa);
UShort g = sel16x4_2(aa);
@@ -784,18 +784,18 @@
UShort b = sel16x4_1(bb);
UShort a = sel16x4_0(bb);
return mk8x8(
- qnarrow16Sto8(h),
- qnarrow16Sto8(g),
- qnarrow16Sto8(f),
- qnarrow16Sto8(e),
- qnarrow16Sto8(d),
- qnarrow16Sto8(c),
- qnarrow16Sto8(b),
- qnarrow16Sto8(a)
+ qnarrow16Sto8S(h),
+ qnarrow16Sto8S(g),
+ qnarrow16Sto8S(f),
+ qnarrow16Sto8S(e),
+ qnarrow16Sto8S(d),
+ qnarrow16Sto8S(c),
+ qnarrow16Sto8S(b),
+ qnarrow16Sto8S(a)
);
}
-ULong h_generic_calc_QNarrow16Ux4 ( ULong aa, ULong bb )
+ULong h_generic_calc_QNarrow16Sto8Ux8 ( ULong aa, ULong bb )
{
UShort h = sel16x4_3(aa);
UShort g = sel16x4_2(aa);
@@ -806,14 +806,14 @@
UShort b = sel16x4_1(bb);
UShort a = sel16x4_0(bb);
return mk8x8(
- qnarrow16Uto8(h),
- qnarrow16Uto8(g),
- qnarrow16Uto8(f),
- qnarrow16Uto8(e),
- qnarrow16Uto8(d),
- qnarrow16Uto8(c),
- qnarrow16Uto8(b),
- qnarrow16Uto8(a)
+ qnarrow16Sto8U(h),
+ qnarrow16Sto8U(g),
+ qnarrow16Sto8U(f),
+ qnarrow16Sto8U(e),
+ qnarrow16Sto8U(d),
+ qnarrow16Sto8U(c),
+ qnarrow16Sto8U(b),
+ qnarrow16Sto8U(a)
);
}
Modified: trunk/priv/host_generic_simd64.h
===================================================================
--- trunk/priv/host_generic_simd64.h 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/host_generic_simd64.h 2011-06-15 15:09:37 UTC (rev 2159)
@@ -87,9 +87,9 @@
extern ULong h_generic_calc_CmpNEZ16x4 ( ULong );
extern ULong h_generic_calc_CmpNEZ8x8 ( ULong );
-extern ULong h_generic_calc_QNarrow32Sx2 ( ULong, ULong );
-extern ULong h_generic_calc_QNarrow16Sx4 ( ULong, ULong );
-extern ULong h_generic_calc_QNarrow16Ux4 ( ULong, ULong );
+extern ULong h_generic_calc_QNarrow32Sto16Sx4 ( ULong, ULong );
+extern ULong h_generic_calc_QNarrow16Sto8Sx8 ( ULong, ULong );
+extern ULong h_generic_calc_QNarrow16Sto8Ux8 ( ULong, ULong );
extern ULong h_generic_calc_InterleaveHI8x8 ( ULong, ULong );
extern ULong h_generic_calc_InterleaveLO8x8 ( ULong, ULong );
Modified: trunk/priv/host_ppc_isel.c
===================================================================
--- trunk/priv/host_ppc_isel.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/host_ppc_isel.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -3678,11 +3678,11 @@
case Iop_Shr16x8: op = Pav_SHR; goto do_AvBin16x8;
case Iop_Sar16x8: op = Pav_SAR; goto do_AvBin16x8;
case Iop_Rol16x8: op = Pav_ROTL; goto do_AvBin16x8;
- case Iop_Narrow16x8: op = Pav_PACKUU; goto do_AvBin16x8;
- case Iop_QNarrow16Ux8: op = Pav_QPACKUU; goto do_AvBin16x8;
- case Iop_QNarrow16Sx8: op = Pav_QPACKSS; goto do_AvBin16x8;
- case Iop_InterleaveHI16x8: op = Pav_MRGHI; goto do_AvBin16x8;
- case Iop_InterleaveLO16x8: op = Pav_MRGLO; goto do_AvBin16x8;
+ case Iop_Narrow16x8: op = Pav_PACKUU; goto do_AvBin16x8;
+ case Iop_QNarrow16Uto8Ux16: op = Pav_QPACKUU; goto do_AvBin16x8;
+ case Iop_QNarrow16Sto8Sx16: op = Pav_QPACKSS; goto do_AvBin16x8;
+ case Iop_InterleaveHI16x8: op = Pav_MRGHI; goto do_AvBin16x8;
+ case Iop_InterleaveLO16x8: op = Pav_MRGLO; goto do_AvBin16x8;
case Iop_Add16x8: op = Pav_ADDU; goto do_AvBin16x8;
case Iop_QAdd16Ux8: op = Pav_QADDU; goto do_AvBin16x8;
case Iop_QAdd16Sx8: op = Pav_QADDS; goto do_AvBin16x8;
@@ -3712,11 +3712,11 @@
case Iop_Shr32x4: op = Pav_SHR; goto do_AvBin32x4;
case Iop_Sar32x4: op = Pav_SAR; goto do_AvBin32x4;
case Iop_Rol32x4: op = Pav_ROTL; goto do_AvBin32x4;
- case Iop_Narrow32x4: op = Pav_PACKUU; goto do_AvBin32x4;
- case Iop_QNarrow32Ux4: op = Pav_QPACKUU; goto do_AvBin32x4;
- case Iop_QNarrow32Sx4: op = Pav_QPACKSS; goto do_AvBin32x4;
- case Iop_InterleaveHI32x4: op = Pav_MRGHI; goto do_AvBin32x4;
- case Iop_InterleaveLO32x4: op = Pav_MRGLO; goto do_AvBin32x4;
+ case Iop_Narrow32x4: op = Pav_PACKUU; goto do_AvBin32x4;
+ case Iop_QNarrow32Uto16Ux8: op = Pav_QPACKUU; goto do_AvBin32x4;
+ case Iop_QNarrow32Sto16Sx8: op = Pav_QPACKSS; goto do_AvBin32x4;
+ case Iop_InterleaveHI32x4: op = Pav_MRGHI; goto do_AvBin32x4;
+ case Iop_InterleaveLO32x4: op = Pav_MRGLO; goto do_AvBin32x4;
case Iop_Add32x4: op = Pav_ADDU; goto do_AvBin32x4;
case Iop_QAdd32Ux4: op = Pav_QADDU; goto do_AvBin32x4;
case Iop_QAdd32Sx4: op = Pav_QADDS; goto do_AvBin32x4;
Modified: trunk/priv/host_x86_isel.c
===================================================================
--- trunk/priv/host_x86_isel.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/host_x86_isel.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -2386,12 +2386,12 @@
case Iop_QAdd16Ux4:
fn = (HWord)h_generic_calc_QAdd16Ux4; goto binnish;
- case Iop_QNarrow32Sx2:
- fn = (HWord)h_generic_calc_QNarrow32Sx2; goto binnish;
- case Iop_QNarrow16Sx4:
- fn = (HWord)h_generic_calc_QNarrow16Sx4; goto binnish;
- case Iop_QNarrow16Ux4:
- fn = (HWord)h_generic_calc_QNarrow16Ux4; goto binnish;
+ case Iop_QNarrow32Sto16Sx4:
+ fn = (HWord)h_generic_calc_QNarrow32Sto16Sx4; goto binnish;
+ case Iop_QNarrow16Sto8Sx8:
+ fn = (HWord)h_generic_calc_QNarrow16Sto8Sx8; goto binnish;
+ case Iop_QNarrow16Sto8Ux8:
+ fn = (HWord)h_generic_calc_QNarrow16Sto8Ux8; goto binnish;
case Iop_QSub8Sx8:
fn = (HWord)h_generic_calc_QSub8Sx8; goto binnish;
@@ -3500,11 +3500,11 @@
return dst;
}
- case Iop_QNarrow32Sx4:
+ case Iop_QNarrow32Sto16Sx8:
op = Xsse_PACKSSD; arg1isEReg = True; goto do_SseReRg;
- case Iop_QNarrow16Sx8:
+ case Iop_QNarrow16Sto8Sx16:
op = Xsse_PACKSSW; arg1isEReg = True; goto do_SseReRg;
- case Iop_QNarrow16Ux8:
+ case Iop_QNarrow16Sto8Ux16:
op = Xsse_PACKUSW; arg1isEReg = True; goto do_SseReRg;
case Iop_InterleaveHI8x16:
Modified: trunk/priv/ir_defs.c
===================================================================
--- trunk/priv/ir_defs.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/priv/ir_defs.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -506,9 +506,9 @@
case Iop_SarN8x8: vex_printf("SarN8x8"); return;
case Iop_SarN16x4: vex_printf("SarN16x4"); return;
case Iop_SarN32x2: vex_printf("SarN32x2"); return;
- case Iop_QNarrow16Ux4: vex_printf("QNarrow16Ux4"); return;
- case Iop_QNarrow16Sx4: vex_printf("QNarrow16Sx4"); return;
- case Iop_QNarrow32Sx2: vex_printf("QNarrow32Sx2"); return;
+ case Iop_QNarrow16Sto8Ux8: vex_printf("QNarrow16Sto8Ux8"); return;
+ case Iop_QNarrow16Sto8Sx8: vex_printf("QNarrow16Sto8Sx8"); return;
+ case Iop_QNarrow32Sto16Sx4: vex_printf("QNarrow32Sto16Sx4"); return;
case Iop_InterleaveHI8x8: vex_printf("InterleaveHI8x8"); return;
case Iop_InterleaveHI16x4: vex_printf("InterleaveHI16x4"); return;
case Iop_InterleaveHI32x2: vex_printf("InterleaveHI32x2"); return;
@@ -846,10 +846,10 @@
case Iop_Narrow16x8: vex_printf("Narrow16x8"); return;
case Iop_Narrow32x4: vex_printf("Narrow32x4"); return;
- case Iop_QNarrow16Ux8: vex_printf("QNarrow16Ux8"); return;
- case Iop_QNarrow32Ux4: vex_printf("QNarrow32Ux4"); return;
- case Iop_QNarrow16Sx8: vex_printf("QNarrow16Sx8"); return;
- case Iop_QNarrow32Sx4: vex_printf("QNarrow32Sx4"); return;
+ case Iop_QNarrow16Sto8Ux16: vex_printf("QNarrow16Sto8Ux16"); return;
+ case Iop_QNarrow32Uto16Ux8: vex_printf("QNarrow32Uto16Ux8"); return;
+ case Iop_QNarrow16Sto8Sx16: vex_printf("QNarrow16Sto8Sx16"); return;
+ case Iop_QNarrow32Sto16Sx8: vex_printf("QNarrow32Sto16Sx8"); return;
case Iop_Shorten16x8: vex_printf("Shorten16x8"); return;
case Iop_Shorten32x4: vex_printf("Shorten32x4"); return;
case Iop_Shorten64x2: vex_printf("Shorten64x2"); return;
@@ -2052,8 +2052,8 @@
case Iop_QAdd32Ux2: case Iop_QAdd64Ux1:
case Iop_PwAdd8x8: case Iop_PwAdd16x4: case Iop_PwAdd32x2:
case Iop_PwAdd32Fx2:
- case Iop_QNarrow32Sx2:
- case Iop_QNarrow16Sx4: case Iop_QNarrow16Ux4:
+ case Iop_QNarrow32Sto16Sx4:
+ case Iop_QNarrow16Sto8Sx8: case Iop_QNarrow16Sto8Ux8:
case Iop_Sub8x8: case Iop_Sub16x4: case Iop_Sub32x2:
case Iop_QSub8Sx8: case Iop_QSub16Sx4:
case Iop_QSub32Sx2: case Iop_QSub64Sx1:
@@ -2418,8 +2418,9 @@
case Iop_Sar8x16: case Iop_Sar16x8: case Iop_Sar32x4: case Iop_Sar64x2:
case Iop_Sal8x16: case Iop_Sal16x8: case Iop_Sal32x4: case Iop_Sal64x2:
case Iop_Rol8x16: case Iop_Rol16x8: case Iop_Rol32x4:
- case Iop_QNarrow16Ux8: case Iop_QNarrow32Ux4:
- case Iop_QNarrow16Sx8: case Iop_QNarrow32Sx4:
+ case Iop_QNarrow16Sto8Ux16:
+ case Iop_QNarrow16Sto8Sx16: case Iop_QNarrow32Sto16Sx8:
+ case Iop_QNarrow32Uto16Ux8:
case Iop_Narrow16x8: case Iop_Narrow32x4:
case Iop_InterleaveHI8x16: case Iop_InterleaveHI16x8:
case Iop_InterleaveHI32x4: case Iop_InterleaveHI64x2:
Modified: trunk/pub/libvex_ir.h
===================================================================
--- trunk/pub/libvex_ir.h 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/pub/libvex_ir.h 2011-06-15 15:09:37 UTC (rev 2159)
@@ -896,10 +896,28 @@
Iop_QSalN8x8, Iop_QSalN16x4, Iop_QSalN32x2, Iop_QSalN64x1,
/* NARROWING -- narrow 2xI64 into 1xI64, hi half from left arg */
- Iop_QNarrow16Ux4,
- Iop_QNarrow16Sx4,
- Iop_QNarrow32Sx2,
+ /* For saturated narrowing, I believe there are 4 variants of
+ the basic arithmetic operation, depending on the signedness
+ of argument and result. Here are examples that exemplify
+ what I mean:
+ QNarrow16Uto8U ( UShort x ) if (x >u 255) x = 255;
+ return x[7:0];
+
+ QNarrow16Sto8S ( Short x ) if (x <s -128) x = -128;
+ if (x >s 127) x = 127;
+ return x[7:0];
+
+ QNarrow16Uto8S ( UShort x ) if (x >u 127) x = 127;
+ return x[7:0];
+
+ QNarrow16Sto8U ( Short x ) if (x <s 0) x = 0;
+ if (x >s 255) x = 255;
+ return x[7:0];
+ */
+ Iop_QNarrow16Sto8Ux8,
+ Iop_QNarrow16Sto8Sx8, Iop_QNarrow32Sto16Sx4,
+
/* INTERLEAVING */
/* Interleave lanes from low or high halves of
operands. Most-significant result lane is from the left
@@ -1176,9 +1194,10 @@
Iop_QSalN8x16, Iop_QSalN16x8, Iop_QSalN32x4, Iop_QSalN64x2,
/* NARROWING -- narrow 2xV128 into 1xV128, hi half from left arg */
- /* Note: the 16{U,S} and 32{U,S} are the pre-narrow lane widths. */
- Iop_QNarrow16Ux8, Iop_QNarrow32Ux4,
- Iop_QNarrow16Sx8, Iop_QNarrow32Sx4,
+ /* See comments above w.r.t. U vs S issues in saturated narrowing. */
+ Iop_QNarrow16Sto8Ux16,
+ Iop_QNarrow16Sto8Sx16, Iop_QNarrow32Sto16Sx8,
+ Iop_QNarrow16Uto8Ux16, Iop_QNarrow32Uto16Ux8,
Iop_Narrow16x8, Iop_Narrow32x4,
/* Shortening V128->I64, lo half from each element */
Iop_Shorten16x8, Iop_Shorten32x4, Iop_Shorten64x2,
Modified: trunk/test_main.c
===================================================================
--- trunk/test_main.c 2011-06-07 21:28:38 UTC (rev 2158)
+++ trunk/test_main.c 2011-06-15 15:09:37 UTC (rev 2159)
@@ -1531,9 +1531,9 @@
IRAtom *at1, *at2, *at3;
IRAtom* (*pcast)( MCEnv*, IRAtom* );
switch (narrow_op) {
- case Iop_QNarrow32Sx4: pcast = mkPCast32x4; break;
- case Iop_QNarrow16Sx8: pcast = mkPCast16x8; break;
- case Iop_QNarrow16Ux8: pcast = mkPCast16x8; break;
+ case Iop_QNarrow32Sto16Sx8: pcast = mkPCast32x4; break;
+ case Iop_QNarrow16Sto8Sx16: pcast = mkPCast16x8; break;
+ case Iop_QNarrow16Sto8Ux16: pcast = mkPCast16x8; break;
default: VG_(tool_panic)("vectorNarrowV128");
}
tl_assert(isShadowAtom(mce,vatom1));
@@ -1671,9 +1671,9 @@
case Iop_QAdd64Sx2:
return binary64Ix2(mce, vatom1, vatom2);
- case Iop_QNarrow32Sx4:
- case Iop_QNarrow16Sx8:
- case Iop_QNarrow16Ux8:
+ case Iop_QNarrow32Sto16Sx8:
+ case Iop_QNarrow16Sto8Sx16:
+ case Iop_QNarrow16Sto8Ux16:
return vectorNarrowV128(mce, op, vatom1, vatom2);
case Iop_Sub64Fx2:
|