summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'wip-signed-integer-overflow-cppcheck' into 'master'HEADmasterLoic Dachary2017-04-104-4/+4
|\ | | | | | | | | | | | | | | Wip signed integer overflow cppcheck Fix for cppcheck signed integer overflow errors See merge request !21
| * Resolve cppcheck Signed integer overflow errorsBrad Hubbard2017-04-104-4/+4
|/ | | | | | | | | | The type of expression '1<<31' is signed int and this causes cppcheck to issue the following warning. src/gf_w32.c:681]: (error) Signed integer overflow for expression '1<<31'. Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
* Merge branch 'wip-18092' into 'master'Loic Dachary2016-12-081-5/+17
|\ | | | | | | | | | | gf_cpu.c: fix pclmul detection and add portable cpuid feature bit defs See merge request !20
| * gf_cpu.c: fix pclmul detection and add portable cpuid feature bit defsJohn Coyle2016-12-071-5/+17
|/ | | | | | | Correct invalid check for pclmul support. Was checking SSE3 (1 << 0) vs. PCLMUL (1 << 1). Fixes: http://tracker.ceph.com/issues/18092 Signed-off-by: John Coyle <dx9err@gmail.com>
* Merge branch 'gf32-mul-silence-warning' into 'master'Loic Dachary2016-11-231-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gf32 mul silence warning silence warning like ``` /slow/kchai/ceph/src/erasure-code/jerasure/gf-complete/src/gf_w32.c: In function ‘gf_w32_cfmgk_multiply_region_from_single’: /slow/kchai/ceph/src/erasure-code/jerasure/gf-complete/src/gf_w32.c:410:5: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized] g = _mm_insert_epi64 (a, g_star, 0); ^ ``` See merge request !19
| * gf_w32.c: silence the -Wmaybe-uninitialized warningKefu Chai2016-11-181-1/+1
|/ | | | | | | | | | | | | | | | | | | | | in gf_w32_cfmgk_multiply_region_from_single(), follow warning is reported by gcc: gf-complete/src/gf_w32.c:410:5: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized] g = _mm_insert_epi64 (a, g_star, 0); ^ actually, we are using `a` as a dummy parameter for initializing `g` and `q`. and only the lower lower 64 bits of them are used when doing calculation. but their lower 64 bits are always initialized using _mm_insert_epi64(). so this is a false alarm. but we can silence this warning by moving the statement initializing `a` up before passing it to _mm_insert_epi64(). this change does not hurt the performance. Signed-off-by: Kefu Chai <kchai@redhat.com>
* Merge branch 'simd-runtime-detection' into 'master'bassamtabbara2016-09-1432-2932/+1699
|\ | | | | | | | | | | | | | | | | | | | | | | Support for runtime detection of SIMD This merge request adds support for runtime SIMD detection. The idea is that you would build gf-complete with full SIMD support, and gf_init will select the appropriate function at runtime based on the capabilities of the target machine. This would eliminate the need to build different versions of the code for different processors (you still need to build for different archs). Ceph for example has 3-4 flavors of jerasure on Intel (and does not support PCLMUL optimizations as a result of using to many binaries). Numerous libraries have followed as similar approach include zlib. When reviewing this merge request I recommend that you look at each of the 5 commits independently. The first 3 commits don't change the existing logic. Instead they add debugging functions and test scripts that facilitate testing of the 4th and commit. The 4th commit is where all the new logic goes along with tests. The 5th commit fixes build scripts. I've tested this on x86_64, arm, and aarch64 using QEMU. Numerous tests have been added that help this code and could help with future testing of gf-complete. Also I've compared the functions selected with the old code (prior to runtime SIMD support) with the new code and all functions are identical. Here's a gist with the test results prior to SIMD extensions: https://gist.github.com/bassamtabbara/d9a6dcf0a749b7ab01bc2953a359edec. See merge request !18
| * Added --enable flags for debugging runtime SIMDBassam Tabbara2016-09-132-14/+23
| |
| * gf_multby_one now checks runtime SIMD supportBassam Tabbara2016-09-131-63/+65
| |
| * Simplify SIMD make scriptsBassam Tabbara2016-09-139-434/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ax_ext.m4 no longer performs any CPU checks. Instead it just checks if the the compile supports SIMD flags. Runtime detection will choose the right methods base on CPU instructions available. Intel AVX support is still done through the build since it would require a major refactoring of the code base to support it at runtime. For now I added a configuration flag --enable-avx that can be used to compile with AVX support. Also use cpu intrinsics instead of __asm__
| * Support for runtime SIMD detectionBassam Tabbara2016-09-1313-377/+810
| | | | | | | | | | | | | | | | | | | | This commits adds support for runtime detection of SIMD instructions. The idea is that you would build once with all supported SIMD functions and the same binaries could run on different machines with varying support for SIMD. At runtime gf-complete will select the right functions based on the processor. gf_cpu.c has the logic to detect SIMD instructions. On Intel processors this is done through cpuid. For ARM on linux we use getauxv. The logic in gf_w*.c has been changed to check for runtime SIMD support and fallback to generic code. Also a new test has been added. It compares the functions selected by gf_init when we enable/disable SIMD support through build flags, with runtime enabling/disabling. The test checks if the results are identical.
| * Add SIMD test helpersBassam Tabbara2016-09-133-1/+381
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a couple of scripts that help test SIMD functionality on different machines through QEMU. tools/test_simd_qemu.sh will automatically start qemu, run tests and stop it. it uses the Ubuntu cloud images which are built for x86_64, arm and arm64. tools/test_simd.sh run a number of tests including compiling with different flags, unit tests, and gathering the functions selected in gf_init (and when compiling with DEBUG_FUNCTIONS)
| * Add support for printing functions selected in gf_initBassam Tabbara2016-09-1314-386/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is currently no way to figure out which functions were selected during gf_init and as a result of SIMD options. This is not even possible in gdb since most functions are static. This commit adds a new macro SET_FUNCTION that records the name of the function selected during init inside the gf_internal structure. This macro only works when DEBUG_FUNCTIONS is defined during compile. Otherwise the code works exactly as it did before this change. The names of selected functions will be used during testing of SIMD runtime detection. All calls such as: gf->multiply.w32 = gf_w16_shift_multiply; need to be replaced with the following: SET_FUNCTION(gf,multiply,w32,gf_w16_shift_multiply) Also added a new flag to tools/gf_methods that will print the names of functions selected during gf_init.
| * Remove generated autotools files from the build. Also updateBassam Tabbara2016-09-136-1743/+7
|/ | | | .gitignore to ignore some autotools files and tests.
* Merge branch 'wip-valgrind' into 'master'Loic Dachary2016-09-134-2/+16
|\ | | | | | | | | | | enable valgrind for tests See merge request !9
| * log-zero-ext: workaround for uninitialized memoryLoic Dachary2016-09-131-1/+2
| | | | | | | | | | | | Workaround until issue #13 is dealt with. Signed-off-by: Loic Dachary <loic@dachary.org>
| * increase the verbosity of make check failuresLoic Dachary2016-09-131-0/+2
| | | | | | | | Signed-off-by: Loic Dachary <loic@dachary.org>
| * add --enable-valgrind for make checkLoic Dachary2016-09-132-1/+11
| | | | | | | | | | | | | | If --enable-valgrind is given to ./configure, all tests are run with valgrind set to fail if an error is reported ( --error-exitcode=1 ) Signed-off-by: Loic Dachary <loic@dachary.org>
| * do not memcpy if src and dst are the sameLoic Dachary2016-09-131-1/+2
| | | | | | | | | | | | This is harmless really but triggers a valgrind error. Signed-off-by: Loic Dachary <loic@dachary.org>
* | Merge branch 'neon_fixes' into 'master'Loic Dachary2016-09-132-139/+59
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | NEON fixes/tweaks This merge request fixes some issues and adds some tweaks to NEON code: * SPLIT(16,4) ALTMAP implementation was broken as it only processed half the amount of data. As such, this fixed implementation is significantly slower than the old code (which is to be expected). Fixes #2 * SPLIT(16,4) implementations now merge the ARMv8 and older code path, similar to SPLIT(32,4). This fixes the ALTMAP variant, and also enables the non-ALTMAP version to have consistent sizing * Unnecessary VTRN removed in non-ALTMAP SPLIT(16,4) as NEON allows (de)interleaving during load/store; because of this, ALTMAP isn't so useful in NEON * This can also be done for SPLIT(32,4), but I have not implemented it * I also pulled the `if(xor)` conditional from non-ALTMAP SPLIT(16,4) to outside the loop. It seems to improve performance a bit on my Cortex A7 * It probably should be implemented everywhere else, but I have not done this * CARRY_FREE was incorrectly enabled on all sizes of w, when it's only available for w=4 and w=8 See merge request !16
| * Move conditional outside loop for NEON SPLIT4 implementationanimetosho2015-11-141-6/+29
| | | | | | | | Seems to improve performance a fair bit
| * Eliminate unnecessary VTRNs in SPLIT(16,4) NEON implementationanimetosho2015-11-121-79/+22
| | | | | | | | Also makes the ARMv8 version consistent with the older one, in terms of processing width
| * Use similar strategy for SPLIT(16,4) ALTMAP NEON implementation as SPLIT(32,4)animetosho2015-11-121-95/+41
| |
| * Initial fix for SPLIT(16,4) ALTMAP NEON (non ARMv8)animetosho2015-11-121-17/+25
| |
| * CARRY_FREE is currently only available for w=4 and w=8 on NEONanimetosho2015-11-121-1/+1
| |
* | Merge branch 'manual' into 'master'Loic Dachary2016-09-131-96/+96
|\ \ | |/ |/| | | | | | | | | | | | | HTML manual fixes Fixes to HTML manual, for mistakes I've noticed. I'm sure there's more, but this is a start... See merge request !14
| * Fix a number of conversion issues in the HTML manualanimetosho2015-11-021-96/+96
|/
* Merge branch 'wip-manual' into 'master'KMG2015-09-0410-0/+3888
|\ | | | | | | | | | | convert manual from PDF to HTML See merge request !11
| * manual: convert from PDF to HTMLLoic Dachary2015-01-1410-0/+3888
| | | | | | | | | | | | It makes it easier to update. Signed-off-by: Loic Dachary <loic@dachary.org>
* | add -Wsign-compare and address the warningsLoic Dachary2015-09-027-38/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (1 << w) are changed into ((uint32_t)1 << w) * int are changed into uint32_t gf.c: gf_composite_get_default_poly: a larger unsigned were assigned to unsigned integers in which case the type of the assigned variable is changed to be the same as the value assigned to it. gf_w16.c: GF_MULTBY_TWO setting the parameter to a variable instead of passing the expression resolves the warning for some reason. Signed-off-by: Loic Dachary <loic@dachary.org>
* | ignore test-driver fileLoic Dachary2015-09-022-127/+1
| | | | | | | | | | | | Ignore it because it is rebuild by autogen.sh Signed-off-by: Loic Dachary <loic@dachary.org>
* | Merge branch 'wip-da-SCA-coverity' into 'master'Loic Dachary2015-09-022-15/+5
|\ \ | |/ |/| | | | | | | | | | | Fix issues found by Coverity in the Ceph project Remove dead code and fix potential integer overflow issues See merge request !12
| * gf_w64.c: fix integer overflowDanny Al-Gaaf2015-06-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for Coverity issue (from Ceph): CID 1193089 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression 1 << g_r with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). CID 1193090 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression 1 << g_s with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * gf_w64.c: fix integer overflowDanny Al-Gaaf2015-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fix for Coverity issue (from Ceph): CID 1193088 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression 1 << g_s with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * gf_w64.c: fix integer overflowDanny Al-Gaaf2015-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fix for Coverity issue (from Ceph): CID 1193087 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression 1 << g_r with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * gf_w64.c: fix integer overflowDanny Al-Gaaf2015-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fix for Coverity issue (from Ceph): CID 1193086 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) overflow_before_widen: Potentially overflowing expression 1 << g_r with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type uint64_t (64 bits, unsigned). Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * src/gf_w128.c: remove dead code and unused variableDanny Al-Gaaf2015-06-171-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for Coverity issue: CID 1297812 (#1 of 1): Constant variable guards dead code (DEADCODE) dead_error_begin: Execution cannot reach this statement: fprintf(stderr, "Code conta.... Local variable no_default_flag is assigned only once, to a constant value, making it effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would make no_default_flag not remain constant. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
| * src/gf_w64.c: remove dead codeDanny Al-Gaaf2015-06-171-5/+0
|/ | | | | | | | | | | | | | Fix for Coverity issue: CID 1297852 (#1 of 1): 'Constant'; variable guards dead code (DEADCODE) dead_error_begin: Execution cannot reach this statement: fprintf(stderr, "Code conta.... Local variable no_default_flag is assigned only once, to a constant value, making it effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would make no_default_flag not remain constant. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
* Merge branch 'wip-documentation' into 'master'KMG2015-01-081-1/+1
|\ | | | | | | | | | | jerasure.org is http, not https See merge request !4
| * jerasure.org is http, not httpsLoic Dachary2014-12-291-1/+1
|/ | | | Signed-off-by: Loic Dachary <loic@dachary.org>
* Merge branch 'wip-dirstamp-ignore' into 'master'KMG2014-12-291-0/+1
|\ | | | | | | | | | | dirstamp ignore See merge request !1
| * gitignore: add src/.dirstampGreg Farnum2014-12-251-0/+1
| | | | | | | | Signed-off-by: Greg Farnum <gfarnum@redhat.com>
* | Merge branch 'wip-exit-v2' into 'master'KMG2014-12-290-0/+0
|\ \ | | | | | | | | | | | | | | | exit v2 See merge request !2
| * | use assert(0) instead of exit(1)Loic Dachary2014-12-153-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a fatal error (unaligned memory etc.) is detected, gf-complete should assert(3) instead of exit(3) to give a chance to the calling program to catch the exception and display a stack trace. Although it is possible for gdb to display the stack trace and break on exit, libraries are not usually expected to terminate the calling program in this way. Signed-off-by: Loic Dachary <loic@dachary.org> (cherry picked from commit 29427efac2ce362fce8e4f5f5f1030feba942b73)
* | | Merge branch 'wip-documentation' into 'master'KMG2014-12-293-23/+6
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | documentation updates to replace URLs that do not contain useful information See merge request !3
| * | documentation: update with jerasure.org new homeLoic Dachary2014-12-252-21/+6
| | | | | | | | | | | | Signed-off-by: Loic Dachary <loic@dachary.org>
| * | Revert "Removed PDF from the repo and added a note in the README that ↵Loic Dachary2014-12-252-4/+2
|/ / | | | | | | | | | | describes how to" This reverts commit 9311b4fc107da2f2e9a2624520cfe2ffd216af53.
* | Merge pull request #1 from dachary/wip-assertkmgreen22014-12-063-8/+11
|\ \ | |/ |/| use assert(0) instead of exit(1)
| * use assert(0) instead of exit(1)Loic Dachary2014-12-023-8/+11
|/ | | | | | | | | | When a fatal error (unaligned memory etc.) is detected, gf-complete should assert(3) instead of exit(3) to give a chance to the calling program to catch the exception and display a stack trace. Although it is possible for gdb to display the stack trace and break on exit, libraries are not usually expected to terminate the calling program in this way. Signed-off-by: Loic Dachary <loic@dachary.org>
* Merged in jannau/gf-complete/neon (pull request #25) Kevin Greenan2014-10-2430-405/+2253
|\ | | | | arm neon optimisations