Commit Graph

22 Commits (4339569f14c95a8895a347845f8ed6e18b345ace)

Author SHA1 Message Date
Bassam Tabbara 4339569f14 Support for runtime SIMD detection
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.
2016-09-13 12:24:25 -07:00
Loic Dachary 185295f247 Merge branch 'wip-valgrind' into 'master'
enable valgrind for tests

See merge request !9
2016-09-13 19:23:39 +00:00
Loic Dachary 62b702d568 do not memcpy if src and dst are the same
This is harmless really but triggers a valgrind error.

Signed-off-by: Loic Dachary <loic@dachary.org>
2016-09-13 09:48:18 +02:00
animetosho 7a9a09f32c CARRY_FREE is currently only available for w=4 and w=8 on NEON 2015-11-12 21:06:34 +10:00
Loic Dachary d1b6bbf706 add -Wsign-compare and address the warnings
* (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>
2015-09-02 19:20:33 +02:00
Loic Dachary 29427efac2 use assert(0) instead of exit(1)
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>
2014-12-02 00:27:27 +01:00
Janne Grunau bec15359de arm: NEON optimisations for gf_w8
Optimisations for the 4,4 split table region multiplication and carry
less multiplication using NEON's polynomial long multiplication.
arm: w8: NEON carry less multiplication

Selected time_tool.sh results for a 1.7GHz cortex-a9:
Region Best (MB/s):   375.86   W-Method: 8 -m CARRY_FREE -
Region Best (MB/s):   142.94   W-Method: 8 -m TABLE -
Region Best (MB/s):   225.01   W-Method: 8 -m TABLE -r DOUBLE -
Region Best (MB/s):   211.23   W-Method: 8 -m TABLE -r DOUBLE -r LAZY -
Region Best (MB/s):   160.09   W-Method: 8 -m LOG -
Region Best (MB/s):   123.61   W-Method: 8 -m LOG_ZERO -
Region Best (MB/s):   123.85   W-Method: 8 -m LOG_ZERO_EXT -
Region Best (MB/s):  1183.79   W-Method: 8 -m SPLIT 8 4 -r SIMD -
Region Best (MB/s):   177.68   W-Method: 8 -m SPLIT 8 4 -r NOSIMD -
Region Best (MB/s):    87.85   W-Method: 8 -m COMPOSITE 2 - -
Region Best (MB/s):   428.59   W-Method: 8 -m COMPOSITE 2 - -r ALTMAP -
2014-10-24 14:53:35 +02:00
Janne Grunau 3a1be40ea8 arm: NEON optimisations for XOR in gf_multby_one 2014-10-09 23:25:36 +02:00
Janne Grunau 568df90edc simd: rename the region flags from SSE to SIMD
SSE is not the only supported SIMD instruction set. Keep the old names
for backward compatibility.
2014-10-09 23:22:32 +02:00
Loic Dachary 7c06749ab8 disable gf_error_check test that requires >> 64
Because >> 64 does not have a defined behavior.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
2014-09-17 10:08:37 +02:00
Adam Disney c25310f215 Removed comments marking CARRY_FREE_GK additions. 2014-06-16 13:04:15 -04:00
Adam Disney 6bb1ebb9f4 Implemented CARRY_FREE_GK. Sections added are tagged with a comment //ADAM
for easy navigation.
2014-06-06 13:09:04 -04:00
Danny Al-Gaaf 0c04d6e3db gf.c: fix pointless expression
Remove identical expression, reorganize code in gf_error_check()
to be identical handled trough all checks. Removed (raltmap && arg1 != 4)
check - this is dead code (arg1 is always 4 in this code path).

Fix for coverity issue from Ceph project:

CID 1193071 (#1 of 1): Same on both sides (CONSTANT_EXPRESSION_RESULT)
 pointless_expression: The expression (arg1 == 4 && arg2 == 32) ||
 (arg1 == 4 && arg2 == 32) does not accomplish anything because it
 evaluates to either of its identical operands, arg1 == 4 && arg2 == 32.
 Did you intend the operands to be different?

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-04-22 20:08:27 +02:00
Danny Al-Gaaf 13f0e8888f fix comment/message on GF_E_SP128_A/GF_E_SP128_S
Swap comments/messages on GF_E_SP128_A/GF_E_SP128_S.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-04-22 20:08:26 +02:00
Loic Dachary a0ae760ed3 prefer uint8_t to char in pointer arithmetic
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-04-10 17:21:38 +02:00
Loic Dachary cc45e19026 do not use gf_internal_t when it is null
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-03-06 17:48:12 +01:00
Loic Dachary 3c4a451b50 silence some warnings for unset variables
By setting them when they are defined and when the compiler fails to see
the logic is ok.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-03-06 17:47:59 +01:00
Loic Dachary d36bd6e540 cast void* to char* for pointer arithmetic
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-03-06 17:29:36 +01:00
Loic Dachary f043479e3c remove unused variables
In some places move variables in the scope of the CPP define where they
are used.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-03-06 15:15:22 +01:00
Jim Plank f0c32c94bc Removed GROUP/128/SSE. It wasn't compiling, and it needed an overhaul.
I'll do it someday when I'm bored.
2014-01-01 11:00:40 -05:00
Kevin Greenan 8900c0e635 Make INTEL_SSE4_PCLMUL flag consistent (was INTEL_PCLMUL in gf.c) 2013-12-30 22:12:43 -08:00
Kevin Greenan 153dd20988 Setting up autoconf/automake for GF-Complete
Also re-organized the directory structure.

Signed-off-by: Kevin Greenan <kmgreen2@gmail.com>
2013-12-04 21:24:29 -08:00