Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Garcia <danielgarcia@gmail.com>2014-10-28 04:53:26 +0300
committerDaniel Garcia <danielgarcia@gmail.com>2014-10-28 04:53:26 +0300
commit80e230af802215a6a5afcf37755edd6556ee3c5f (patch)
tree0168e231c5db6efda4f658a8f7412cab1febfeef /bitswap.h
parenta23421e87a3c1246c9a680b60fec6a1f7f97a3b5 (diff)
Adding source for transpose functions to bitswap.h
Diffstat (limited to 'bitswap.h')
-rw-r--r--bitswap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/bitswap.h b/bitswap.h
index c2869c6c..0cbd95dc 100644
--- a/bitswap.h
+++ b/bitswap.h
@@ -155,6 +155,8 @@ __attribute__((always_inline)) inline void slowswap(unsigned char *A, unsigned c
}
}
+// Simplified form of bits rotating function found here - http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt - rotating
+// data into LSB for a faster write (the code using this data can happily walk the array backwards)
__attribute__((always_inline)) inline void transpose8x1(unsigned char *A, unsigned char *B) {
uint32_t x, y, t;
@@ -179,6 +181,7 @@ __attribute__((always_inline)) inline void transpose8x1(unsigned char *A, unsign
*((uint32_t*)(B+4)) = x;
}
+// Simplified form of bits rotating function found here - http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt
__attribute__((always_inline)) inline void transpose8x1_MSB(unsigned char *A, unsigned char *B) {
uint32_t x, y, t;
@@ -210,6 +213,7 @@ __attribute__((always_inline)) inline void transpose8x1_MSB(unsigned char *A, un
B[0] = x; /* */
}
+// templated bit-rotating function based on code found here - http://www.hackersdelight.org/hdcodetxt/transpose8.c.txt
template<int m, int n>
__attribute__((always_inline)) inline void transpose8(unsigned char *A, unsigned char *B) {
uint32_t x, y, t;