diff --git a/liba/Makefile b/liba/Makefile index 0a5f8a1fc..0abd5ac52 100644 --- a/liba/Makefile +++ b/liba/Makefile @@ -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 \ diff --git a/liba/src/aeabi-rt/llsl.c b/liba/src/aeabi-rt/llsl.c new file mode 100644 index 000000000..1a510f689 --- /dev/null +++ b/liba/src/aeabi-rt/llsl.c @@ -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; +}