aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/bswap.h
Commit message (Collapse)AuthorAgeFilesLines
* If the user defines BOTAN_NO_SSE_INTRINSICS, avoid includinglloyd2010-12-221-2/+2
| | | | | | intrinsics headers in header files. This is particularly useful for allowing code that will be compiled by nvcc to include loadstor.h, but might be useful in other situations as well.
* Oops, bad GCC version check herelloyd2010-07-271-1/+1
|
* Add support for GCC's byteswap builtins. They were added in 4.3 andlloyd2010-07-271-4/+29
| | | | | | work for 32 and 64 bit integers. Using these instead of inline asm may offer better scheduling on x86, and additionally offers native byteswapping on other platforms (PPC, ARM, etc).
* Remove some C-style castslloyd2010-04-231-2/+2
|
* Remove pshufb-based bswap_4; it causes problems too easily with externallloyd2010-01-041-21/+1
| | | | | | application code that wants to use loadstor.h, since that loads bswap.h and if SSSE3 isn't enabled via -march GCC will error out. Doesn't seem to be at all faster than the shuffle-based bswap for SSE2 on a Core2 in any case.
* Oops, it's TARGET_CPU_IS_XXX_FAMILY, not TARGET_IS_XXX_FAMILY.lloyd2009-12-301-1/+1
| | | | Also, fix AltiVec detection on Linux and NetBSD for most G4s.
* Use IS_XXX_FAMILY macros where usefullloyd2009-12-301-2/+1
|
* Add bswap_4 which swaps 4 Ts in parallel. Normally just uses reverse_bytes,lloyd2009-12-231-0/+50
| | | | | but if SSE2 or SSSE3 is available uses SIMD magic to swap 4 32 bit values at once.
* Un-internal loadstor.h (and its header deps, rotate.h andlloyd2009-12-211-12/+21
| | | | | | | | | | | | | | bswap.h); too many external apps rely on loadstor.h existing. Define 64-bit generic bswap in terms of 32-bit bswap, since it's not much slower if 32-bit is also generic, and much faster if it's not. This may be quite helpful on 32-bit x86 in particular. Change formulation of generic 32-bit bswap. It may be faster or slower depending on the CPU, especially the latency and throuput of rotate instructions, but should be faster on an ideally superscalar processor with rotate instructions (ie, what I expect future CPUs to look more like).
* Make many more headers internal-only.lloyd2009-12-161-1/+1
| | | | | | | | | | | | | Fixes for the amalgamation generator for internal headers. Remove BOTAN_DLL exporting macros from all internal-only headers; the classes/functions there don't need to be exported, and avoiding the PIC/GOT indirection can be a big win. Add missing BOTAN_DLLs where necessary, mostly gfpmath and cvc For GCC, use -fvisibility=hidden and set BOTAN_DLL to the visibility __attribute__ to export those classes/functions.
* Fix macro generation + checks in configure.py and bswap.h. Had the effectlloyd2009-09-171-2/+2
| | | | of preventing the bswap optimizations from being used. :(
* Fix variable name in 32-bit bswap for VC++lloyd2009-08-031-1/+1
|
* A typo in a macro check in bswap.h meant inline asm bswap was notlloyd2009-07-311-1/+1
| | | | used on Visual C++
* Thomas Moschny passed along a request from the Fedora packagers which camelloyd2009-03-301-8/+10
| | | | | | | | | | | | | | | up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
* Add an implementation of bswap for Visual C++ in x86 inline asm,lloyd2008-10-121-0/+9
| | | | written by Yves Jerschow (sent to me in a personal email 2007-10-23).
* Escape newline in macrolloyd2008-09-291-2/+2
|
* Set a preprocessor flag if we think the compiler supports GCC-stylelloyd2008-09-291-2/+4
| | | | | | | | inline asm (currently, if __GNUG__ is defined, which works with both GNU C++ and Intel C++, which are the only two compilers I know of that accept GCC's inline asm syntax). Use that in bswap.h - previously we would try to use inline asm even with VC++ or other compilers not supporting inline asm.
* Use bswapl on 32-bit x86 as welllloyd2008-09-291-1/+1
|
* Directly inline x86-64 asm into bswap.hlloyd2008-09-291-2/+12
|
* Move util functions into utils/ modulelloyd2008-09-281-0/+39