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
(2) |
2
|
|
3
(9) |
4
(9) |
5
(16) |
6
(13) |
7
(12) |
8
(11) |
9
(6) |
|
10
|
11
(23) |
12
(31) |
13
(20) |
14
(7) |
15
|
16
(9) |
|
17
(2) |
18
(1) |
19
(12) |
20
(9) |
21
(8) |
22
(14) |
23
(2) |
|
24
(9) |
25
(11) |
26
(17) |
27
(14) |
28
(38) |
29
(25) |
30
(15) |
|
31
(8) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2011-07-24 21:46:30
|
Author: sewardj
Date: 2011-07-24 22:41:41 +0100 (Sun, 24 Jul 2011)
New Revision: 11912
Log:
The cmpxchg16b tests in this need to have 16-aligned addresses;
make it so. Else they die with segfaults on F15.
Modified:
trunk/none/tests/amd64/bug127521-64.c
Modified: trunk/none/tests/amd64/bug127521-64.c
===================================================================
--- trunk/none/tests/amd64/bug127521-64.c 2011-07-24 17:39:10 UTC (rev 11911)
+++ trunk/none/tests/amd64/bug127521-64.c 2011-07-24 21:41:41 UTC (rev 11912)
@@ -66,7 +66,7 @@
ULong memHiIn, ULong memLoIn,
ULong rcxIn, ULong rbxIn )
{
- ULong mem[2];
+ ULong mem[2] __attribute__((aligned(16)));
ULong block[6];
mem[0] = memLoIn;
mem[1] = memHiIn;
|
|
From: Christian B. <bor...@de...> - 2011-07-24 20:33:07
|
Nightly build on sless390 ( SUSE Linux Enterprise Server 11 SP1 gcc 4.3.4 on z196 (s390x) ) Started at 2011-07-24 22:10:01 CEST Ended at 2011-07-24 22:32:52 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 == 492 tests, 16 stderr failures, 0 stdout failures, 6 stderrB failures, 0 stdoutB failures, 0 post failures == gdbserver_tests/mcbreak (stderrB) gdbserver_tests/mcclean_after_fork (stderrB) gdbserver_tests/mcinfcallWSRU (stderrB) gdbserver_tests/mcleak (stderrB) gdbserver_tests/mssnapshot (stderrB) gdbserver_tests/nlpasssigalrm (stderrB) memcheck/tests/err_disable3 (stderr) memcheck/tests/err_disable4 (stderr) memcheck/tests/linux/timerfd-syscall (stderr) none/tests/faultstatus (stderr) helgrind/tests/locked_vs_unlocked1_fwd (stderr) helgrind/tests/locked_vs_unlocked1_rev (stderr) helgrind/tests/locked_vs_unlocked2 (stderr) helgrind/tests/locked_vs_unlocked3 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc18_semabuse (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 ... done Running regression tests ... failed Regression test results follow == 487 tests, 14 stderr failures, 0 stdout failures, 6 stderrB failures, 0 stdoutB failures, 0 post failures == gdbserver_tests/mcbreak (stderrB) gdbserver_tests/mcclean_after_fork (stderrB) gdbserver_tests/mcinfcallWSRU (stderrB) gdbserver_tests/mcleak (stderrB) gdbserver_tests/mssnapshot (stderrB) gdbserver_tests/nlpasssigalrm (stderrB) memcheck/tests/linux/timerfd-syscall (stderr) none/tests/faultstatus (stderr) helgrind/tests/locked_vs_unlocked1_fwd (stderr) helgrind/tests/locked_vs_unlocked1_rev (stderr) helgrind/tests/locked_vs_unlocked2 (stderr) helgrind/tests/locked_vs_unlocked3 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc18_semabuse (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) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sun Jul 24 22:20:21 2011 --- new.short Sun Jul 24 22:32:52 2011 *************** *** 8,10 **** ! == 487 tests, 14 stderr failures, 0 stdout failures, 6 stderrB failures, 0 stdoutB failures, 0 post failures == gdbserver_tests/mcbreak (stderrB) --- 8,10 ---- ! == 492 tests, 16 stderr failures, 0 stdout failures, 6 stderrB failures, 0 stdoutB failures, 0 post failures == gdbserver_tests/mcbreak (stderrB) *************** *** 15,16 **** --- 15,18 ---- gdbserver_tests/nlpasssigalrm (stderrB) + memcheck/tests/err_disable3 (stderr) + memcheck/tests/err_disable4 (stderr) memcheck/tests/linux/timerfd-syscall (stderr) |
|
From: Christian B. <bor...@de...> - 2011-07-24 20:30:54
|
Nightly build on fedora390 ( Fedora 13/14/15 mix with gcc 3.5.3 on z196 (s390x) ) Started at 2011-07-24 22:10:01 CEST Ended at 2011-07-24 22:31:03 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 == 493 tests, 23 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == memcheck/tests/err_disable3 (stderr) memcheck/tests/err_disable4 (stderr) memcheck/tests/linux/timerfd-syscall (stderr) none/tests/pth_cancel1 (stderr) none/tests/pth_cancel2 (stderr) none/tests/pth_exit (stderr) none/tests/pth_exit2 (stderr) none/tests/s390x/ex_clone (stderr) helgrind/tests/locked_vs_unlocked1_fwd (stderr) helgrind/tests/locked_vs_unlocked1_rev (stderr) helgrind/tests/locked_vs_unlocked2 (stderr) helgrind/tests/locked_vs_unlocked3 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc23_bogus_condwait (stderr) drd/tests/circular_buffer (stderr) drd/tests/pth_cancel_locked (stderr) drd/tests/pth_cleanup_handler (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 ... done Running regression tests ... failed Regression test results follow == 488 tests, 21 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == memcheck/tests/linux/timerfd-syscall (stderr) none/tests/pth_cancel1 (stderr) none/tests/pth_cancel2 (stderr) none/tests/pth_exit (stderr) none/tests/pth_exit2 (stderr) none/tests/s390x/ex_clone (stderr) helgrind/tests/locked_vs_unlocked1_fwd (stderr) helgrind/tests/locked_vs_unlocked1_rev (stderr) helgrind/tests/locked_vs_unlocked2 (stderr) helgrind/tests/locked_vs_unlocked3 (stderr) helgrind/tests/pth_barrier3 (stderr) helgrind/tests/tc06_two_races_xml (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc23_bogus_condwait (stderr) drd/tests/circular_buffer (stderr) drd/tests/pth_cancel_locked (stderr) drd/tests/pth_cleanup_handler (stderr) drd/tests/tc04_free_lock (stderr) drd/tests/tc09_bad_unlock (stderr) drd/tests/tc23_bogus_condwait (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Sun Jul 24 22:20:19 2011 --- new.short Sun Jul 24 22:31:03 2011 *************** *** 8,10 **** ! == 488 tests, 21 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == memcheck/tests/linux/timerfd-syscall (stderr) --- 8,12 ---- ! == 493 tests, 23 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == ! memcheck/tests/err_disable3 (stderr) ! memcheck/tests/err_disable4 (stderr) memcheck/tests/linux/timerfd-syscall (stderr) |
|
From: <sv...@va...> - 2011-07-24 17:44:01
|
Author: sewardj Date: 2011-07-24 18:39:10 +0100 (Sun, 24 Jul 2011) New Revision: 11911 Log: Avoid excessive fragmentation in m_mallocfree facility by munmapping unused superblocks in some circumstances. Bug 250101 (==269884, ==275852) (Philippe Waroquiers, phi...@sk...) Added: trunk/massif/tests/big-alloc.post.exp-64bit trunk/memcheck/tests/sbfragment.c trunk/memcheck/tests/sbfragment.stderr.exp trunk/memcheck/tests/sbfragment.stdout.exp trunk/memcheck/tests/sbfragment.vgtest Modified: trunk/coregrind/m_mallocfree.c trunk/massif/tests/Makefile.am trunk/massif/tests/big-alloc.post.exp trunk/memcheck/tests/Makefile.am Modified: trunk/coregrind/m_mallocfree.c =================================================================== --- trunk/coregrind/m_mallocfree.c 2011-07-24 16:02:33 UTC (rev 11910) +++ trunk/coregrind/m_mallocfree.c 2011-07-24 17:39:10 UTC (rev 11911) @@ -151,6 +151,19 @@ // 8-bytes on 32-bit machines with an 8-byte VG_MIN_MALLOC_SZB -- because // it's too hard to make a constant expression that works perfectly in all // cases. +// reclaimable is set to NULL if superblock cannot be reclaimed, otherwise +// it is set to the address of the superblock. A reclaimable superblock +// will contain only one allocated block. The superblock segment will +// be unmapped when the allocated block is freed. +// The free space at the end of a reclaimable superblock is not used to +// make a free block. Note that this means that a reclaimable superblock can +// have up to slightly less than 1 page of unused bytes at the end of the +// superblock. +// reclaimable is used to avoid quadratic memory usage for linear reallocation +// of big structures (see http://bugs.kde.org/show_bug.cgi?id=250101). +// ??? reclaimable replaces 'void *padding2'. Choosed this +// ??? to avoid changing the alignment logic. Maybe something cleaner +// ??? can be done. // payload_bytes[] is made a single big Block when the Superblock is // created, and then can be split and the splittings remerged, but Blocks // always cover its entire length -- there's never any unused bytes at the @@ -158,7 +171,7 @@ typedef struct _Superblock { SizeT n_payload_bytes; - void* padding2; + struct _Superblock* reclaimable; UByte padding[ VG_MIN_MALLOC_SZB - ((sizeof(struct _Superblock*) + sizeof(SizeT)) % VG_MIN_MALLOC_SZB) ]; @@ -174,6 +187,11 @@ Bool clientmem; // Allocates in the client address space? SizeT rz_szB; // Red zone size in bytes SizeT min_sblock_szB; // Minimum superblock size in bytes + SizeT min_reclaimable_sblock_szB; + // Minimum reclaimable superblock size in bytes. All superblocks with + // a size >= min_reclaimable_sblock_szB will be reclaimed when + // their (only) allocated block is freed. + // Smaller size superblocks are not reclaimable. Block* freelist[N_MALLOC_LISTS]; // A dynamically expanding, ordered array of (pointers to) // superblocks in the arena. If this array is expanded, which @@ -196,6 +214,7 @@ // If profiling, when should the next profile happen at // (in terms of stats__bytes_on_loan_max) ? SizeT next_profile_at; + SizeT stats__bytes_mmaped_max; } Arena; @@ -458,7 +477,8 @@ // Initialise an arena. rz_szB is the minimum redzone size; it might be // made bigger to ensure that VG_MIN_MALLOC_SZB is observed. static -void arena_init ( ArenaId aid, Char* name, SizeT rz_szB, SizeT min_sblock_szB ) +void arena_init ( ArenaId aid, Char* name, SizeT rz_szB, + SizeT min_sblock_szB, SizeT min_reclaimable_sblock_szB ) { SizeT i; Arena* a = arenaId_to_ArenaP(aid); @@ -481,6 +501,7 @@ vg_assert(overhead_szB_lo(a) - hp_overhead_szB() == overhead_szB_hi(a)); a->min_sblock_szB = min_sblock_szB; + a->min_reclaimable_sblock_szB = min_reclaimable_sblock_szB; for (i = 0; i < N_MALLOC_LISTS; i++) a->freelist[i] = NULL; a->sblocks = & a->sblocks_initial[0]; @@ -489,6 +510,7 @@ a->stats__bytes_on_loan = 0; a->stats__bytes_mmaped = 0; a->stats__bytes_on_loan_max = 0; + a->stats__bytes_mmaped_max = 0; a->stats__tot_blocks = 0; a->stats__tot_bytes = 0; a->stats__nsearches = 0; @@ -504,10 +526,11 @@ for (i = 0; i < VG_N_ARENAS; i++) { Arena* a = arenaId_to_ArenaP(i); VG_(message)(Vg_DebugMsg, - "%8s: %8ld mmap'd, %8ld/%8ld max/curr, " + "%8s: %8ld/%8ld max/curr mmap'd, %8ld/%8ld max/curr, " "%10llu/%10llu totalloc-blocks/bytes," " %10llu searches\n", - a->name, a->stats__bytes_mmaped, + a->name, + a->stats__bytes_mmaped_max, a->stats__bytes_mmaped, a->stats__bytes_on_loan_max, a->stats__bytes_on_loan, a->stats__tot_blocks, a->stats__tot_bytes, @@ -582,7 +605,9 @@ // increasing the superblock size reduces the number of superblocks // in the client arena, which makes findSb cheaper. ar_client_sbszB = 4194304; - arena_init ( VG_AR_CLIENT, "client", client_rz_szB, ar_client_sbszB ); + // superblocks with a size > ar_client_sbszB will be reclaimed. + arena_init ( VG_AR_CLIENT, "client", client_rz_szB, + ar_client_sbszB, ar_client_sbszB+1); client_inited = True; } else { @@ -590,13 +615,19 @@ return; } // Initialise the non-client arenas - arena_init ( VG_AR_CORE, "core", 4, 1048576 ); - arena_init ( VG_AR_TOOL, "tool", 4, 4194304 ); - arena_init ( VG_AR_DINFO, "dinfo", 4, 1048576 ); - arena_init ( VG_AR_DEMANGLE, "demangle", 4, 65536 ); - arena_init ( VG_AR_EXECTXT, "exectxt", 4, 1048576 ); - arena_init ( VG_AR_ERRORS, "errors", 4, 65536 ); - arena_init ( VG_AR_TTAUX, "ttaux", 4, 65536 ); + // superblocks of non-client arena are not reclaimed. + // If big transient allocations are done in an arena, + // then activating reclaim for these arenas might be useful. + // A test done with memcheck on a big executable with reclaim + // set to min_sblock_szB+1 for all arenas has shown that + // some superblocks in dinfo and tool would be reclaimed. + arena_init ( VG_AR_CORE, "core", 4, 1048576, MAX_PSZB ); + arena_init ( VG_AR_TOOL, "tool", 4, 4194304, MAX_PSZB ); + arena_init ( VG_AR_DINFO, "dinfo", 4, 1048576, MAX_PSZB ); + arena_init ( VG_AR_DEMANGLE, "demangle", 4, 65536, MAX_PSZB ); + arena_init ( VG_AR_EXECTXT, "exectxt", 4, 1048576, MAX_PSZB ); + arena_init ( VG_AR_ERRORS, "errors", 4, 65536, MAX_PSZB ); + arena_init ( VG_AR_TTAUX, "ttaux", 4, 65536, MAX_PSZB ); nonclient_inited = True; } @@ -667,6 +698,7 @@ { Superblock* sb; SysRes sres; + Bool reclaimable; // Take into account admin bytes in the Superblock. cszB += sizeof(Superblock); @@ -674,10 +706,20 @@ if (cszB < a->min_sblock_szB) cszB = a->min_sblock_szB; cszB = VG_PGROUNDUP(cszB); + if (cszB >= a->min_reclaimable_sblock_szB) + reclaimable = True; + else + reclaimable = False; + + if (a->clientmem) { // client allocation -- return 0 to client if it fails - sres = VG_(am_sbrk_anon_float_client) - ( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC ); + if (reclaimable) + sres = VG_(am_mmap_anon_float_client) + ( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC ); + else + sres = VG_(am_sbrk_anon_float_client) + ( cszB, VKI_PROT_READ|VKI_PROT_WRITE|VKI_PROT_EXEC ); if (sr_isError(sres)) return 0; sb = (Superblock*)(AddrH)sr_Res(sres); @@ -689,7 +731,10 @@ ); } else { // non-client allocation -- abort if it fails - sres = VG_(am_sbrk_anon_float_valgrind)( cszB ); + if (reclaimable) + sres = VG_(am_mmap_anon_float_valgrind)( cszB ); + else + sres = VG_(am_sbrk_anon_float_valgrind)( cszB ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("newSuperblock", cszB); /* NOTREACHED */ @@ -702,14 +747,73 @@ //zzVALGRIND_MAKE_MEM_UNDEFINED(sb, cszB); vg_assert(0 == (Addr)sb % VG_MIN_MALLOC_SZB); sb->n_payload_bytes = cszB - sizeof(Superblock); + sb->reclaimable = (reclaimable ? sb : NULL); a->stats__bytes_mmaped += cszB; + if (a->stats__bytes_mmaped > a->stats__bytes_mmaped_max) + a->stats__bytes_mmaped_max = a->stats__bytes_mmaped; VG_(debugLog)(1, "mallocfree", - "newSuperblock at %p (pszB %7ld) owner %s/%s\n", - sb, sb->n_payload_bytes, + "newSuperblock at %p (pszB %7ld) %s owner %s/%s\n", + sb, sb->n_payload_bytes, (reclaimable ? "reclaimable" : ""), a->clientmem ? "CLIENT" : "VALGRIND", a->name ); return sb; } +// Reclaims the given (reclaimable) superblock: +// * removes sb from arena sblocks list. +// * munmap the superblock segment. +static +void reclaimSuperblock ( Arena* a, Superblock* sb) +{ + SysRes sres; + SizeT cszB; + UInt i, j; + + VG_(debugLog)(1, "mallocfree", + "reclaimSuperblock at %p (pszB %7ld) owner %s/%s\n", + sb, sb->n_payload_bytes, + a->clientmem ? "CLIENT" : "VALGRIND", a->name ); + + vg_assert (sb->reclaimable); + vg_assert (sb->reclaimable == sb); + + // Take into account admin bytes in the Superblock. + cszB = sizeof(Superblock) + sb->n_payload_bytes; + vg_assert (cszB >= a->min_reclaimable_sblock_szB); + + // removes sb from superblock list. + for (i = 0; i < a->sblocks_used; i++) { + if (a->sblocks[i] == sb) + break; + } + vg_assert(i >= 0 && i < a->sblocks_used); + for (j = i; j < a->sblocks_used; j++) + a->sblocks[j] = a->sblocks[j+1]; + a->sblocks_used--; + a->sblocks[a->sblocks_used] = NULL; + // paranoia: NULLify ptr to reclaimed sb or NULLify copy of ptr to last sb. + + // Now that the sb is removed from the list, mnumap its space. + if (a->clientmem) { + // reclaimable client allocation + Bool need_discard = False; + sres = VG_(am_munmap_client)(&need_discard, (Addr) sb, cszB); + /* If need_discard is ever True (iow, if the following assertion + ever fails), we'll need to tell m_transtab to discard the + range. This unfortunately give it and this a circular + dependency. It would be better to let this routine return + and have its caller to the discard, than do it here (no + effect on deadlocking etc but it might be easier to read.) + */ + vg_assert (!need_discard); + vg_assert2(! sr_isError(sres), "superblock client munmap failure\n"); + } else { + // reclaimable non-client allocation + sres = VG_(am_munmap_valgrind)((Addr) sb, cszB); + vg_assert2(! sr_isError(sres), "superblock valgrind munmap failure\n"); + } + a->stats__bytes_mmaped -= cszB; +} + // Find the superblock containing the given chunk. static Superblock* findSb ( Arena* a, Block* b ) @@ -923,8 +1027,9 @@ Superblock * sb = a->sblocks[j]; VG_(printf)( "\n" ); - VG_(printf)( "superblock %d at %p, sb->n_pl_bs = %lu\n", - blockno++, sb, sb->n_payload_bytes); + VG_(printf)( "superblock %d at %p %s, sb->n_pl_bs = %lu\n", + blockno++, sb, (sb->reclaimable ? "reclaimable" : ""), + sb->n_payload_bytes); for (i = 0; i < sb->n_payload_bytes; i += b_bszB) { Block* b = (Block*)&sb->payload_bytes[i]; b_bszB = get_bszB(b); @@ -1002,8 +1107,8 @@ if (arena_bytes_on_loan != a->stats__bytes_on_loan) { # ifdef VERBOSE_MALLOC - VG_(printf)( "sanity_check_malloc_arena: a->bytes_on_loan %ld, " - "arena_bytes_on_loan %ld: " + VG_(printf)( "sanity_check_malloc_arena: a->bytes_on_loan %lu, " + "arena_bytes_on_loan %lu: " "MISMATCH\n", a->bytes_on_loan, arena_bytes_on_loan); # endif ppSuperblocks(a); @@ -1098,8 +1203,9 @@ sanity_check_malloc_arena(aid); VG_(printf)( - "-------- Arena \"%s\": %ld mmap'd, %ld/%ld max/curr --------\n", - a->name, a->stats__bytes_mmaped, + "-------- Arena \"%s\": %lu/%lu max/curr mmap'd, " + "%lu/%lu max/curr on_loan --------\n", + a->name, a->stats__bytes_mmaped_max, a->stats__bytes_mmaped, a->stats__bytes_on_loan_max, a->stats__bytes_on_loan ); @@ -1273,7 +1379,7 @@ { SizeT req_bszB, frag_bszB, b_bszB; UInt lno, i; - Superblock* new_sb; + Superblock* new_sb = NULL; Block* b = NULL; Arena* a; void* v; @@ -1398,8 +1504,10 @@ vg_assert(b_bszB >= req_bszB); // Could we split this block and still get a useful fragment? + // A block in a reclaimable superblock can never be splitted. frag_bszB = b_bszB - req_bszB; - if (frag_bszB >= min_useful_bszB(a)) { + if (frag_bszB >= min_useful_bszB(a) + && (NULL == new_sb || ! new_sb->reclaimable)) { // Yes, split block in two, put the fragment on the appropriate free // list, and update b_bszB accordingly. // printf( "split %dB into %dB and %dB\n", b_bszB, req_bszB, frag_bszB ); @@ -1502,60 +1610,73 @@ if (aid != VG_AR_CLIENT) VG_(memset)(ptr, 0xDD, (SizeT)b_pszB); - // Put this chunk back on a list somewhere. - b_listno = pszB_to_listNo(b_pszB); - mkFreeBlock( a, b, b_bszB, b_listno ); - if (VG_(clo_profile_heap)) - set_cc(b, "admin.free-1"); + if (! sb->reclaimable) { + // Put this chunk back on a list somewhere. + b_listno = pszB_to_listNo(b_pszB); + mkFreeBlock( a, b, b_bszB, b_listno ); + if (VG_(clo_profile_heap)) + set_cc(b, "admin.free-1"); - // See if this block can be merged with its successor. - // First test if we're far enough before the superblock's end to possibly - // have a successor. - other_b = b + b_bszB; - if (other_b+min_useful_bszB(a)-1 <= (Block*)sb_end) { - // Ok, we have a successor, merge if it's not in use. - other_bszB = get_bszB(other_b); - if (!is_inuse_block(other_b)) { - // VG_(printf)( "merge-successor\n"); -# ifdef DEBUG_MALLOC - vg_assert(blockSane(a, other_b)); -# endif - unlinkBlock( a, b, b_listno ); - unlinkBlock( a, other_b, pszB_to_listNo(bszB_to_pszB(a,other_bszB)) ); - b_bszB += other_bszB; - b_listno = pszB_to_listNo(bszB_to_pszB(a, b_bszB)); - mkFreeBlock( a, b, b_bszB, b_listno ); - if (VG_(clo_profile_heap)) - set_cc(b, "admin.free-2"); + // See if this block can be merged with its successor. + // First test if we're far enough before the superblock's end to possibly + // have a successor. + other_b = b + b_bszB; + if (other_b+min_useful_bszB(a)-1 <= (Block*)sb_end) { + // Ok, we have a successor, merge if it's not in use. + other_bszB = get_bszB(other_b); + if (!is_inuse_block(other_b)) { + // VG_(printf)( "merge-successor\n"); +# ifdef DEBUG_MALLOC + vg_assert(blockSane(a, other_b)); +# endif + unlinkBlock( a, b, b_listno ); + unlinkBlock( a, other_b, + pszB_to_listNo(bszB_to_pszB(a,other_bszB)) ); + b_bszB += other_bszB; + b_listno = pszB_to_listNo(bszB_to_pszB(a, b_bszB)); + mkFreeBlock( a, b, b_bszB, b_listno ); + if (VG_(clo_profile_heap)) + set_cc(b, "admin.free-2"); + } + } else { + // Not enough space for successor: check that b is the last block + // ie. there are no unused bytes at the end of the Superblock. + vg_assert(other_b-1 == (Block*)sb_end); } - } else { - // Not enough space for successor: check that b is the last block - // ie. there are no unused bytes at the end of the Superblock. - vg_assert(other_b-1 == (Block*)sb_end); - } - // Then see if this block can be merged with its predecessor. - // First test if we're far enough after the superblock's start to possibly - // have a predecessor. - if (b >= (Block*)sb_start + min_useful_bszB(a)) { - // Ok, we have a predecessor, merge if it's not in use. - other_b = get_predecessor_block( b ); - other_bszB = get_bszB(other_b); - if (!is_inuse_block(other_b)) { - // VG_(printf)( "merge-predecessor\n"); - unlinkBlock( a, b, b_listno ); - unlinkBlock( a, other_b, pszB_to_listNo(bszB_to_pszB(a, other_bszB)) ); - b = other_b; - b_bszB += other_bszB; - b_listno = pszB_to_listNo(bszB_to_pszB(a, b_bszB)); - mkFreeBlock( a, b, b_bszB, b_listno ); - if (VG_(clo_profile_heap)) - set_cc(b, "admin.free-3"); + // Then see if this block can be merged with its predecessor. + // First test if we're far enough after the superblock's start to possibly + // have a predecessor. + if (b >= (Block*)sb_start + min_useful_bszB(a)) { + // Ok, we have a predecessor, merge if it's not in use. + other_b = get_predecessor_block( b ); + other_bszB = get_bszB(other_b); + if (!is_inuse_block(other_b)) { + // VG_(printf)( "merge-predecessor\n"); + unlinkBlock( a, b, b_listno ); + unlinkBlock( a, other_b, + pszB_to_listNo(bszB_to_pszB(a, other_bszB)) ); + b = other_b; + b_bszB += other_bszB; + b_listno = pszB_to_listNo(bszB_to_pszB(a, b_bszB)); + mkFreeBlock( a, b, b_bszB, b_listno ); + if (VG_(clo_profile_heap)) + set_cc(b, "admin.free-3"); + } + } else { + // Not enough space for predecessor: check that b is the first block, + // ie. there are no unused bytes at the start of the Superblock. + vg_assert((Block*)sb_start == b); } } else { - // Not enough space for predecessor: check that b is the first block, - // ie. there are no unused bytes at the start of the Superblock. + // b must be first block (i.e. no unused bytes at the beginning) vg_assert((Block*)sb_start == b); + + // b must be last block (i.e. no unused bytes at the end) + other_b = b + b_bszB; + vg_assert(other_b-1 == (Block*)sb_end); + + reclaimSuperblock (a, sb); } # ifdef DEBUG_MALLOC Modified: trunk/massif/tests/Makefile.am =================================================================== --- trunk/massif/tests/Makefile.am 2011-07-24 16:02:33 UTC (rev 11910) +++ trunk/massif/tests/Makefile.am 2011-07-24 17:39:10 UTC (rev 11911) @@ -8,7 +8,8 @@ alloc-fns-B.post.exp alloc-fns-B.stderr.exp alloc-fns-B.vgtest \ basic.post.exp basic.stderr.exp basic.vgtest \ basic2.post.exp basic2.stderr.exp basic2.vgtest \ - big-alloc.post.exp big-alloc.stderr.exp big-alloc.vgtest \ + big-alloc.post.exp big-alloc.post.exp-64bit \ + big-alloc.stderr.exp big-alloc.vgtest \ deep-A.post.exp deep-A.stderr.exp deep-A.vgtest \ deep-B.post.exp deep-B.stderr.exp deep-B.vgtest \ deep-C.post.exp deep-C.stderr.exp deep-C.vgtest \ Modified: trunk/massif/tests/big-alloc.post.exp =================================================================== --- trunk/massif/tests/big-alloc.post.exp 2011-07-24 16:02:33 UTC (rev 11910) +++ trunk/massif/tests/big-alloc.post.exp 2011-07-24 17:39:10 UTC (rev 11911) @@ -36,19 +36,19 @@ n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) -------------------------------------------------------------------------------- 0 0 0 0 0 0 - 1 10,485,768 10,485,768 10,485,760 8 0 - 2 20,971,536 20,971,536 20,971,520 16 0 - 3 31,457,304 31,457,304 31,457,280 24 0 - 4 41,943,072 41,943,072 41,943,040 32 0 - 5 52,428,840 52,428,840 52,428,800 40 0 - 6 62,914,608 62,914,608 62,914,560 48 0 - 7 73,400,376 73,400,376 73,400,320 56 0 - 8 83,886,144 83,886,144 83,886,080 64 0 - 9 94,371,912 94,371,912 94,371,840 72 0 -100.00% (94,371,840B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. -->100.00% (94,371,840B) 0x........: main (big-alloc.c:12) + 1 10,489,832 10,489,832 10,485,760 4,072 0 + 2 20,979,664 20,979,664 20,971,520 8,144 0 + 3 31,469,496 31,469,496 31,457,280 12,216 0 + 4 41,959,328 41,959,328 41,943,040 16,288 0 + 5 52,449,160 52,449,160 52,428,800 20,360 0 + 6 62,938,992 62,938,992 62,914,560 24,432 0 + 7 73,428,824 73,428,824 73,400,320 28,504 0 + 8 83,918,656 83,918,656 83,886,080 32,576 0 + 9 94,408,488 94,408,488 94,371,840 36,648 0 +99.96% (94,371,840B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. +->99.96% (94,371,840B) 0x........: main (big-alloc.c:12) -------------------------------------------------------------------------------- n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) -------------------------------------------------------------------------------- - 10 104,857,680 104,857,680 104,857,600 80 0 + 10 104,898,320 104,898,320 104,857,600 40,720 0 Added: trunk/massif/tests/big-alloc.post.exp-64bit =================================================================== --- trunk/massif/tests/big-alloc.post.exp-64bit (rev 0) +++ trunk/massif/tests/big-alloc.post.exp-64bit 2011-07-24 17:39:10 UTC (rev 11911) @@ -0,0 +1,54 @@ +-------------------------------------------------------------------------------- +Command: ./big-alloc +Massif arguments: --stacks=no --time-unit=B --massif-out-file=massif.out --ignore-fn=__part_load_locale --ignore-fn=__time_load_locale --ignore-fn=dwarf2_unwind_dyld_add_image_hook --ignore-fn=get_or_create_key_element +ms_print arguments: massif.out +-------------------------------------------------------------------------------- + + + MB +100.0^ : + | : + | @@@@@@@: + | @ : + | :::::::@ : + | : @ : + | :::::::: @ : + | : : @ : + | :::::::: : @ : + | : : : @ : + | :::::::: : : @ : + | : : : : @ : + | ::::::::: : : : @ : + | : : : : : @ : + | :::::::: : : : : @ : + | : : : : : : @ : + | :::::::: : : : : : @ : + | : : : : : : : @ : + | :::::::: : : : : : : @ : + | : : : : : : : : @ : + 0 +----------------------------------------------------------------------->MB + 0 100.0 + +Number of snapshots: 11 + Detailed snapshots: [9] + +-------------------------------------------------------------------------------- + n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) +-------------------------------------------------------------------------------- + 0 0 0 0 0 0 + 1 10,489,800 10,489,800 10,485,760 4,040 0 + 2 20,979,600 20,979,600 20,971,520 8,080 0 + 3 31,469,400 31,469,400 31,457,280 12,120 0 + 4 41,959,200 41,959,200 41,943,040 16,160 0 + 5 52,449,000 52,449,000 52,428,800 20,200 0 + 6 62,938,800 62,938,800 62,914,560 24,240 0 + 7 73,428,600 73,428,600 73,400,320 28,280 0 + 8 83,918,400 83,918,400 83,886,080 32,320 0 + 9 94,408,200 94,408,200 94,371,840 36,360 0 +99.96% (94,371,840B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. +->99.96% (94,371,840B) 0x........: main (big-alloc.c:12) + +-------------------------------------------------------------------------------- + n time(B) total(B) useful-heap(B) extra-heap(B) stacks(B) +-------------------------------------------------------------------------------- + 10 104,898,000 104,898,000 104,857,600 40,400 0 Modified: trunk/memcheck/tests/Makefile.am =================================================================== --- trunk/memcheck/tests/Makefile.am 2011-07-24 16:02:33 UTC (rev 11910) +++ trunk/memcheck/tests/Makefile.am 2011-07-24 17:39:10 UTC (rev 11911) @@ -161,6 +161,7 @@ realloc1.stderr.exp realloc1.vgtest \ realloc2.stderr.exp realloc2.vgtest \ realloc3.stderr.exp realloc3.vgtest \ + sbfragment.stdout.exp sbfragment.stderr.exp sbfragment.vgtest \ sh-mem.stderr.exp sh-mem.vgtest \ sh-mem-random.stderr.exp sh-mem-random.stdout.exp64 \ sh-mem-random.stdout.exp sh-mem-random.vgtest \ @@ -247,6 +248,7 @@ pipe pointer-trace \ post-syscall \ realloc1 realloc2 realloc3 \ + sbfragment \ sh-mem sh-mem-random \ sigaltstack signal2 sigprocmask sigkill \ strchr \ Added: trunk/memcheck/tests/sbfragment.c =================================================================== --- trunk/memcheck/tests/sbfragment.c (rev 0) +++ trunk/memcheck/tests/sbfragment.c 2011-07-24 17:39:10 UTC (rev 11911) @@ -0,0 +1,93 @@ +#include <stdlib.h> +#include <stdio.h> +#include <malloc.h> + +#define BIGINCREASE 32000 +int debug = 0; + +void stats(char *msg) +{ + struct mallinfo mallinfo_result; + mallinfo_result = mallinfo(); + /* from /usr/include/malloc.h */ + printf("%s\n", msg); + printf("%10d int arena; /* non-mmapped space allocated from system */\n", mallinfo_result.arena); + printf("%10d int ordblks; /* number of free chunks */\n", mallinfo_result.ordblks); + printf("%10d int smblks; /* number of fastbin blocks */\n", mallinfo_result.smblks); + printf("%10d int hblks; /* number of mmapped regions */\n", mallinfo_result.hblks); + printf("%10d int hblkhd; /* space in mmapped regions */\n", mallinfo_result.hblkhd); + printf("%10d int usmblks; /* maximum total allocated space */\n", mallinfo_result.usmblks); + printf("%10d int fsmblks; /* space available in freed fastbin blocks */\n", mallinfo_result.fsmblks); + printf("%10d int uordblks; /* total allocated space */\n", mallinfo_result.uordblks); + printf("%10d int fordblks; /* total free space */\n", mallinfo_result.fordblks); + printf("%10d int keepcost; /* top-most, releasable (via malloc_trim) space */\n", mallinfo_result.keepcost); + printf("\n"); +} + +int main(int argc, char *argv[]) +{ + + char *big = NULL; + + char *newbig; + int malloc_failure = 0; + unsigned long bigsize = 8; // current size of the (reallocated) big block. + int i; + int loop; + + // two optional arguments: [nr of loop] [debug] + if (argc > 1) + loop = atoi(argv[1]); + else + loop = 3000; + + if (argc > 2) + debug = 1; + + bigsize += BIGINCREASE; + big = malloc (bigsize); + if (big == NULL) + printf ("failure %d could not allocate size %lu\n", + ++malloc_failure, bigsize); + if (debug) + printf("big 0x%p\n", big); + + for (i = 0; i < loop; i++) + { + bigsize += BIGINCREASE; + newbig = malloc(bigsize); + if (newbig == NULL) + printf ("failure %d could not allocate size %lu\n", + ++malloc_failure, bigsize); + free (big); + big = newbig; + if (debug) + printf("big 0x%p\n", big); + } + + printf ("after %d loops, last size block requested %lu\n", loop, bigsize); + // verify if superblock fragmentation occured + // We consider that an arena of up to 3 times more than bigsize is ok. + { + struct mallinfo mallinfo_result; + mallinfo_result = mallinfo(); + // Under valgrind, hblkhd is 0 : all the space is in arena. + // Under native linux, some space is counted hblkhd. + if (malloc_failure > 0) + printf ("%d mallocs failed, below output is doubful\n", malloc_failure); + if (mallinfo_result.arena + mallinfo_result.hblkhd > 3 * bigsize) + printf("unexpected heap fragmentation %lu\n", + (unsigned long) mallinfo_result.arena + + (unsigned long) mallinfo_result.hblkhd); + else + printf("reasonable heap usage\n"); + } + + if (debug) + stats ("before freeing last block"); + free (big); + if (debug) + stats ("after freeing last block"); + + return 0; +} Added: trunk/memcheck/tests/sbfragment.stderr.exp =================================================================== --- trunk/memcheck/tests/sbfragment.stderr.exp (rev 0) +++ trunk/memcheck/tests/sbfragment.stderr.exp 2011-07-24 17:39:10 UTC (rev 11911) @@ -0,0 +1,10 @@ + + +HEAP SUMMARY: + in use at exit: ... bytes in ... blocks + total heap usage: ... allocs, ... frees, ... bytes allocated + +For a detailed leak analysis, rerun with: --leak-check=full + +For counts of detected and suppressed errors, rerun with: -v +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Added: trunk/memcheck/tests/sbfragment.stdout.exp =================================================================== --- trunk/memcheck/tests/sbfragment.stdout.exp (rev 0) +++ trunk/memcheck/tests/sbfragment.stdout.exp 2011-07-24 17:39:10 UTC (rev 11911) @@ -0,0 +1,2 @@ +after 3000 loops, last size block requested 96032008 +reasonable heap usage Added: trunk/memcheck/tests/sbfragment.vgtest =================================================================== --- trunk/memcheck/tests/sbfragment.vgtest (rev 0) +++ trunk/memcheck/tests/sbfragment.vgtest 2011-07-24 17:39:10 UTC (rev 11911) @@ -0,0 +1,2 @@ +prog: sbfragment +stderr_filter: filter_allocs |
|
From: <sv...@va...> - 2011-07-24 16:07:22
|
Author: sewardj
Date: 2011-07-24 17:02:33 +0100 (Sun, 24 Jul 2011)
New Revision: 11910
Log:
Add a new client request and pair of macros,
VALGRIND_{DISABLE,ENABLE}_ERROR_REPORTING, which allow a thread to
temporarily disable reporting of errors it makes. This is useful for
making Memcheck behave sanely in the presence of some MPI
implementations. Also mark up libmpiwrap.c accordingly.
Added:
trunk/memcheck/tests/err_disable1.c
trunk/memcheck/tests/err_disable1.stderr.exp
trunk/memcheck/tests/err_disable1.vgtest
trunk/memcheck/tests/err_disable2.c
trunk/memcheck/tests/err_disable2.stderr.exp
trunk/memcheck/tests/err_disable2.vgtest
trunk/memcheck/tests/err_disable3.c
trunk/memcheck/tests/err_disable3.stderr.exp
trunk/memcheck/tests/err_disable3.vgtest
trunk/memcheck/tests/err_disable4.c
trunk/memcheck/tests/err_disable4.stderr.exp
trunk/memcheck/tests/err_disable4.vgtest
Modified:
trunk/NEWS
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_syswrap/syswrap-darwin.c
trunk/coregrind/m_syswrap/syswrap-linux.c
trunk/coregrind/pub_core_threadstate.h
trunk/include/valgrind.h
trunk/memcheck/tests/Makefile.am
trunk/mpi/libmpiwrap.c
[... diff too large to include ...]
|
|
From: <sv...@va...> - 2011-07-24 14:40:50
|
Author: sewardj
Date: 2011-07-24 15:35:58 +0100 (Sun, 24 Jul 2011)
New Revision: 11909
Log:
Change this file to be a symlink to the identical version
in the 32-bit equivalent directory
(none/tests/ppc32/test_isa_2_06_part1.c). Bug #277199.
Added:
trunk/none/tests/ppc64/test_isa_2_06_part1.c
Removed:
trunk/none/tests/ppc64/test_isa_2_06_part1.c
Deleted: trunk/none/tests/ppc64/test_isa_2_06_part1.c
===================================================================
--- trunk/none/tests/ppc64/test_isa_2_06_part1.c 2011-07-24 14:20:11 UTC (rev 11908)
+++ trunk/none/tests/ppc64/test_isa_2_06_part1.c 2011-07-24 14:35:58 UTC (rev 11909)
@@ -1,2189 +0,0 @@
-/* Copyright (C) 2011 IBM
-
- Author: Maynard Johnson <may...@us...>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- 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., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
- */
-
-#ifdef HAS_VSX
-
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <malloc.h>
-#include <altivec.h>
-
-#ifndef __powerpc64__
-typedef uint32_t HWord_t;
-#else
-typedef uint64_t HWord_t;
-#endif /* __powerpc64__ */
-
-static int errors;
-register HWord_t r14 __asm__ ("r14");
-register HWord_t r15 __asm__ ("r15");
-register HWord_t r16 __asm__ ("r16");
-register HWord_t r17 __asm__ ("r17");
-register double f14 __asm__ ("fr14");
-register double f15 __asm__ ("fr15");
-register double f16 __asm__ ("fr16");
-register double f17 __asm__ ("fr17");
-
-static volatile unsigned int cond_reg;
-
-#define ALLCR "cr0","cr1","cr2","cr3","cr4","cr5","cr6","cr7"
-
-#define SET_CR(_arg) \
- __asm__ __volatile__ ("mtcr %0" : : "b"(_arg) : ALLCR );
-
-#define SET_XER(_arg) \
- __asm__ __volatile__ ("mtxer %0" : : "b"(_arg) : "xer" );
-
-#define GET_CR(_lval) \
- __asm__ __volatile__ ("mfcr %0" : "=b"(_lval) )
-
-#define GET_XER(_lval) \
- __asm__ __volatile__ ("mfxer %0" : "=b"(_lval) )
-
-#define GET_CR_XER(_lval_cr,_lval_xer) \
- do { GET_CR(_lval_cr); GET_XER(_lval_xer); } while (0)
-
-#define SET_CR_ZERO \
- SET_CR(0)
-
-#define SET_XER_ZERO \
- SET_XER(0)
-
-#define SET_CR_XER_ZERO \
- do { SET_CR_ZERO; SET_XER_ZERO; } while (0)
-
-#define SET_FPSCR_ZERO \
- do { double _d = 0.0; \
- __asm__ __volatile__ ("mtfsf 0xFF, %0" : : "f"(_d) ); \
- } while (0)
-
-
-typedef void (*test_func_t)(void);
-typedef struct ldst_test ldst_test_t;
-typedef struct vsx_logic_test logic_test_t;
-typedef struct xs_conv_test xs_conv_test_t;
-typedef struct p7_fp_test fp_test_t;
-typedef struct vx_fp_test vx_fp_test_t;
-typedef struct vsx_move_test move_test_t;
-typedef struct vsx_permute_test permute_test_t;
-typedef struct test_table test_table_t;
-
-static double *fargs = NULL;
-static int nb_fargs;
-
-/* These functions below that construct a table of floating point
- * values were lifted from none/tests/ppc32/jm-insns.c.
- */
-
-#if defined (DEBUG_ARGS_BUILD)
-#define AB_DPRINTF(fmt, args...) do { fprintf(stderr, fmt , ##args); } while (0)
-#else
-#define AB_DPRINTF(fmt, args...) do { } while (0)
-#endif
-
-static inline void register_farg (void *farg,
- int s, uint16_t _exp, uint64_t mant)
-{
- uint64_t tmp;
-
- tmp = ((uint64_t)s << 63) | ((uint64_t)_exp << 52) | mant;
- *(uint64_t *)farg = tmp;
- AB_DPRINTF("%d %03x %013llx => %016llx %0e\n",
- s, _exp, mant, *(uint64_t *)farg, *(double *)farg);
-}
-
-static void build_fargs_table(void)
-/*
- * Double precision:
- * Sign goes from zero to one (1 bit)
- * Exponent goes from 0 to ((1 << 12) - 1) (11 bits)
- * Mantissa goes from 1 to ((1 << 52) - 1) (52 bits)
- * + special values:
- * +0.0 : 0 0x000 0x0000000000000 => 0x0000000000000000
- * -0.0 : 1 0x000 0x0000000000000 => 0x8000000000000000
- * +infinity : 0 0x7FF 0x0000000000000 => 0x7FF0000000000000
- * -infinity : 1 0x7FF 0x0000000000000 => 0xFFF0000000000000
- * +QNaN : 0 0x7FF 0x7FFFFFFFFFFFF => 0x7FF7FFFFFFFFFFFF
- * -QNaN : 1 0x7FF 0x7FFFFFFFFFFFF => 0xFFF7FFFFFFFFFFFF
- * +SNaN : 0 0x7FF 0x8000000000000 => 0x7FF8000000000000
- * -SNaN : 1 0x7FF 0x8000000000000 => 0xFFF8000000000000
- * (8 values)
- *
- * Single precision
- * Sign: 1 bit
- * Exponent: 8 bits
- * Mantissa: 23 bits
- * +0.0 : 0 0x00 0x000000 => 0x00000000
- * -0.0 : 1 0x00 0x000000 => 0x80000000
- * +infinity : 0 0xFF 0x000000 => 0x7F800000
- * -infinity : 1 0xFF 0x000000 => 0xFF800000
- * +QNaN : 0 0xFF 0x3FFFFF => 0x7FBFFFFF
- * -QNaN : 1 0xFF 0x3FFFFF => 0xFFBFFFFF
- * +SNaN : 0 0xFF 0x400000 => 0x7FC00000
- * -SNaN : 1 0xFF 0x400000 => 0xFFC00000
-*/
-{
- uint64_t mant;
- uint16_t _exp, e1;
- int s;
- int i=0;
-
- if (nb_fargs)
- return;
-
- fargs = malloc( 16 * sizeof(double) );
- for (s = 0; s < 2; s++) {
- for (e1 = 0x001;; e1 = ((e1 + 1) << 13) + 7) {
- if (e1 >= 0x400)
- e1 = 0x3fe;
- _exp = e1;
- for (mant = 0x0000000000001ULL; mant < (1ULL << 52);
- /* Add 'random' bits */
- mant = ((mant + 0x4A6) << 29) + 0x359) {
- register_farg( &fargs[i++], s, _exp, mant );
- }
- if (e1 == 0x3fe)
- break;
- }
- }
- // add a few smaller values to fargs . . .
- s = 0;
- _exp = 0x002;
- mant = 0x0000000000b01ULL;
- register_farg(&fargs[i++], s, _exp, mant);
-
- _exp = 0x000;
- mant = 0x00000203f0b3dULL;
- register_farg(&fargs[i++], s, _exp, mant);
-
- mant = 0x00000005a203dULL;
- register_farg(&fargs[i++], s, _exp, mant);
-
- s = 1;
- _exp = 0x002;
- mant = 0x0000000000b01ULL;
- register_farg(&fargs[i++], s, _exp, mant);
-
- _exp = 0x000;
- mant = 0x00000203f0b3dULL;
- register_farg(&fargs[i++], s, _exp, mant);
-
- nb_fargs = i;
-}
-
-
-typedef struct ftdiv_test {
- int fra_idx;
- int frb_idx;
- int cr_flags;
-} ftdiv_test_args_t;
-
-typedef struct fp_test_args {
- int fra_idx;
- int frb_idx;
- int cr_flags;
- unsigned long long dp_bin_result;
-} fp_test_args_t;
-
-unsigned long long xscvuxddp_results[] = {
- 0x43cfec0000000000ULL,
- 0x43d013c000000000ULL,
- 0x4338000000b77501ULL,
- 0x43dffa0000000001ULL,
- 0x4372321456990000ULL,
- 0x0000000000000000ULL,
- 0x43e0000000000000ULL,
- 0x43dffc0000000000ULL,
- 0x43effe0000000000ULL,
- 0x43dffe0000000000ULL,
- 0x43efff0000000000ULL,
- 0x43dffe0000000000ULL,
- 0x43efff0000000000ULL,
- 0x43e00106800000f0ULL,
- 0x43e81a0ca1eb40f6ULL
-};
-
-unsigned long long xscvsxddp_results[] = {
- 0x43cfec0000000000ULL,
- 0x43d013c000000000ULL,
- 0x4338000000b77501ULL,
- 0x43dffa0000000001ULL,
- 0x4372321456990000ULL,
- 0x0000000000000000ULL,
- 0xc3e0000000000000ULL,
- 0x43dffc0000000000ULL,
- 0xc330000000000000ULL,
- 0x43dffe0000000000ULL,
- 0xc320000000000002ULL,
- 0x43dffe0000000000ULL,
- 0xc320000000000000ULL,
- 0xc3dffdf2fffffe20ULL,
- 0xc3cf97cd7852fc26ULL,
-};
-
-unsigned long long xscvdpsxds_results[] = {
- 0x0000000000000000ULL,
- 0x000000000000003eULL,
- 0x0000000000000000ULL,
- 0x7fffffffffffffffULL,
- 0x0000000000000000ULL,
- 0x0000000000000000ULL,
- 0x0000000000000000ULL,
- 0x7fffffffffffffffULL,
- 0x8000000000000000ULL,
- 0x8000000000000000ULL,
- 0x8000000000000000ULL,
- 0x8000000000000000ULL,
- 0x8000000000000000ULL,
- 0x0000000000000000ULL,
- 0xffffffffffffbe6cULL
-};
-
-ftdiv_test_args_t ftdiv_tests[] = {
- {0, 1, 0x8},
- {9, 1, 0xa},
- {1, 12, 0xa},
- {0, 2, 0xa},
- {1, 3, 0xa},
- {3, 0, 0xa},
- {0, 3, 0xa},
- {4, 0, 0xa},
- {7, 1, 0xe},
- {8, 1, 0xe},
- {1, 7, 0xe},
- {0, 13, 0xe},
- {5, 5, 0xe},
- {5, 6, 0xe},
-};
-
-fp_test_args_t xscmpX_tests[] = {
- {8, 8, 0x2, 0ULL},
- {8, 14, 0x8, 0ULL},
- {8, 6, 0x8, 0ULL},
- {8, 5, 0x8, 0ULL},
- {8, 4, 0x8, 0ULL},
- {8, 7, 0x8, 0ULL},
- {8, 9, 0x1, 0ULL},
- {8, 11, 0x1, 0ULL},
- {14, 8, 0x4, 0ULL},
- {14, 14, 0x2, 0ULL},
- {14, 6, 0x8, 0ULL},
- {14, 5, 0x8, 0ULL},
- {14, 4, 0x8, 0ULL},
- {14, 7, 0x8, 0ULL},
- {14, 9, 0x1, 0ULL},
- {14, 11, 0x1, 0ULL},
- {6, 8, 0x4, 0ULL},
- {6, 14, 0x4, 0ULL},
- {6, 6, 0x2, 0ULL},
- {6, 5, 0x2, 0ULL},
- {6, 4, 0x8, 0ULL},
- {6, 7, 0x8, 0ULL},
- {6, 9, 0x1, 0ULL},
- {6, 11, 0x1, 0ULL},
- {5, 8, 0x4, 0ULL},
- {5, 14, 0x4, 0ULL},
- {5, 6, 0x2, 0ULL},
- {5, 5, 0x2, 0ULL},
- {5, 4, 0x8, 0ULL},
- {5, 7, 0x8, 0ULL},
- {5, 9, 0x1, 0ULL},
- {5, 11, 0x1, 0ULL},
- {4, 8, 0x4, 0ULL},
- {4, 14, 0x4, 0ULL},
- {4, 6, 0x4, 0ULL},
- {4, 5, 0x4, 0ULL},
- {4, 1, 0x8, 0ULL},
- {4, 7, 0x8, 0ULL},
- {4, 9, 0x1, 0ULL},
- {4, 11, 0x1, 0ULL},
- {7, 8, 0x4, 0ULL},
- {7, 14, 0x4, 0ULL},
- {7, 6, 0x4, 0ULL},
- {7, 5, 0x4, 0ULL},
- {7, 4, 0x4, 0ULL},
- {7, 7, 0x2, 0ULL},
- {7, 9, 0x1, 0ULL},
- {7, 11, 0x1, 0ULL},
- {10, 8, 0x1, 0ULL},
- {10, 14, 0x1, 0ULL},
- {10, 6, 0x1, 0ULL},
- {10, 5, 0x1, 0ULL},
- {10, 4, 0x1, 0ULL},
- {10, 7, 0x1, 0ULL},
- {10, 9, 0x1, 0ULL},
- {10, 11, 0x1, 0ULL},
- {12, 8, 0x1, 0ULL},
- {12, 14, 0x1, 0ULL},
- {12, 6, 0x1, 0ULL},
- {12, 5, 0x1, 0ULL},
- {12, 4, 0x1, 0ULL},
- {12, 7, 0x1, 0ULL},
- {12, 9, 0x1, 0ULL},
- {12, 11, 0x1, 0ULL},
-};
-
-fp_test_args_t xsadddp_tests[] = {
- {8, 8, 0x0, 0xfff0000000000000ULL},
- {8, 14, 0x0, 0xfff0000000000000ULL},
- {8, 6, 0x0, 0xfff0000000000000ULL},
- {8, 5, 0x0, 0xfff0000000000000ULL},
- {8, 4, 0x0, 0xfff0000000000000ULL},
- {8, 7, 0x0, 0x7ff8000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0xfff0000000000000ULL},
- {14, 14, 0x0, 0xc0e0650f5a07b353ULL},
- {14, 6, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 5, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 4, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 7, 0x0, 0x7ff0000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0xfff0000000000000ULL},
- {6, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {6, 6, 0x0, 0x8000000000000000ULL},
- {6, 5, 0x0, 0x0000000000000000ULL},
- {6, 4, 0x0, 0x0123214569900000ULL},
- {6, 7, 0x0, 0x7ff0000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0xfff0000000000000ULL},
- {5, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {5, 6, 0x0, 0x0000000000000000ULL},
- {5, 5, 0x0, 0x0000000000000000ULL},
- {5, 4, 0x0, 0x0123214569900000ULL},
- {5, 7, 0x0, 0x7ff0000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0xfff0000000000000ULL},
- {4, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {4, 6, 0x0, 0x0123214569900000ULL},
- {4, 5, 0x0, 0x0123214569900000ULL},
- {4, 1, 0x0, 0x404f000000000000ULL},
- {4, 7, 0x0, 0x7ff0000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0x7ff8000000000000ULL},
- {7, 14, 0x0, 0x7ff0000000000000ULL},
- {7, 6, 0x0, 0x7ff0000000000000ULL},
- {7, 5, 0x0, 0x7ff0000000000000ULL},
- {7, 4, 0x0, 0x7ff0000000000000ULL},
- {7, 7, 0x0, 0x7ff0000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-fp_test_args_t xsdivdp_tests[] = {
- {8, 8, 0x0, 0x7ff8000000000000ULL},
- {8, 14, 0x0, 0x7ff0000000000000ULL},
- {8, 6, 0x0, 0x7ff0000000000000ULL},
- {8, 5, 0x0, 0xfff0000000000000ULL},
- {8, 4, 0x0, 0xfff0000000000000ULL},
- {8, 7, 0x0, 0x7ff8000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0x0000000000000000ULL},
- {14, 14, 0x0, 0x3ff0000000000000ULL},
- {14, 6, 0x0, 0x7ff0000000000000ULL},
- {14, 5, 0x0, 0xfff0000000000000ULL},
- {14, 4, 0x0, 0xff9b6cb57ca13c00ULL},
- {14, 7, 0x0, 0x8000000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0x0000000000000000ULL},
- {6, 14, 0x0, 0x0000000000000000ULL},
- {6, 6, 0x0, 0x7ff8000000000000ULL},
- {6, 5, 0x0, 0x7ff8000000000000ULL},
- {6, 4, 0x0, 0x8000000000000000ULL},
- {6, 7, 0x0, 0x8000000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0x8000000000000000ULL},
- {5, 14, 0x0, 0x8000000000000000ULL},
- {5, 6, 0x0, 0x7ff8000000000000ULL},
- {5, 5, 0x0, 0x7ff8000000000000ULL},
- {5, 4, 0x0, 0x0000000000000000ULL},
- {5, 7, 0x0, 0x0000000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0x8000000000000000ULL},
- {4, 14, 0x0, 0x8042ab59d8b6ec87ULL},
- {4, 6, 0x0, 0xfff0000000000000ULL},
- {4, 5, 0x0, 0x7ff0000000000000ULL},
- {4, 1, 0x0, 0x00c3bf3f64b5ad6bULL},
- {4, 7, 0x0, 0x0000000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0x7ff8000000000000ULL},
- {7, 14, 0x0, 0xfff0000000000000ULL},
- {7, 6, 0x0, 0xfff0000000000000ULL},
- {7, 5, 0x0, 0x7ff0000000000000ULL},
- {7, 4, 0x0, 0x7ff0000000000000ULL},
- {7, 7, 0x0, 0x7ff8000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-fp_test_args_t xsmaddXdp_tests[] = {
- {8, 8, 0x0, 0x7ff8000000000000ULL},
- {8, 14, 0x0, 0xfff0000000000000ULL},
- {8, 6, 0x0, 0x7ff0000000000000ULL},
- {8, 5, 0x0, 0xfff0000000000000ULL},
- {8, 4, 0x0, 0x7ff0000000000000ULL},
- {8, 7, 0x0, 0x7ff8000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0xfff0000000000000ULL},
- {14, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 6, 0x0, 0x41b0cc9d05eec2a7ULL},
- {14, 5, 0x0, 0x82039a19ca8fcb5fULL},
- {14, 4, 0x0, 0x41b0cc9d05eec2a7ULL},
- {14, 7, 0x0, 0x7ff0000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0xfff0000000000000ULL},
- {6, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {6, 6, 0x0, 0x0000000000000000ULL},
- {6, 5, 0x0, 0x0000000000000000ULL},
- {6, 4, 0x0, 0x0123214569900000ULL},
- {6, 7, 0x0, 0x7ff0000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0xfff0000000000000ULL},
- {5, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {5, 6, 0x0, 0x8000000000000000ULL},
- {5, 5, 0x0, 0x0000000000000000ULL},
- {5, 4, 0x0, 0x0123214569900000ULL},
- {5, 7, 0x0, 0x7ff0000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0xfff0000000000000ULL},
- {4, 14, 0x0, 0xc0d0650f5a07b353ULL},
- {4, 6, 0x0, 0x82039a19ca8fcb5fULL},
- {4, 5, 0x0, 0x0000000000000000ULL},
- {4, 1, 0x0, 0x404f000000000000ULL},
- {4, 7, 0x0, 0x7ff0000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0xfff0000000000000ULL},
- {7, 14, 0x0, 0x7ff0000000000000ULL},
- {7, 6, 0x0, 0xfff0000000000000ULL},
- {7, 5, 0x0, 0x7ff0000000000000ULL},
- {7, 4, 0x0, 0xfff0000000000000ULL},
- {7, 7, 0x0, 0x7ff0000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-fp_test_args_t xsmsubXdp_tests[] = {
- {8, 8, 0x0, 0x7ff0000000000000ULL},
- {8, 14, 0x0, 0xfff0000000000000ULL},
- {8, 6, 0x0, 0x7ff0000000000000ULL},
- {8, 5, 0x0, 0xfff0000000000000ULL},
- {8, 4, 0x0, 0x7ff0000000000000ULL},
- {8, 7, 0x0, 0xfff0000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0x7ff0000000000000ULL},
- {14, 14, 0x0, 0x40d0650f5a07b353ULL},
- {14, 6, 0x0, 0x41b0cc9d05eec2a7ULL},
- {14, 5, 0x0, 0x82039a19ca8fcb5fULL},
- {14, 4, 0x0, 0x41b0cc9d05eec2a7ULL},
- {14, 7, 0x0, 0xfff0000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0x7ff0000000000000ULL},
- {6, 14, 0x0, 0x40d0650f5a07b353ULL},
- {6, 6, 0x0, 0x0000000000000000ULL},
- {6, 5, 0x0, 0x8000000000000000ULL},
- {6, 4, 0x0, 0x8123214569900000ULL},
- {6, 7, 0x0, 0xfff0000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0x7ff0000000000000ULL},
- {5, 14, 0x0, 0x40d0650f5a07b353ULL},
- {5, 6, 0x0, 0x0000000000000000ULL},
- {5, 5, 0x0, 0x0000000000000000ULL},
- {5, 4, 0x0, 0x8123214569900000ULL},
- {5, 7, 0x0, 0xfff0000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0x7ff0000000000000ULL},
- {4, 14, 0x0, 0x40d0650f5a07b353ULL},
- {4, 6, 0x0, 0x82039a19ca8fcb5fULL},
- {4, 5, 0x0, 0x0000000000000000ULL},
- {4, 1, 0x0, 0xc04f000000000000ULL},
- {4, 7, 0x0, 0xfff0000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0x7ff8000000000000ULL},
- {7, 14, 0x0, 0x7ff0000000000000ULL},
- {7, 6, 0x0, 0xfff0000000000000ULL},
- {7, 5, 0x0, 0x7ff0000000000000ULL},
- {7, 4, 0x0, 0xfff0000000000000ULL},
- {7, 7, 0x0, 0x7ff8000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-fp_test_args_t xsnmaddXdp_tests[] = {
- {8, 8, 0x0, 0x7ff8000000000000ULL},
- {8, 14, 0x0, 0x7ff0000000000000ULL},
- {8, 6, 0x0, 0xfff0000000000000ULL},
- {8, 5, 0x0, 0x7ff0000000000000ULL},
- {8, 4, 0x0, 0xfff0000000000000ULL},
- {8, 7, 0x0, 0x7ff8000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0x7ff0000000000000ULL},
- {14, 14, 0x0, 0x40d0650f5a07b353ULL},
- {14, 6, 0x0, 0xc1b0cc9d05eec2a7ULL},
- {14, 5, 0x0, 0x02039a19ca8fcb5fULL},
- {14, 4, 0x0, 0xc1b0cc9d05eec2a7ULL},
- {14, 7, 0x0, 0xfff0000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0x7ff0000000000000ULL},
- {6, 14, 0x0, 0x40d0650f5a07b353ULL},
- {6, 6, 0x0, 0x8000000000000000ULL},
- {6, 5, 0x0, 0x8000000000000000ULL},
- {6, 4, 0x0, 0x8123214569900000ULL},
- {6, 7, 0x0, 0xfff0000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0x7ff0000000000000ULL},
- {5, 14, 0x0, 0x40d0650f5a07b353ULL},
- {5, 6, 0x0, 0x0000000000000000ULL},
- {5, 5, 0x0, 0x8000000000000000ULL},
- {5, 4, 0x0, 0x8123214569900000ULL},
- {5, 7, 0x0, 0xfff0000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0x7ff0000000000000ULL},
- {4, 14, 0x0, 0x40d0650f5a07b353ULL},
- {4, 6, 0x0, 0x02039a19ca8fcb5fULL},
- {4, 5, 0x0, 0x8000000000000000ULL},
- {4, 1, 0x0, 0xc04f000000000000ULL},
- {4, 7, 0x0, 0xfff0000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0x7ff0000000000000ULL},
- {7, 14, 0x0, 0xfff0000000000000ULL},
- {7, 6, 0x0, 0x7ff0000000000000ULL},
- {7, 5, 0x0, 0xfff0000000000000ULL},
- {7, 4, 0x0, 0x7ff0000000000000ULL},
- {7, 7, 0x0, 0xfff0000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-fp_test_args_t xsmuldp_tests[] = {
- {8, 8, 0x0, 0x7ff0000000000000ULL},
- {8, 14, 0x0, 0x7ff0000000000000ULL},
- {8, 6, 0x0, 0x7ff8000000000000ULL},
- {8, 5, 0x0, 0x7ff8000000000000ULL},
- {8, 4, 0x0, 0xfff0000000000000ULL},
- {8, 7, 0x0, 0xfff0000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0x7ff0000000000000ULL},
- {14, 14, 0x0, 0x41b0cc9d05eec2a7ULL},
- {14, 6, 0x0, 0x0000000000000000ULL},
- {14, 5, 0x0, 0x8000000000000000ULL},
- {14, 4, 0x0, 0x82039a19ca8fcb5fULL},
- {14, 7, 0x0, 0xfff0000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0x7ff8000000000000ULL},
- {6, 14, 0x0, 0x0000000000000000ULL},
- {6, 6, 0x0, 0x0000000000000000ULL},
- {6, 5, 0x0, 0x8000000000000000ULL},
- {6, 4, 0x0, 0x8000000000000000ULL},
- {6, 7, 0x0, 0x7ff8000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0x7ff8000000000000ULL},
- {5, 14, 0x0, 0x8000000000000000ULL},
- {5, 6, 0x0, 0x8000000000000000ULL},
- {5, 5, 0x0, 0x0000000000000000ULL},
- {5, 4, 0x0, 0x0000000000000000ULL},
- {5, 7, 0x0, 0x7ff8000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0xfff0000000000000ULL},
- {4, 14, 0x0, 0x82039a19ca8fcb5fULL},
- {4, 6, 0x0, 0x8000000000000000ULL},
- {4, 5, 0x0, 0x0000000000000000ULL},
- {4, 1, 0x0, 0x0182883b3e438000ULL},
- {4, 7, 0x0, 0x7ff0000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0xfff0000000000000ULL},
- {7, 14, 0x0, 0xfff0000000000000ULL},
- {7, 6, 0x0, 0x7ff8000000000000ULL},
- {7, 5, 0x0, 0x7ff8000000000000ULL},
- {7, 4, 0x0, 0x7ff0000000000000ULL},
- {7, 7, 0x0, 0x7ff0000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-fp_test_args_t xssubdp_tests[] = {
- {8, 8, 0x0, 0x7ff8000000000000ULL},
- {8, 14, 0x0, 0xfff0000000000000ULL},
- {8, 6, 0x0, 0xfff0000000000000ULL},
- {8, 5, 0x0, 0xfff0000000000000ULL},
- {8, 4, 0x0, 0xfff0000000000000ULL},
- {8, 7, 0x0, 0xfff0000000000000ULL},
- {8, 9, 0x0, 0x7fffffffffffffffULL},
- {8, 11, 0x0, 0x7ff8000000000000ULL},
- {14, 8, 0x0, 0x7ff0000000000000ULL},
- {14, 14, 0x0, 0x0000000000000000ULL},
- {14, 6, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 5, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 4, 0x0, 0xc0d0650f5a07b353ULL},
- {14, 7, 0x0, 0xfff0000000000000ULL},
- {14, 9, 0x0, 0x7fffffffffffffffULL},
- {14, 11, 0x0, 0x7ff8000000000000ULL},
- {6, 8, 0x0, 0x7ff0000000000000ULL},
- {6, 14, 0x0, 0x40d0650f5a07b353ULL},
- {6, 6, 0x0, 0x0000000000000000ULL},
- {6, 5, 0x0, 0x8000000000000000ULL},
- {6, 4, 0x0, 0x8123214569900000ULL},
- {6, 7, 0x0, 0xfff0000000000000ULL},
- {6, 9, 0x0, 0x7fffffffffffffffULL},
- {6, 11, 0x0, 0x7ff8000000000000ULL},
- {5, 8, 0x0, 0x7ff0000000000000ULL},
- {5, 14, 0x0, 0x40d0650f5a07b353ULL},
- {5, 6, 0x0, 0x0000000000000000ULL},
- {5, 5, 0x0, 0x0000000000000000ULL},
- {5, 4, 0x0, 0x8123214569900000ULL},
- {5, 7, 0x0, 0xfff0000000000000ULL},
- {5, 9, 0x0, 0x7fffffffffffffffULL},
- {5, 11, 0x0, 0x7ff8000000000000ULL},
- {4, 8, 0x0, 0x7ff0000000000000ULL},
- {4, 14, 0x0, 0x40d0650f5a07b353ULL},
- {4, 6, 0x0, 0x0123214569900000ULL},
- {4, 5, 0x0, 0x0123214569900000ULL},
- {4, 1, 0x0, 0xc04f000000000000ULL},
- {4, 7, 0x0, 0xfff0000000000000ULL},
- {4, 9, 0x0, 0x7fffffffffffffffULL},
- {4, 11, 0x0, 0x7ff8000000000000ULL},
- {7, 8, 0x0, 0x7ff0000000000000ULL},
- {7, 14, 0x0, 0x7ff0000000000000ULL},
- {7, 6, 0x0, 0x7ff0000000000000ULL},
- {7, 5, 0x0, 0x7ff0000000000000ULL},
- {7, 4, 0x0, 0x7ff0000000000000ULL},
- {7, 7, 0x0, 0x7ff8000000000000ULL},
- {7, 9, 0x0, 0x7fffffffffffffffULL},
- {7, 11, 0x0, 0x7ff8000000000000ULL},
- {10, 8, 0x0, 0xffffffffffffffffULL},
- {10, 14, 0x0, 0xffffffffffffffffULL},
- {10, 6, 0x0, 0xffffffffffffffffULL},
- {10, 5, 0x0, 0xffffffffffffffffULL},
- {10, 4, 0x0, 0xffffffffffffffffULL},
- {10, 7, 0x0, 0xffffffffffffffffULL},
- {10, 9, 0x0, 0xffffffffffffffffULL},
- {10, 11, 0x0, 0xffffffffffffffffULL},
- {12, 8, 0x0, 0xfff8000000000000ULL},
- {12, 14, 0x0, 0xfff8000000000000ULL},
- {12, 6, 0x0, 0xfff8000000000000ULL},
- {12, 5, 0x0, 0xfff8000000000000ULL},
- {12, 4, 0x0, 0xfff8000000000000ULL},
- {12, 7, 0x0, 0xfff8000000000000ULL},
- {12, 9, 0x0, 0xfff8000000000000ULL},
- {12, 11, 0x0, 0xfff8000000000000ULL},
-};
-
-
-
-static int nb_special_fargs;
-static double * spec_fargs;
-
-static void build_special_fargs_table(void)
-{
- /* The special floating point values created below are for
- * use in the ftdiv tests for setting the fe_flag and fg_flag,
- * but they can also be used for other tests (e.g., xscmpudp).
- *
- * Note that fl_flag is 'always '1' on ppc64 Linux.
- *
- Entry Sign Exp fraction Special value
- 0 0 3fd 0x8000000000000ULL Positive finite number
- 1 0 404 0xf000000000000ULL ...
- 2 0 001 0x8000000b77501ULL ...
- 3 0 7fe 0x800000000051bULL ...
- 4 0 012 0x3214569900000ULL ...
- 5 0 000 0x0000000000000ULL +0.0 (+zero)
- 6 1 000 0x0000000000000ULL -0.0 (-zero)
- 7 0 7ff 0x0000000000000ULL +infinity
- 8 1 7ff 0x0000000000000ULL -infinity
- 9 0 7ff 0x7FFFFFFFFFFFFULL +QNaN
- 10 1 7ff 0x7FFFFFFFFFFFFULL -QNaN
- 11 0 7ff 0x8000000000000ULL +SNaN
- 12 1 7ff 0x8000000000000ULL -SNaN
- 13 1 000 0x8340000078000ULL Denormalized val (zero exp and non-zero fraction)
- 14 1 40d 0x0650f5a07b353ULL Negative finite number
- */
-
- uint64_t mant;
- uint16_t _exp;
- int s;
- int i = 0;
-
- if (spec_fargs)
- return;
-
- spec_fargs = malloc( 16 * sizeof(double) );
-
- // #0
- s = 0;
- _exp = 0x3fd;
- mant = 0x8000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- // #1
- s = 0;
- _exp = 0x404;
- mant = 0xf000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* None of the ftdiv tests succeed.
- * FRA = value #0; FRB = value #1
- * ea_ = -2; e_b = 5
- * fl_flag || fg_flag || fe_flag = 100
- */
-
- /*************************************************
- * fe_flag tests
- *
- *************************************************/
-
- /* fe_flag <- 1 if FRA is a NaN
- * FRA = value #9; FRB = value #1
- * e_a = 1024; e_b = 5
- * fl_flag || fg_flag || fe_flag = 101
- */
-
- /* fe_flag <- 1 if FRB is a NaN
- * FRA = value #1; FRB = value #12
- * e_a = 5; e_b = 1024
- * fl_flag || fg_flag || fe_flag = 101
- */
-
- /* fe_flag <- 1 if e_b <= -1022
- * FRA = value #0; FRB = value #2
- * e_a = -2; e_b = -1022
- * fl_flag || fg_flag || fe_flag = 101
- *
- */
- // #2
- s = 0;
- _exp = 0x001;
- mant = 0x8000000b77501ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* fe_flag <- 1 if e_b >= 1021
- * FRA = value #1; FRB = value #3
- * e_a = 5; e_b = 1023
- * fl_flag || fg_flag || fe_flag = 101
- */
- // #3
- s = 0;
- _exp = 0x7fe;
- mant = 0x800000000051bULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* fe_flag <- 1 if FRA != 0 && e_a - e_b >= 1023
- * Let FRA = value #3 and FRB be value #0.
- * e_a = 1023; e_b = -2
- * fl_flag || fg_flag || fe_flag = 101
- */
-
- /* fe_flag <- 1 if FRA != 0 && e_a - e_b <= -1023
- * Let FRA = value #0 above and FRB be value #3 above
- * e_a = -2; e_b = 1023
- * fl_flag || fg_flag || fe_flag = 101
- */
-
- /* fe_flag <- 1 if FRA != 0 && e_a <= -970
- * Let FRA = value #4 and FRB be value #0
- * e_a = -1005; e_b = -2
- * fl_flag || fg_flag || fe_flag = 101
- */
- // #4
- s = 0;
- _exp = 0x012;
- mant = 0x3214569900000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /*************************************************
- * fg_flag tests
- *
- *************************************************/
- /* fg_flag <- 1 if FRA is an Infinity
- * NOTE: FRA = Inf also sets fe_flag
- * Do two tests, using values #7 and #8 (+/- Inf) for FRA.
- * Test 1:
- * Let FRA be value #7 and FRB be value #1
- * e_a = 1024; e_b = 5
- * fl_flag || fg_flag || fe_flag = 111
- *
- * Test 2:
- * Let FRA be value #8 and FRB be value #1
- * e_a = 1024; e_b = 5
- * fl_flag || fg_flag || fe_flag = 111
- *
- */
-
- /* fg_flag <- 1 if FRB is an Infinity
- * NOTE: FRB = Inf also sets fe_flag
- * Let FRA be value #1 and FRB be value #7
- * e_a = 5; e_b = 1024
- * fl_flag || fg_flag || fe_flag = 111
- */
-
- /* fg_flag <- 1 if FRB is denormalized
- * NOTE: e_b < -1022 ==> fe_flag <- 1
- * Let FRA be value #0 and FRB be value #13
- * e_a = -2; e_b = -1023
- * fl_flag || fg_flag || fe_flag = 111
- */
-
- /* fg_flag <- 1 if FRB is +zero
- * NOTE: FRA = Inf also sets fe_flag
- * Let FRA = val #5; FRB = val #5
- * ea_ = -1023; e_b = -1023
- * fl_flag || fg_flag || fe_flag = 111
- */
-
- /* fg_flag <- 1 if FRB is -zero
- * NOTE: FRA = Inf also sets fe_flag
- * Let FRA = val #5; FRB = val #6
- * ea_ = -1023; e_b = -1023
- * fl_flag || fg_flag || fe_flag = 111
- */
-
- /* Special values */
- /* +0.0 : 0 0x000 0x0000000000000 */
- // #5
- s = 0;
- _exp = 0x000;
- mant = 0x0000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* -0.0 : 1 0x000 0x0000000000000 */
- // #6
- s = 1;
- _exp = 0x000;
- mant = 0x0000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* +infinity : 0 0x7FF 0x0000000000000 */
- // #7
- s = 0;
- _exp = 0x7FF;
- mant = 0x0000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* -infinity : 1 0x7FF 0x0000000000000 */
- // #8
- s = 1;
- _exp = 0x7FF;
- mant = 0x0000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* +QNaN : 0 0x7FF 0x7FFFFFFFFFFFF */
- // #9
- s = 0;
- _exp = 0x7FF;
- mant = 0x7FFFFFFFFFFFFULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* -QNaN : 1 0x7FF 0x7FFFFFFFFFFFF */
- // #10
- s = 1;
- _exp = 0x7FF;
- mant = 0x7FFFFFFFFFFFFULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* +SNaN : 0 0x7FF 0x8000000000000 */
- // #11
- s = 0;
- _exp = 0x7FF;
- mant = 0x8000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* -SNaN : 1 0x7FF 0x8000000000000 */
- // #12
- s = 1;
- _exp = 0x7FF;
- mant = 0x8000000000000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* denormalized value */
- // #13
- s = 1;
- _exp = 0x000;
- mant = 0x8340000078000ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- /* Negative finite number */
- // #14
- s = 1;
- _exp = 0x40d;
- mant = 0x0650f5a07b353ULL;
- register_farg(&spec_fargs[i++], s, _exp, mant);
-
- nb_special_fargs = i;
-}
-
-
-struct test_table
-{
- test_func_t test_category;
- char * name;
-};
-
-struct p7_fp_test
-{
- test_func_t test_func;
- const char *name;
- int single; // 1=single precision result; 0=double precision result
-};
-
-typedef enum {
- VX_FP_CMP,
- VX_FP_SMA,
- VX_FP_SMS,
- VX_FP_SNMA,
- VX_FP_OTHER
-} vx_fp_test_type;
-
-struct vx_fp_test
-{
- test_func_t test_func;
- const char *name;
- fp_test_args_t * targs;
- int num_tests;
- vx_fp_test_type test_type;
-};
-
-struct xs_conv_test
-{
- test_func_t test_func;
- const char *name;
- unsigned long long * results;
- int num_tests;
-};
-
-typedef enum {
- VSX_LOAD =1,
- VSX_LOAD_SPLAT,
- VSX_STORE
-} vsx_ldst_type;
-
-struct ldst_test
-{
- test_func_t test_func;
- const char *name;
- void * base_addr;
- uint32_t offset;
- int num_words_to_process;
- vsx_ldst_type type;
-};
-
-typedef enum {
- VSX_AND = 1,
- VSX_XOR,
- VSX_ANDC,
- VSX_OR,
- VSX_NOR
-} vsx_log_op;
-
-struct vsx_logic_test
-{
- test_func_t test_func;
- const char *name;
- vsx_log_op op;
-};
-
-struct vsx_move_test
-{
- test_func_t test_func;
- const char *name;
- int xa_idx, xb_idx;
- unsigned long long expected_result;
-};
-
-struct vsx_permute_test
-{
- test_func_t test_func;
- const char *name;
- unsigned int xa[4];
- unsigned int xb[4];
- unsigned int expected_output[4];
-};
-
-static vector unsigned int vec_out, vec_inA, vec_inB;
-
-static void test_lxsdx(void)
-{
- __asm__ __volatile__ ("lxsdx %x0, %1, %2" : "=wa" (vec_out): "b" (r14),"r" (r15));
-}
-
-static void
-test_lxvd2x(void)
-{
- __asm__ __volatile__ ("lxvd2x %x0, %1, %2" : "=wa" (vec_out): "b" (r14),"r" (r15));
-}
-
-static void test_lxvdsx(void)
-{
- __asm__ __volatile__ ("lxvdsx %x0, %1, %2" : "=wa" (vec_out): "b" (r14),"r" (r15));
-}
-
-static void test_lxvw4x(void)
-{
- __asm__ __volatile__ ("lxvw4x %x0, %1, %2" : "=wa" (vec_out): "b" (r14),"r" (r15));
-}
-
-static void test_stxsdx(void)
-{
- __asm__ __volatile__ ("stxsdx %x0, %1, %2" : : "wa" (vec_inA), "b" (r14),"r" (r15));
-}
-
-static void test_stxvd2x(void)
-{
- __asm__ __volatile__ ("stxvd2x %x0, %1, %2" : : "wa" (vec_inA), "b" (r14),"r" (r15));
-}
-
-static void test_stxvw4x(void)
-{
- __asm__ __volatile__ ("stxvw4x %x0, %1, %2" : : "wa" (vec_inA), "b" (r14),"r" (r15));
-}
-
-static void test_xxlxor(void)
-{
- __asm__ __volatile__ ("xxlxor %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxlor(void)
-{
- __asm__ __volatile__ ("xxlor %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxlnor(void)
-{
- __asm__ __volatile__ ("xxlnor %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxland(void)
-{
- __asm__ __volatile__ ("xxland %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxlandc(void)
-{
- __asm__ __volatile__ ("xxlandc %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxmrghw(void)
-{
- __asm__ __volatile__ ("xxmrghw %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxmrglw(void)
-{
- __asm__ __volatile__ ("xxmrglw %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxpermdi_00(void)
-{
- __asm__ __volatile__ ("xxpermdi %x0, %x1, %x2, 0x0" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxpermdi_01(void)
-{
- __asm__ __volatile__ ("xxpermdi %x0, %x1, %x2, 0x1" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxpermdi_10(void)
-{
- __asm__ __volatile__ ("xxpermdi %x0, %x1, %x2, 0x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxpermdi_11(void)
-{
- __asm__ __volatile__ ("xxpermdi %x0, %x1, %x2, 0x3" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxsldwi_0(void)
-{
- __asm__ __volatile__ ("xxsldwi %x0, %x1, %x2, 0" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxsldwi_1(void)
-{
- __asm__ __volatile__ ("xxsldwi %x0, %x1, %x2, 1" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxsldwi_2(void)
-{
- __asm__ __volatile__ ("xxsldwi %x0, %x1, %x2, 2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xxsldwi_3(void)
-{
- __asm__ __volatile__ ("xxsldwi %x0, %x1, %x2, 3" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_fcfids (void)
-{
- __asm__ __volatile__ ("fcfids %0, %1" : "=f" (f17): "d" (f14));
-}
-
-static void test_fcfidus (void)
-{
- __asm__ __volatile__ ("fcfidus %0, %1" : "=f" (f17): "d" (f14));
-}
-
-static void test_fcfidu (void)
-{
- __asm__ __volatile__ ("fcfidu %0, %1" : "=f" (f17): "d" (f14));
-}
-
-static void test_xsabsdp (void)
-{
- __asm__ __volatile__ ("xsabsdp %x0, %x1" : "=wa" (vec_out): "wa" (vec_inB));
-}
-
-static void test_xscpsgndp (void)
-{
- __asm__ __volatile__ ("xscpsgndp %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xsnabsdp (void)
-{
- __asm__ __volatile__ ("xsnabsdp %x0, %x1" : "=wa" (vec_out): "wa" (vec_inB));
-}
-
-static void test_xsnegdp (void)
-{
- __asm__ __volatile__ ("xsnegdp %x0, %x1" : "=wa" (vec_out): "wa" (vec_inB));
-}
-
-static int do_cmpudp;
-static void test_xscmp (void)
-{
- if (do_cmpudp)
- __asm__ __volatile__ ("xscmpudp cr1, %x0, %x1" : : "wa" (vec_inA),"wa" (vec_inB));
- else
- __asm__ __volatile__ ("xscmpodp cr1, %x0, %x1" : : "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xsadddp(void)
-{
- __asm__ __volatile__ ("xsadddp %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static void test_xsdivdp(void)
-{
- __asm__ __volatile__ ("xsdivdp %x0, %x1, %x2" : "=wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
-}
-
-static int do_adp;
-static void test_xsmadd(void)
-{
- if (do_adp)
- __asm__ __volatile__ ("xsmaddadp %x0, %x1, %x2" : "+wa" (vec_out): "wa" (vec_inA),"wa" (vec_inB));
- else
- __asm_...
[truncated message content] |
|
From: <sv...@va...> - 2011-07-24 14:25:03
|
Author: sewardj Date: 2011-07-24 15:20:11 +0100 (Sun, 24 Jul 2011) New Revision: 11908 Log: Add support for IBM Power ISA 2.06 -- stage 2 (testcases). Bug 276784. (Maynard Johnson, may...@us...) Added: trunk/none/tests/ppc32/test_isa_2_06_part2.c trunk/none/tests/ppc32/test_isa_2_06_part2.stderr.exp trunk/none/tests/ppc32/test_isa_2_06_part2.stdout.exp trunk/none/tests/ppc32/test_isa_2_06_part2.vgtest trunk/none/tests/ppc64/test_isa_2_06_part2.c trunk/none/tests/ppc64/test_isa_2_06_part2.stderr.exp trunk/none/tests/ppc64/test_isa_2_06_part2.stdout.exp trunk/none/tests/ppc64/test_isa_2_06_part2.vgtest Modified: trunk/none/tests/ppc32/Makefile.am trunk/none/tests/ppc64/Makefile.am [... diff too large to include ...] |
|
From: <sv...@va...> - 2011-07-24 14:20:44
|
Author: sewardj
Date: 2011-07-24 15:15:54 +0100 (Sun, 24 Jul 2011)
New Revision: 11907
Log:
Add support for IBM Power ISA 2.06 -- stage 2 (handle new
primops in Memcheck). Bug 276784.
(Maynard Johnson, may...@us...)
Modified:
trunk/memcheck/mc_translate.c
Modified: trunk/memcheck/mc_translate.c
===================================================================
--- trunk/memcheck/mc_translate.c 2011-07-21 20:24:54 UTC (rev 11906)
+++ trunk/memcheck/mc_translate.c 2011-07-24 14:15:54 UTC (rev 11907)
@@ -2952,6 +2952,7 @@
case Iop_RoundF64toInt:
case Iop_RoundF64toF32:
case Iop_F64toI64S:
+ case Iop_F64toI64U:
case Iop_I64StoF64:
case Iop_I64UtoF64:
case Iop_SinF64:
@@ -3050,10 +3051,12 @@
case Iop_Sad8Ux4: /* maybe we could do better? ftm, do mkLazy2. */
case Iop_DivS32:
case Iop_DivU32:
+ case Iop_DivU32E:
return mkLazy2(mce, Ity_I32, vatom1, vatom2);
case Iop_DivS64:
case Iop_DivU64:
+ case Iop_DivS64E:
return mkLazy2(mce, Ity_I64, vatom1, vatom2);
case Iop_Add32:
@@ -3306,6 +3309,7 @@
return mkPCastTo(mce, Ity_I32, vatom);
case Iop_1Uto64:
+ case Iop_1Sto64:
case Iop_8Uto64:
case Iop_8Sto64:
case Iop_16Uto64:
@@ -3347,6 +3351,7 @@
return assignNew('V', mce, Ity_I16, unop(op, vatom));
case Iop_1Uto8:
+ case Iop_1Sto8:
case Iop_16to8:
case Iop_16HIto8:
case Iop_32to8:
|
|
From: <sv...@va...> - 2011-07-24 14:18:10
|
Author: sewardj Date: 2011-07-24 15:13:21 +0100 (Sun, 24 Jul 2011) New Revision: 2184 Log: Add support for IBM Power ISA 2.06 -- stage 2. Bug 276784. (Maynard Johnson, may...@us...) Modified: trunk/priv/guest_ppc_defs.h trunk/priv/guest_ppc_toIR.c trunk/priv/host_ppc_defs.c trunk/priv/host_ppc_defs.h trunk/priv/host_ppc_isel.c trunk/priv/ir_defs.c trunk/pub/libvex_ir.h [... diff too large to include ...] |