[liba] Implement llsl

Change-Id: I651deb9ae7b48cabaeb7e21d13ed395f133fd0c3
This commit is contained in:
Émilie Feral
2017-05-22 13:16:26 +02:00
parent 45fa0ac0a8
commit 52c15de070
2 changed files with 10 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ tests += $(addprefix liba/test/, \
# In practice we're always using liba on such a target.
objs += $(addprefix liba/src/aeabi-rt/, \
atexit.o \
llsl.o \
llsr.o \
memclr.o \
memcpy.o \

9
liba/src/aeabi-rt/llsl.c Normal file
View File

@@ -0,0 +1,9 @@
/* See the "Run-time ABI for the ARM Architecture", Section 4.2 */
typedef int uint32_t;
long long __aeabi_llsl(long long value, int shift) {
uint32_t low = (uint32_t)value << shift;
uint32_t high = ((uint32_t)(value >> 32) << shift) | ((uint32_t)value >> (32 - shift));
return ((long long)high << 32) | low;
}