Linux内核使用浮点运算问题
上一篇博文中 电池温度检测原理和示例代码 ,由于驱动要使用对数函数而从网上参看一个实现
double ln(double a)
{
int N = ;
int k,nk;
double x,xx,y; x = (a-)/(a+);
xx = x*x;
nk = *N+;
y = 1.0/nk;
for(k=N;k>;k--) {
nk = nk - ;
y = 1.0/nk+xx*y;
} return 2.0*x*y;
}
尴尬的是当时内核不支持浮点运算所以停滞了, 时间紧迫只能折中先列出各个温度和电压对应表, 通过查表方式处理, 今天着重了解一下为何内核使用浮点运算“前世今生”
一、早期处理器
由于早期处理器硬件压根没有浮点运算功能, 所以编译器自然不会编译出对应指令, 但是确实有需要的场景, 无论应用程序还是内核驱动, 所有出现了浮点模拟器,具体配置在:
原理很简单, 就是编译器对浮点运算代码还是编译对应“指令”, 当运行时ARM指令集没有该“指令”从而导致指令异常, 然后在异常处理函数中调用浮点模拟器函数计算该“指令”并返回结果
优点不言而喻是能够支持浮点需求场景, 对应用程序还是驱动都透明;缺点也显而易见, 这种“指令异常” 方式会增加系统无效负载, 影响中断响应时间等。
Linus Torvalds认为内核不应该进行浮点运算, 所以后来的内核版本menuconfig我没看到有这个浮点模拟器, 相比于内核应用程序使用到浮点运算需求更大, 总不能“躺枪”也不能用吧?
所以就出现了个软浮点库, 编译器在编译应用程序发现这是一条浮点运算时会用函数进行替代! 比如上面ln()函数的x = (a-1)/(a+1); 减法 加法 最后相除都调用函数解决!
x = (a-)/(a+);
反汇编如下:
84c8: e3a0300f mov r3, #
84cc: e50b3020 str r3, [fp, #-] ; 0xffffffe0
84d0: e14b03dc ldrd r0, [fp, #-] ; 0xffffffc4
84d4: e3a02000 mov r2, #
84d8: e3a035ff mov r3, # ; 0x3fc00000
84dc: e2833603 add r3, r3, # ; 0x300000
84e0: eb000188 bl 8b08 <__aeabi_dsub>
84e4: e1a02000 mov r2, r0
84e8: e1a03001 mov r3, r1
84ec: e1a04002 mov r4, r2
84f0: e1a05003 mov r5, r3
84f4: e14b03dc ldrd r0, [fp, #-] ; 0xffffffc4
84f8: e3a02000 mov r2, #
84fc: e3a035ff mov r3, # ; 0x3fc00000
: e2833603 add r3, r3, # ; 0x300000
: eb000180 bl 8b0c <__adddf3>
: e1a02000 mov r2, r0
850c: e1a03001 mov r3, r1
: e1a00004 mov r0, r4
: e1a01005 mov r1, r5
: eb000301 bl <__aeabi_ddiv>
这很好理解, 毕竟应用使用浮点频率较高, 靠浮点模拟器总产生异常应用态切成内核态处理完再返回用户态, 太耗性能了。
二、现代处理器
现代处理器硬件已经支持浮点运算, 而且作为一个组件对待, 可选配, 根据需求和方案选型处理器时评估是否需要硬件支持。在STM系列浮点硬件单元叫做FPU(float process unit)吧,
ARM中归属协处理器那边的。所以我们知道如果要使用硬件浮点的话, 需要满足三个条件:
. 硬件要有浮点运算单元
. 软件要配置使能硬件浮点,比如Linux内核要选中下面配置(主要设置协处理器)
. 编译器指定-mfloat-abi=softfp 或-mfloat-abi=hard 编译浮点指令而不是用函数替换!
同样是上面ln()函数的x = (a-1)/(a+1); 采用了硬浮点指令后反汇编代码如下:
x = (a-1)/(a+1);
反汇编如下:
84b0: ed1b6b0d vldr d6, [fp, #-] ; 0xffffffcc
84b4: ed9f7b33 vldr d7, [pc, #] ; <ln+0xf0>
84b8: ee365b47 vsub.f64 d5, d6, d7
84bc: ed1b6b0d vldr d6, [fp, #-] ; 0xffffffcc
84c0: ed9f7b30 vldr d7, [pc, #] ; <ln+0xf0>
84c4: ee366b07 vadd.f64 d6, d6, d7
84c8: ee857b06 vdiv.f64 d7, d5, d6
三、示例代码
我们分别写个应用程序和驱动程序, 且分别用软浮点和硬浮点测试其性能
1.应用程序
代码如下:
/* arm-none-linux-gnueabi-gcc -mfloat-abi=soft application_test.c -lrt -o soft.bin
* arm-none-linux-gnueabi-gcc -mfloat-abi=softfp application_test.c -lrt -o softfp.bin
* arm-none-linux-gnueabi-gcc -mfloat-abi=hard application_test.c -lrt fail!!
*/
#include<stdio.h>
#include<time.h> double ln(double a)
{
int N = ;
int k,nk;
double x,xx,y; x = (a-)/(a+);
xx = x*x;
nk = *N+;
y = 1.0/nk;
for(k=N;k>;k--) {
nk = nk - ;
y = 1.0/nk+xx*y;
} return 2.0*x*y;
} int main()
{
int t1;
double Rt, Vadc;
struct timespec time_start={, },time_end={, }; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time_start);
/* 根据采样电压反推热敏电阻的温度 */
for(Vadc=; Vadc<; Vadc++) {
Rt = Vadc * / (-Vadc);
t1=/(ln(Rt/)/+/298.15)-273.15;
}
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time_end); printf("start time %ld s,%ld ns\n", time_start.tv_sec, time_start.tv_nsec);
printf("end time %ld s,%ld ns\n", time_end.tv_sec, time_end.tv_nsec);
printf("duration:%ld s %ld ns\n", time_end.tv_sec-time_start.tv_sec, time_end.tv_nsec-time_start.tv_nsec); printf("%.10fmv = %d\n", Vadc, t1); return ;
}
反汇编可以看出硬浮点直接指令, 软浮点是用函数替换而且是静态链接, 导致bin文件比较大
/* arm-none-linux-gnueabi-objdump -d soft.bin > objdump_soft.txt */
soft.bin: file format elf32-littlearm Disassembly of section .init: <_init>:
: e92d4008 push {r3, lr}
838c: eb000024 bl <call_gmon_start>
: e8bd8008 pop {r3, pc} Disassembly of section .plt: <.plt>:
: e52de004 push {lr} ; (str lr, [sp, #-]!)
: e59fe004 ldr lr, [pc, #] ; 83a4 <_init+0x1c>
839c: e08fe00e add lr, pc, lr
83a0: e5bef008 ldr pc, [lr, #]!
83a4: .word 0x00009168
83a8: e28fc600 add ip, pc, #,
83ac: e28cca09 add ip, ip, # ; 0x9000
83b0: e5bcf168 ldr pc, [ip, #]! ; 0x168
83b4: e28fc600 add ip, pc, #,
83b8: e28cca09 add ip, ip, # ; 0x9000
83bc: e5bcf160 ldr pc, [ip, #]! ; 0x160
83c0: e28fc600 add ip, pc, #,
83c4: e28cca09 add ip, ip, # ; 0x9000
83c8: e5bcf158 ldr pc, [ip, #]! ; 0x158
83cc: e28fc600 add ip, pc, #,
83d0: e28cca09 add ip, ip, # ; 0x9000
83d4: e5bcf150 ldr pc, [ip, #]! ; 0x150
83d8: e28fc600 add ip, pc, #,
83dc: e28cca09 add ip, ip, # ; 0x9000
83e0: e5bcf148 ldr pc, [ip, #]! ; 0x148 Disassembly of section .text: 000083e8 <_start>:
83e8: e3a0b000 mov fp, #
83ec: e3a0e000 mov lr, #
83f0: e49d1004 pop {r1} ; (ldr r1, [sp], #)
83f4: e1a0200d mov r2, sp
83f8: e52d2004 push {r2} ; (str r2, [sp, #-]!)
83fc: e52d0004 push {r0} ; (str r0, [sp, #-]!)
: e59fc010 ldr ip, [pc, #] ; <_start+0x30>
: e52dc004 push {ip} ; (str ip, [sp, #-]!)
: e59f000c ldr r0, [pc, #] ; 841c <_start+0x34>
840c: e59f300c ldr r3, [pc, #] ; <_start+0x38>
: ebffffe7 bl 83b4 <_init+0x2c>
: ebffffef bl 83d8 <_init+0x50>
: .word 0x00009328
841c: .word 0x00008628
: .word 0x00009260 <call_gmon_start>:
: e59f0014 ldr r0, [pc, #] ; <call_gmon_start+0x1c>
: e59f2014 ldr r2, [pc, #] ; <call_gmon_start+0x20>
842c: e08f3000 add r3, pc, r0
: e7933002 ldr r3, [r3, r2]
: e3530000 cmp r3, #
: 012fff1e bxeq lr
843c: eaffffdf b 83c0 <_init+0x38>
: 000090d8 .word 0x000090d8
: .word 0x00000020 <__do_global_dtors_aux>:
: e59f3010 ldr r3, [pc, #] ; <__do_global_dtors_aux+0x18>
844c: e5d32000 ldrb r2, [r3]
: e3520000 cmp r2, #
: 03a02001 moveq r2, #
: 05c32000 strbeq r2, [r3]
845c: e12fff1e bx lr
: .word 0x00011538 <frame_dummy>:
: e59f0020 ldr r0, [pc, #] ; 848c <frame_dummy+0x28>
: e92d4008 push {r3, lr}
846c: e5903000 ldr r3, [r0]
: e3530000 cmp r3, #
: 08bd8008 popeq {r3, pc}
: e59f3010 ldr r3, [pc, #] ; <frame_dummy+0x2c>
847c: e3530000 cmp r3, #
: 08bd8008 popeq {r3, pc}
: e12fff33 blx r3
: e8bd8008 pop {r3, pc}
848c: .word 0x00011410
... <ln>:
: e92d4830 push {r4, r5, fp, lr}
849c: e28db00c add fp, sp, #
84a0: e24dd030 sub sp, sp, # ; 0x30
84a4: e14b03fc strd r0, [fp, #-] ; 0xffffffc4
84a8: e3a0300f mov r3, #
84ac: e50b3020 str r3, [fp, #-] ; 0xffffffe0
84b0: e14b03dc ldrd r0, [fp, #-] ; 0xffffffc4
84b4: e3a02000 mov r2, #
84b8: e3a035ff mov r3, # ; 0x3fc00000
84bc: e2833603 add r3, r3, # ; 0x300000
84c0: eb0000fc bl 88b8 <__aeabi_dsub>
84c4: e1a02000 mov r2, r0
84c8: e1a03001 mov r3, r1
84cc: e1a04002 mov r4, r2
84d0: e1a05003 mov r5, r3
84d4: e14b03dc ldrd r0, [fp, #-] ; 0xffffffc4
84d8: e3a02000 mov r2, #
84dc: e3a035ff mov r3, # ; 0x3fc00000
84e0: e2833603 add r3, r3, # ; 0x300000
84e4: eb0000f4 bl 88bc <__adddf3>
84e8: e1a02000 mov r2, r0
84ec: e1a03001 mov r3, r1
84f0: e1a00004 mov r0, r4
84f4: e1a01005 mov r1, r5
84f8: eb000275 bl 8ed4 <__aeabi_ddiv>
84fc: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
: e14b22fc strd r2, [fp, #-] ; 0xffffffd4
: e14b02dc ldrd r0, [fp, #-] ; 0xffffffd4
850c: e14b22dc ldrd r2, [fp, #-] ; 0xffffffd4
: eb0001d4 bl 8c68 <__aeabi_dmul>
: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
851c: e14b23f4 strd r2, [fp, #-] ; 0xffffffcc
: e51b3020 ldr r3, [fp, #-] ; 0xffffffe0
: e1a03083 lsl r3, r3, #
: e2833001 add r3, r3, #
852c: e50b3014 str r3, [fp, #-] ; 0xffffffec
: e51b0014 ldr r0, [fp, #-] ; 0xffffffec
: eb000194 bl 8b8c <__aeabi_i2d>
: e1a02000 mov r2, r0
853c: e1a03001 mov r3, r1
: e3a00000 mov r0, #
: e3a015ff mov r1, # ; 0x3fc00000
: e2811603 add r1, r1, # ; 0x300000
854c: eb000260 bl 8ed4 <__aeabi_ddiv>
: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
: e14b21fc strd r2, [fp, #-] ; 0xffffffe4
855c: e51b3020 ldr r3, [fp, #-] ; 0xffffffe0
: e50b3010 str r3, [fp, #-]
: ea00001c b 85dc <ln+0x144>
: e51b3014 ldr r3, [fp, #-] ; 0xffffffec
856c: e2433002 sub r3, r3, #
: e50b3014 str r3, [fp, #-] ; 0xffffffec
: e51b0014 ldr r0, [fp, #-] ; 0xffffffec
: eb000183 bl 8b8c <__aeabi_i2d>
857c: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
: e3a00000 mov r0, #
: e3a015ff mov r1, # ; 0x3fc00000
858c: e2811603 add r1, r1, # ; 0x300000
: eb00024f bl 8ed4 <__aeabi_ddiv>
: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
859c: e1a04002 mov r4, r2
85a0: e1a05003 mov r5, r3
85a4: e14b03d4 ldrd r0, [fp, #-] ; 0xffffffcc
85a8: e14b21dc ldrd r2, [fp, #-] ; 0xffffffe4
85ac: eb0001ad bl 8c68 <__aeabi_dmul>
85b0: e1a02000 mov r2, r0
85b4: e1a03001 mov r3, r1
85b8: e1a00004 mov r0, r4
85bc: e1a01005 mov r1, r5
85c0: eb0000bd bl 88bc <__adddf3>
85c4: e1a02000 mov r2, r0
85c8: e1a03001 mov r3, r1
85cc: e14b21fc strd r2, [fp, #-] ; 0xffffffe4
85d0: e51b3010 ldr r3, [fp, #-]
85d4: e2433001 sub r3, r3, #
85d8: e50b3010 str r3, [fp, #-]
85dc: e51b3010 ldr r3, [fp, #-]
85e0: e3530000 cmp r3, #
85e4: caffffdf bgt <ln+0xd0>
85e8: e14b22dc ldrd r2, [fp, #-] ; 0xffffffd4
85ec: e1a00002 mov r0, r2
85f0: e1a01003 mov r1, r3
85f4: eb0000b0 bl 88bc <__adddf3>
85f8: e1a02000 mov r2, r0
85fc: e1a03001 mov r3, r1
: e1a00002 mov r0, r2
: e1a01003 mov r1, r3
: e14b21dc ldrd r2, [fp, #-] ; 0xffffffe4
860c: eb000195 bl 8c68 <__aeabi_dmul>
: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
: e1a00002 mov r0, r2
861c: e1a01003 mov r1, r3
: e24bd00c sub sp, fp, #
: e8bd8830 pop {r4, r5, fp, pc} <main>:
: e92d4830 push {r4, r5, fp, lr}
862c: e28db00c add fp, sp, #
: e24dd030 sub sp, sp, # ; 0x30
: e3a03000 mov r3, #
: e50b302c str r3, [fp, #-] ; 0xffffffd4
863c: e3a03000 mov r3, #
: e50b3028 str r3, [fp, #-] ; 0xffffffd8
: e3a03000 mov r3, #
: e50b3034 str r3, [fp, #-] ; 0xffffffcc
864c: e3a03000 mov r3, #
: e50b3030 str r3, [fp, #-] ; 0xffffffd0
: e3a00002 mov r0, #
: e24b302c sub r3, fp, # ; 0x2c
865c: e1a01003 mov r1, r3
: ebffff59 bl 83cc <_init+0x44>
: e3a02000 mov r2, #
: e3a035ff mov r3, # ; 0x3fc00000
866c: e2833603 add r3, r3, # ; 0x300000
: e14b21fc strd r2, [fp, #-] ; 0xffffffe4
: ea000046 b <main+0x16c>
: e14b01dc ldrd r0, [fp, #-] ; 0xffffffe4
867c: e28f3f7b add r3, pc, # ; 0x1ec
: e1c320d0 ldrd r2, [r3]
: eb000177 bl 8c68 <__aeabi_dmul>
: e1a02000 mov r2, r0
868c: e1a03001 mov r3, r1
: e1a04002 mov r4, r2
: e1a05003 mov r5, r3
: e28f1f76 add r1, pc, # ; 0x1d8
869c: e1c100d0 ldrd r0, [r1]
86a0: e14b21dc ldrd r2, [fp, #-] ; 0xffffffe4
86a4: eb000083 bl 88b8 <__aeabi_dsub>
86a8: e1a02000 mov r2, r0
86ac: e1a03001 mov r3, r1
86b0: e1a00004 mov r0, r4
86b4: e1a01005 mov r1, r5
86b8: eb000205 bl 8ed4 <__aeabi_ddiv>
86bc: e1a02000 mov r2, r0
86c0: e1a03001 mov r3, r1
86c4: e14b22f4 strd r2, [fp, #-] ; 0xffffffdc
86c8: e14b02d4 ldrd r0, [fp, #-] ; 0xffffffdc
86cc: e28f3f6b add r3, pc, # ; 0x1ac
86d0: e1c320d0 ldrd r2, [r3]
86d4: eb0001fe bl 8ed4 <__aeabi_ddiv>
86d8: e1a02000 mov r2, r0
86dc: e1a03001 mov r3, r1
86e0: e1a00002 mov r0, r2
86e4: e1a01003 mov r1, r3
86e8: ebffff6a bl <ln>
86ec: e1a02000 mov r2, r0
86f0: e1a03001 mov r3, r1
86f4: e1a00002 mov r0, r2
86f8: e1a01003 mov r1, r3
86fc: e28f3f61 add r3, pc, # ; 0x184
: e1c320d0 ldrd r2, [r3]
: eb0001f2 bl 8ed4 <__aeabi_ddiv>
: e1a02000 mov r2, r0
870c: e1a03001 mov r3, r1
: e1a00002 mov r0, r2
: e1a01003 mov r1, r3
: e28f3e17 add r3, pc, # ; 0x170
871c: e1c320d0 ldrd r2, [r3]
: eb000065 bl 88bc <__adddf3>
: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
872c: e3a00000 mov r0, #
: e3a015ff mov r1, # ; 0x3fc00000
: e2811603 add r1, r1, # ; 0x300000
: eb0001e5 bl 8ed4 <__aeabi_ddiv>
873c: e1a02000 mov r2, r0
: e1a03001 mov r3, r1
: e1a00002 mov r0, r2
: e1a01003 mov r1, r3
874c: e28f3f51 add r3, pc, # ; 0x144
: e1c320d0 ldrd r2, [r3]
: eb000057 bl 88b8 <__aeabi_dsub>
: e1a02000 mov r2, r0
875c: e1a03001 mov r3, r1
: e1a00002 mov r0, r2
: e1a01003 mov r1, r3
: eb0002a5 bl <__aeabi_d2iz>
876c: e1a03000 mov r3, r0
: e50b3010 str r3, [fp, #-]
: e14b01dc ldrd r0, [fp, #-] ; 0xffffffe4
: e3a02000 mov r2, #
877c: e3a035ff mov r3, # ; 0x3fc00000
: e2833603 add r3, r3, # ; 0x300000
: eb00004c bl 88bc <__adddf3>
: e1a02000 mov r2, r0
878c: e1a03001 mov r3, r1
: e14b21fc strd r2, [fp, #-] ; 0xffffffe4
: e3a03001 mov r3, #
: e1a04003 mov r4, r3
879c: e14b01dc ldrd r0, [fp, #-] ; 0xffffffe4
87a0: e28f30d0 add r3, pc, # ; 0xd0
87a4: e1c320d0 ldrd r2, [r3]
87a8: eb000281 bl 91b4 <__aeabi_dcmplt>
87ac: e1a03000 mov r3, r0
87b0: e3530000 cmp r3, #
87b4: 1a000001 bne 87c0 <main+0x198>
87b8: e3a03000 mov r3, #
87bc: e1a04003 mov r4, r3
87c0: e20430ff and r3, r4, # ; 0xff
87c4: e3530000 cmp r3, #
87c8: 1affffaa bne <main+0x50>
87cc: e3a00002 mov r0, #
87d0: e24b3034 sub r3, fp, # ; 0x34
87d4: e1a01003 mov r1, r3
87d8: ebfffefb bl 83cc <_init+0x44>
87dc: e59f10bc ldr r1, [pc, #] ; 88a0 <main+0x278>
87e0: e51b202c ldr r2, [fp, #-] ; 0xffffffd4
87e4: e51b3028 ldr r3, [fp, #-] ; 0xffffffd8
87e8: e1a00001 mov r0, r1
87ec: e1a01002 mov r1, r2
87f0: e1a02003 mov r2, r3
87f4: ebfffeeb bl 83a8 <_init+0x20>
87f8: e59f10a4 ldr r1, [pc, #] ; 88a4 <main+0x27c>
87fc: e51b2034 ldr r2, [fp, #-] ; 0xffffffcc
: e51b3030 ldr r3, [fp, #-] ; 0xffffffd0
: e1a00001 mov r0, r1
: e1a01002 mov r1, r2
880c: e1a02003 mov r2, r3
: ebfffee4 bl 83a8 <_init+0x20>
: e59f008c ldr r0, [pc, #] ; 88a8 <main+0x280>
: e51b2034 ldr r2, [fp, #-] ; 0xffffffcc
881c: e51b302c ldr r3, [fp, #-] ; 0xffffffd4
: e0632002 rsb r2, r3, r2
: e51b1030 ldr r1, [fp, #-] ; 0xffffffd0
: e51b3028 ldr r3, [fp, #-] ; 0xffffffd8
882c: e0633001 rsb r3, r3, r1
: e1a01000 mov r1, r0
: e1a00001 mov r0, r1
: e1a01002 mov r1, r2
883c: e1a02003 mov r2, r3
: ebfffed8 bl 83a8 <_init+0x20>
: e59f2060 ldr r2, [pc, #] ; 88ac <main+0x284>
: e51b3010 ldr r3, [fp, #-]
884c: e58d3000 str r3, [sp]
: e1a03002 mov r3, r2
: e1a00003 mov r0, r3
: e14b21dc ldrd r2, [fp, #-] ; 0xffffffe4
885c: ebfffed1 bl 83a8 <_init+0x20>
: e3a03000 mov r3, #
: e1a00003 mov r0, r3
: e24bd00c sub sp, fp, #
886c: e8bd8830 pop {r4, r5, fp, pc}
: .word 0x00000000
: 40e6f300 .word 0x40e6f300
: .word 0x00000000
887c: 409c2000 .word 0x409c2000
: .word 0x00000000
: 40c38800 .word 0x40c38800
: .word 0x00000000
888c: 40aedc00 .word 0x40aedc00
: dcb5db83 .word 0xdcb5db83
: 3f6b79e1 .word 0x3f6b79e1
: .word 0x66666666
889c: .word 0x40711266
88a0: .word 0x00009338
88a4: .word 0x00009354
88a8: .word 0x00009370
88ac: .word 0x00009388 000088b0 <__aeabi_drsub>:
88b0: e2211102 eor r1, r1, #- ; 0x80000000
88b4: ea000000 b 88bc <__adddf3> 000088b8 <__aeabi_dsub>:
88b8: e2233102 eor r3, r3, #- ; 0x80000000 000088bc <__adddf3>:
88bc: e92d4030 push {r4, r5, lr}
88c0: e1a04081 lsl r4, r1, #
88c4: e1a05083 lsl r5, r3, #
88c8: e1340005 teq r4, r5
88cc: teqeq r0, r2
88d0: 1194c000 orrsne ip, r4, r0
88d4: 1195c002 orrsne ip, r5, r2
88d8: 11f0cac4 mvnsne ip, r4, asr #
88dc: 11f0cac5 mvnsne ip, r5, asr #
88e0: 0a000079 beq 8acc <__adddf3+0x210>
88e4: e1a04aa4 lsr r4, r4, #
88e8: e0745aa5 rsbs r5, r4, r5, lsr #
88ec: b2655000 rsblt r5, r5, #
88f0: da000006 ble <__adddf3+0x54>
88f4: e0844005 add r4, r4, r5
88f8: e0202002 eor r2, r0, r2
88fc: e0213003 eor r3, r1, r3
: e0220000 eor r0, r2, r0
: e0231001 eor r1, r3, r1
: e0202002 eor r2, r0, r2
890c: e0213003 eor r3, r1, r3
: e3550036 cmp r5, # ; 0x36
: 88bd8030 pophi {r4, r5, pc}
: e3110102 tst r1, #- ; 0x80000000
891c: e1a01601 lsl r1, r1, #
: e3a0c601 mov ip, # ; 0x100000
: e18c1621 orr r1, ip, r1, lsr #
: 0a000001 beq <__adddf3+0x78>
892c: e2700000 rsbs r0, r0, #
: e2e11000 rsc r1, r1, #
: e3130102 tst r3, #- ; 0x80000000
: e1a03603 lsl r3, r3, #
893c: e18c3623 orr r3, ip, r3, lsr #
: 0a000001 beq 894c <__adddf3+0x90>
: e2722000 rsbs r2, r2, #
: e2e33000 rsc r3, r3, #
894c: e1340005 teq r4, r5
: 0a000057 beq 8ab4 <__adddf3+0x1f8>
: e2444001 sub r4, r4, #
: e275e020 rsbs lr, r5, #
895c: ba000005 blt <__adddf3+0xbc>
: e1a0ce12 lsl ip, r2, lr
: e0900532 adds r0, r0, r2, lsr r5
: e2a11000 adc r1, r1, #
896c: e0900e13 adds r0, r0, r3, lsl lr
: e0b11553 adcs r1, r1, r3, asr r5
: ea000006 b <__adddf3+0xd8>
: e2455020 sub r5, r5, #
897c: e28ee020 add lr, lr, #
: e3520001 cmp r2, #
: e1a0ce13 lsl ip, r3, lr
: 238cc002 orrcs ip, ip, #
898c: e0900553 adds r0, r0, r3, asr r5
: e0b11fc3 adcs r1, r1, r3, asr #
: e2015102 and r5, r1, #- ; 0x80000000
: 5a000002 bpl 89a8 <__adddf3+0xec>
899c: e27cc000 rsbs ip, ip, #
89a0: e2f00000 rscs r0, r0, #
89a4: e2e11000 rsc r1, r1, #
89a8: e3510601 cmp r1, # ; 0x100000
89ac: 3a00000e bcc 89ec <__adddf3+0x130>
89b0: e3510602 cmp r1, # ; 0x200000
89b4: 3a000006 bcc 89d4 <__adddf3+0x118>
89b8: e1b010a1 lsrs r1, r1, #
89bc: e1b00060 rrxs r0, r0
89c0: e1a0c06c rrx ip, ip
89c4: e2844001 add r4, r4, #
89c8: e1a02a84 lsl r2, r4, #
89cc: e3720501 cmn r2, # ; 0x400000
89d0: 2a000055 bcs 8b2c <__adddf3+0x270>
89d4: e35c0102 cmp ip, #- ; 0x80000000
89d8: 01b0c0a0 lsrseq ip, r0, #
89dc: e2b00000 adcs r0, r0, #
89e0: e0a11a04 adc r1, r1, r4, lsl #
89e4: e1811005 orr r1, r1, r5
89e8: e8bd8030 pop {r4, r5, pc}
89ec: e1b0c08c lsls ip, ip, #
89f0: e0b00000 adcs r0, r0, r0
89f4: e0a11001 adc r1, r1, r1
89f8: e3110601 tst r1, # ; 0x100000
89fc: e2444001 sub r4, r4, #
8a00: 1afffff3 bne 89d4 <__adddf3+0x118>
8a04: e3310000 teq r1, #
8a08: 01a01000 moveq r1, r0
8a0c: 03a00000 moveq r0, #
8a10: e16f3f11 clz r3, r1
8a14: addeq r3, r3, #
8a18: e243300b sub r3, r3, #
8a1c: e2532020 subs r2, r3, #
8a20: aa000007 bge 8a44 <__adddf3+0x188>
8a24: e292200c adds r2, r2, #
8a28: da000004 ble 8a40 <__adddf3+0x184>
8a2c: e282c014 add ip, r2, #
8a30: e262200c rsb r2, r2, #
8a34: e1a00c11 lsl r0, r1, ip
8a38: e1a01231 lsr r1, r1, r2
8a3c: ea000004 b 8a54 <__adddf3+0x198>
8a40: e2822014 add r2, r2, #
8a44: d262c020 rsble ip, r2, #
8a48: e1a01211 lsl r1, r1, r2
8a4c: d1811c30 orrle r1, r1, r0, lsr ip
8a50: d1a00210 lslle r0, r0, r2
8a54: e0544003 subs r4, r4, r3
8a58: a0811a04 addge r1, r1, r4, lsl #
8a5c: a1811005 orrge r1, r1, r5
8a60: a8bd8030 popge {r4, r5, pc}
8a64: e1e04004 mvn r4, r4
8a68: e254401f subs r4, r4, #
8a6c: aa00000d bge 8aa8 <__adddf3+0x1ec>
8a70: e294400c adds r4, r4, #
8a74: ca000005 bgt 8a90 <__adddf3+0x1d4>
8a78: e2844014 add r4, r4, #
8a7c: e2642020 rsb r2, r4, #
8a80: e1a00430 lsr r0, r0, r4
8a84: e1800211 orr r0, r0, r1, lsl r2
8a88: e1851431 orr r1, r5, r1, lsr r4
8a8c: e8bd8030 pop {r4, r5, pc}
8a90: e264400c rsb r4, r4, #
8a94: e2642020 rsb r2, r4, #
8a98: e1a00230 lsr r0, r0, r2
8a9c: e1800411 orr r0, r0, r1, lsl r4
8aa0: e1a01005 mov r1, r5
8aa4: e8bd8030 pop {r4, r5, pc}
8aa8: e1a00431 lsr r0, r1, r4
8aac: e1a01005 mov r1, r5
8ab0: e8bd8030 pop {r4, r5, pc}
8ab4: e3340000 teq r4, #
8ab8: e2233601 eor r3, r3, # ; 0x100000
8abc: eoreq r1, r1, # ; 0x100000
8ac0: addeq r4, r4, #
8ac4: subne r5, r5, #
8ac8: eaffffa1 b <__adddf3+0x98>
8acc: e1f0cac4 mvns ip, r4, asr #
8ad0: 11f0cac5 mvnsne ip, r5, asr #
8ad4: 0a000018 beq 8b3c <__adddf3+0x280>
8ad8: e1340005 teq r4, r5
8adc: teqeq r0, r2
8ae0: 0a000003 beq 8af4 <__adddf3+0x238>
8ae4: e194c000 orrs ip, r4, r0
8ae8: 01a01003 moveq r1, r3
8aec: 01a00002 moveq r0, r2
8af0: e8bd8030 pop {r4, r5, pc}
8af4: e1310003 teq r1, r3
8af8: 13a01000 movne r1, #
8afc: 13a00000 movne r0, #
8b00: 18bd8030 popne {r4, r5, pc}
8b04: e1b0caa4 lsrs ip, r4, #
8b08: 1a000003 bne 8b1c <__adddf3+0x260>
8b0c: e1b00080 lsls r0, r0, #
8b10: e0b11001 adcs r1, r1, r1
8b14: orrcs r1, r1, #- ; 0x80000000
8b18: e8bd8030 pop {r4, r5, pc}
8b1c: e2944501 adds r4, r4, # ; 0x400000
8b20: addcc r1, r1, # ; 0x100000
8b24: 38bd8030 popcc {r4, r5, pc}
8b28: e2015102 and r5, r1, #- ; 0x80000000
8b2c: e385147f orr r1, r5, # ; 0x7f000000
8b30: e381160f orr r1, r1, # ; 0xf00000
8b34: e3a00000 mov r0, #
8b38: e8bd8030 pop {r4, r5, pc}
8b3c: e1f0cac4 mvns ip, r4, asr #
8b40: 11a01003 movne r1, r3
8b44: 11a00002 movne r0, r2
8b48: 01f0cac5 mvnseq ip, r5, asr #
8b4c: 11a03001 movne r3, r1
8b50: 11a02000 movne r2, r0
8b54: e1904601 orrs r4, r0, r1, lsl #
8b58: orrseq r5, r2, r3, lsl #
8b5c: teqeq r1, r3
8b60: orrne r1, r1, # ; 0x80000
8b64: e8bd8030 pop {r4, r5, pc} 00008b68 <__aeabi_ui2d>:
8b68: e3300000 teq r0, #
8b6c: 03a01000 moveq r1, #
8b70: 012fff1e bxeq lr
8b74: e92d4030 push {r4, r5, lr}
8b78: e3a04b01 mov r4, # ; 0x400
8b7c: e2844032 add r4, r4, # ; 0x32
8b80: e3a05000 mov r5, #
8b84: e3a01000 mov r1, #
8b88: eaffff9d b 8a04 <__adddf3+0x148> 00008b8c <__aeabi_i2d>:
8b8c: e3300000 teq r0, #
8b90: 03a01000 moveq r1, #
8b94: 012fff1e bxeq lr
8b98: e92d4030 push {r4, r5, lr}
8b9c: e3a04b01 mov r4, # ; 0x400
8ba0: e2844032 add r4, r4, # ; 0x32
8ba4: e2105102 ands r5, r0, #- ; 0x80000000
8ba8: rsbmi r0, r0, #
8bac: e3a01000 mov r1, #
8bb0: eaffff93 b 8a04 <__adddf3+0x148> 00008bb4 <__aeabi_f2d>:
8bb4: e1b02080 lsls r2, r0, #
8bb8: e1a011c2 asr r1, r2, #
8bbc: e1a01061 rrx r1, r1
8bc0: e1a00e02 lsl r0, r2, #
8bc4: 121234ff andsne r3, r2, #- ; 0xff000000
8bc8: 133304ff teqne r3, #- ; 0xff000000
8bcc: 1221130e eorne r1, r1, # ; 0x38000000
8bd0: 112fff1e bxne lr
8bd4: e3320000 teq r2, #
8bd8: 133304ff teqne r3, #- ; 0xff000000
8bdc: 012fff1e bxeq lr
8be0: e92d4030 push {r4, r5, lr}
8be4: e3a04d0e mov r4, # ; 0x380
8be8: e2015102 and r5, r1, #- ; 0x80000000
8bec: e3c11102 bic r1, r1, #- ; 0x80000000
8bf0: eaffff83 b 8a04 <__adddf3+0x148> 00008bf4 <__aeabi_ul2d>:
8bf4: e1902001 orrs r2, r0, r1
8bf8: 012fff1e bxeq lr
8bfc: e92d4030 push {r4, r5, lr}
8c00: e3a05000 mov r5, #
8c04: ea000006 b 8c24 <__aeabi_l2d+0x1c> 00008c08 <__aeabi_l2d>:
8c08: e1902001 orrs r2, r0, r1
8c0c: 012fff1e bxeq lr
8c10: e92d4030 push {r4, r5, lr}
8c14: e2115102 ands r5, r1, #- ; 0x80000000
8c18: 5a000001 bpl 8c24 <__aeabi_l2d+0x1c>
8c1c: e2700000 rsbs r0, r0, #
8c20: e2e11000 rsc r1, r1, #
8c24: e3a04b01 mov r4, # ; 0x400
8c28: e2844032 add r4, r4, # ; 0x32
8c2c: e1b0cb21 lsrs ip, r1, #
8c30: 0affff5c beq 89a8 <__adddf3+0xec>
8c34: e3a02003 mov r2, #
8c38: e1b0c1ac lsrs ip, ip, #
8c3c: addne r2, r2, #
8c40: e1b0c1ac lsrs ip, ip, #
8c44: addne r2, r2, #
8c48: e08221ac add r2, r2, ip, lsr #
8c4c: e2623020 rsb r3, r2, #
8c50: e1a0c310 lsl ip, r0, r3
8c54: e1a00230 lsr r0, r0, r2
8c58: e1800311 orr r0, r0, r1, lsl r3
8c5c: e1a01231 lsr r1, r1, r2
8c60: e0844002 add r4, r4, r2
8c64: eaffff4f b 89a8 <__adddf3+0xec> 00008c68 <__aeabi_dmul>:
8c68: e92d4070 push {r4, r5, r6, lr}
8c6c: e3a0c0ff mov ip, # ; 0xff
8c70: e38ccc07 orr ip, ip, # ; 0x700
8c74: e01c4a21 ands r4, ip, r1, lsr #
8c78: 101c5a23 andsne r5, ip, r3, lsr #
8c7c: 1134000c teqne r4, ip
8c80: 1135000c teqne r5, ip
8c84: 0b00006f bleq 8e48 <__aeabi_dmul+0x1e0>
8c88: e0844005 add r4, r4, r5
8c8c: e0216003 eor r6, r1, r3
8c90: e1c11a8c bic r1, r1, ip, lsl #
8c94: e1c33a8c bic r3, r3, ip, lsl #
8c98: e1905601 orrs r5, r0, r1, lsl #
8c9c: orrsne r5, r2, r3, lsl #
8ca0: e3811601 orr r1, r1, # ; 0x100000
8ca4: e3833601 orr r3, r3, # ; 0x100000
8ca8: 0a00001c beq 8d20 <__aeabi_dmul+0xb8>
8cac: e08ec290 umull ip, lr, r0, r2
8cb0: e3a05000 mov r5, #
8cb4: e0a5e291 umlal lr, r5, r1, r2
8cb8: e2062102 and r2, r6, #- ; 0x80000000
8cbc: e0a5e390 umlal lr, r5, r0, r3
8cc0: e3a06000 mov r6, #
8cc4: e0a65391 umlal r5, r6, r1, r3
8cc8: e33c0000 teq ip, #
8ccc: 138ee001 orrne lr, lr, #
8cd0: e24440ff sub r4, r4, # ; 0xff
8cd4: e3560c02 cmp r6, # ; 0x200
8cd8: e2c44c03 sbc r4, r4, # ; 0x300
8cdc: 2a000002 bcs 8cec <__aeabi_dmul+0x84>
8ce0: e1b0e08e lsls lr, lr, #
8ce4: e0b55005 adcs r5, r5, r5
8ce8: e0a66006 adc r6, r6, r6
8cec: e1821586 orr r1, r2, r6, lsl #
8cf0: e1811aa5 orr r1, r1, r5, lsr #
8cf4: e1a00585 lsl r0, r5, #
8cf8: e1800aae orr r0, r0, lr, lsr #
8cfc: e1a0e58e lsl lr, lr, #
8d00: e254c0fd subs ip, r4, # ; 0xfd
8d04: 835c0c07 cmphi ip, # ; 0x700
8d08: 8a00000f bhi 8d4c <__aeabi_dmul+0xe4>
8d0c: e35e0102 cmp lr, #- ; 0x80000000
8d10: 01b0e0a0 lsrseq lr, r0, #
8d14: e2b00000 adcs r0, r0, #
8d18: e0a11a04 adc r1, r1, r4, lsl #
8d1c: e8bd8070 pop {r4, r5, r6, pc}
8d20: e2066102 and r6, r6, #- ; 0x80000000
8d24: e1861001 orr r1, r6, r1
8d28: e1800002 orr r0, r0, r2
8d2c: e0211003 eor r1, r1, r3
8d30: e05440ac subs r4, r4, ip, lsr #
8d34: c074500c rsbsgt r5, r4, ip
8d38: c1811a04 orrgt r1, r1, r4, lsl #
8d3c: c8bd8070 popgt {r4, r5, r6, pc}
8d40: e3811601 orr r1, r1, # ; 0x100000
8d44: e3a0e000 mov lr, #
8d48: e2544001 subs r4, r4, #
8d4c: ca000058 bgt 8eb4 <__aeabi_dmul+0x24c>
8d50: e3740036 cmn r4, # ; 0x36
8d54: d3a00000 movle r0, #
8d58: d2011102 andle r1, r1, #- ; 0x80000000
8d5c: d8bd8070 pople {r4, r5, r6, pc}
8d60: e2644000 rsb r4, r4, #
8d64: e2544020 subs r4, r4, #
8d68: aa000018 bge 8dd0 <__aeabi_dmul+0x168>
8d6c: e294400c adds r4, r4, #
8d70: ca00000b bgt 8da4 <__aeabi_dmul+0x13c>
8d74: e2844014 add r4, r4, #
8d78: e2645020 rsb r5, r4, #
8d7c: e1a03510 lsl r3, r0, r5
8d80: e1a00430 lsr r0, r0, r4
8d84: e1800511 orr r0, r0, r1, lsl r5
8d88: e2012102 and r2, r1, #- ; 0x80000000
8d8c: e3c11102 bic r1, r1, #- ; 0x80000000
8d90: e0900fa3 adds r0, r0, r3, lsr #
8d94: e0a21431 adc r1, r2, r1, lsr r4
8d98: e19ee083 orrs lr, lr, r3, lsl #
8d9c: 01c00fa3 biceq r0, r0, r3, lsr #
8da0: e8bd8070 pop {r4, r5, r6, pc}
8da4: e264400c rsb r4, r4, #
8da8: e2645020 rsb r5, r4, #
8dac: e1a03410 lsl r3, r0, r4
8db0: e1a00530 lsr r0, r0, r5
8db4: e1800411 orr r0, r0, r1, lsl r4
8db8: e2011102 and r1, r1, #- ; 0x80000000
8dbc: e0900fa3 adds r0, r0, r3, lsr #
8dc0: e2a11000 adc r1, r1, #
8dc4: e19ee083 orrs lr, lr, r3, lsl #
8dc8: 01c00fa3 biceq r0, r0, r3, lsr #
8dcc: e8bd8070 pop {r4, r5, r6, pc}
8dd0: e2645020 rsb r5, r4, #
8dd4: e18ee510 orr lr, lr, r0, lsl r5
8dd8: e1a03430 lsr r3, r0, r4
8ddc: e1833511 orr r3, r3, r1, lsl r5
8de0: e1a00431 lsr r0, r1, r4
8de4: e2011102 and r1, r1, #- ; 0x80000000
8de8: e1c00431 bic r0, r0, r1, lsr r4
8dec: e0800fa3 add r0, r0, r3, lsr #
8df0: e19ee083 orrs lr, lr, r3, lsl #
8df4: 01c00fa3 biceq r0, r0, r3, lsr #
8df8: e8bd8070 pop {r4, r5, r6, pc}
8dfc: e3340000 teq r4, #
8e00: 1a000008 bne 8e28 <__aeabi_dmul+0x1c0>
8e04: e2016102 and r6, r1, #- ; 0x80000000
8e08: e1b00080 lsls r0, r0, #
8e0c: e0a11001 adc r1, r1, r1
8e10: e3110601 tst r1, # ; 0x100000
8e14: subeq r4, r4, #
8e18: 0afffffa beq 8e08 <__aeabi_dmul+0x1a0>
8e1c: e1811006 orr r1, r1, r6
8e20: e3350000 teq r5, #
8e24: 112fff1e bxne lr
8e28: e2036102 and r6, r3, #- ; 0x80000000
8e2c: e1b02082 lsls r2, r2, #
8e30: e0a33003 adc r3, r3, r3
8e34: e3130601 tst r3, # ; 0x100000
8e38: subeq r5, r5, #
8e3c: 0afffffa beq 8e2c <__aeabi_dmul+0x1c4>
8e40: e1833006 orr r3, r3, r6
8e44: e12fff1e bx lr
8e48: e134000c teq r4, ip
8e4c: e00c5a23 and r5, ip, r3, lsr #
8e50: 1135000c teqne r5, ip
8e54: 0a000006 beq 8e74 <__aeabi_dmul+0x20c>
8e58: e1906081 orrs r6, r0, r1, lsl #
8e5c: orrsne r6, r2, r3, lsl #
8e60: 1affffe5 bne 8dfc <__aeabi_dmul+0x194>
8e64: e0211003 eor r1, r1, r3
8e68: e2011102 and r1, r1, #- ; 0x80000000
8e6c: e3a00000 mov r0, #
8e70: e8bd8070 pop {r4, r5, r6, pc}
8e74: e1906081 orrs r6, r0, r1, lsl #
8e78: 01a00002 moveq r0, r2
8e7c: 01a01003 moveq r1, r3
8e80: orrsne r6, r2, r3, lsl #
8e84: 0a00000f beq 8ec8 <__aeabi_dmul+0x260>
8e88: e134000c teq r4, ip
8e8c: 1a000001 bne 8e98 <__aeabi_dmul+0x230>
8e90: e1906601 orrs r6, r0, r1, lsl #
8e94: 1a00000b bne 8ec8 <__aeabi_dmul+0x260>
8e98: e135000c teq r5, ip
8e9c: 1a000003 bne 8eb0 <__aeabi_dmul+0x248>
8ea0: e1926603 orrs r6, r2, r3, lsl #
8ea4: 11a00002 movne r0, r2
8ea8: 11a01003 movne r1, r3
8eac: 1a000005 bne 8ec8 <__aeabi_dmul+0x260>
8eb0: e0211003 eor r1, r1, r3
8eb4: e2011102 and r1, r1, #- ; 0x80000000
8eb8: e381147f orr r1, r1, # ; 0x7f000000
8ebc: e381160f orr r1, r1, # ; 0xf00000
8ec0: e3a00000 mov r0, #
8ec4: e8bd8070 pop {r4, r5, r6, pc}
8ec8: e381147f orr r1, r1, # ; 0x7f000000
8ecc: e381173e orr r1, r1, # ; 0xf80000
8ed0: e8bd8070 pop {r4, r5, r6, pc} 00008ed4 <__aeabi_ddiv>:
8ed4: e92d4070 push {r4, r5, r6, lr}
8ed8: e3a0c0ff mov ip, # ; 0xff
8edc: e38ccc07 orr ip, ip, # ; 0x700
8ee0: e01c4a21 ands r4, ip, r1, lsr #
8ee4: 101c5a23 andsne r5, ip, r3, lsr #
8ee8: 1134000c teqne r4, ip
8eec: 1135000c teqne r5, ip
8ef0: 0b00005c bleq <__aeabi_ddiv+0x194>
8ef4: e0444005 sub r4, r4, r5
8ef8: e021e003 eor lr, r1, r3
8efc: e1925603 orrs r5, r2, r3, lsl #
8f00: e1a01601 lsl r1, r1, #
8f04: 0a00004b beq <__aeabi_ddiv+0x164>
8f08: e1a03603 lsl r3, r3, #
8f0c: e3a05201 mov r5, # ; 0x10000000
8f10: e1853223 orr r3, r5, r3, lsr #
8f14: e1833c22 orr r3, r3, r2, lsr #
8f18: e1a02402 lsl r2, r2, #
8f1c: e1855221 orr r5, r5, r1, lsr #
8f20: e1855c20 orr r5, r5, r0, lsr #
8f24: e1a06400 lsl r6, r0, #
8f28: e20e1102 and r1, lr, #- ; 0x80000000
8f2c: e1550003 cmp r5, r3
8f30: cmpeq r6, r2
8f34: e2a440fd adc r4, r4, # ; 0xfd
8f38: e2844c03 add r4, r4, # ; 0x300
8f3c: 2a000001 bcs 8f48 <__aeabi_ddiv+0x74>
8f40: e1b030a3 lsrs r3, r3, #
8f44: e1a02062 rrx r2, r2
8f48: e0566002 subs r6, r6, r2
8f4c: e0c55003 sbc r5, r5, r3
8f50: e1b030a3 lsrs r3, r3, #
8f54: e1a02062 rrx r2, r2
8f58: e3a00601 mov r0, # ; 0x100000
8f5c: e3a0c702 mov ip, # ; 0x80000
8f60: e056e002 subs lr, r6, r2
8f64: e0d5e003 sbcs lr, r5, r3
8f68: subcs r6, r6, r2
8f6c: 21a0500e movcs r5, lr
8f70: 2180000c orrcs r0, r0, ip
8f74: e1b030a3 lsrs r3, r3, #
8f78: e1a02062 rrx r2, r2
8f7c: e056e002 subs lr, r6, r2
8f80: e0d5e003 sbcs lr, r5, r3
8f84: subcs r6, r6, r2
8f88: 21a0500e movcs r5, lr
8f8c: 218000ac orrcs r0, r0, ip, lsr #
8f90: e1b030a3 lsrs r3, r3, #
8f94: e1a02062 rrx r2, r2
8f98: e056e002 subs lr, r6, r2
8f9c: e0d5e003 sbcs lr, r5, r3
8fa0: subcs r6, r6, r2
8fa4: 21a0500e movcs r5, lr
8fa8: 2180012c orrcs r0, r0, ip, lsr #
8fac: e1b030a3 lsrs r3, r3, #
8fb0: e1a02062 rrx r2, r2
8fb4: e056e002 subs lr, r6, r2
8fb8: e0d5e003 sbcs lr, r5, r3
8fbc: subcs r6, r6, r2
8fc0: 21a0500e movcs r5, lr
8fc4: 218001ac orrcs r0, r0, ip, lsr #
8fc8: e195e006 orrs lr, r5, r6
8fcc: 0a00000d beq <__aeabi_ddiv+0x134>
8fd0: e1a05205 lsl r5, r5, #
8fd4: e1855e26 orr r5, r5, r6, lsr #
8fd8: e1a06206 lsl r6, r6, #
8fdc: e1a03183 lsl r3, r3, #
8fe0: e1833ea2 orr r3, r3, r2, lsr #
8fe4: e1a02182 lsl r2, r2, #
8fe8: e1b0c22c lsrs ip, ip, #
8fec: 1affffdb bne 8f60 <__aeabi_ddiv+0x8c>
8ff0: e3110601 tst r1, # ; 0x100000
8ff4: 1a000006 bne <__aeabi_ddiv+0x140>
8ff8: e1811000 orr r1, r1, r0
8ffc: e3a00000 mov r0, #
: e3a0c102 mov ip, #- ; 0x80000000
: eaffffd5 b 8f60 <__aeabi_ddiv+0x8c>
: e3110601 tst r1, # ; 0x100000
900c: orreq r1, r1, r0
: 03a00000 moveq r0, #
: e254c0fd subs ip, r4, # ; 0xfd
: 835c0c07 cmphi ip, # ; 0x700
901c: 8affff4a bhi 8d4c <__aeabi_dmul+0xe4>
: e055c003 subs ip, r5, r3
: 0056c002 subseq ip, r6, r2
: 01b0c0a0 lsrseq ip, r0, #
902c: e2b00000 adcs r0, r0, #
: e0a11a04 adc r1, r1, r4, lsl #
: e8bd8070 pop {r4, r5, r6, pc}
: e20ee102 and lr, lr, #- ; 0x80000000
903c: e18e1621 orr r1, lr, r1, lsr #
: e09440ac adds r4, r4, ip, lsr #
: c074500c rsbsgt r5, r4, ip
: c1811a04 orrgt r1, r1, r4, lsl #
904c: c8bd8070 popgt {r4, r5, r6, pc}
: e3811601 orr r1, r1, # ; 0x100000
: e3a0e000 mov lr, #
: e2544001 subs r4, r4, #
905c: eaffff3a b 8d4c <__aeabi_dmul+0xe4>
: e185e006 orr lr, r5, r6
: eaffff38 b 8d4c <__aeabi_dmul+0xe4>
: e00c5a23 and r5, ip, r3, lsr #
906c: e134000c teq r4, ip
: 0135000c teqeq r5, ip
: 0affff93 beq 8ec8 <__aeabi_dmul+0x260>
: e134000c teq r4, ip
907c: 1a000006 bne 909c <__aeabi_ddiv+0x1c8>
: e1904601 orrs r4, r0, r1, lsl #
: 1affff8f bne 8ec8 <__aeabi_dmul+0x260>
: e135000c teq r5, ip
908c: 1affff87 bne 8eb0 <__aeabi_dmul+0x248>
: e1a00002 mov r0, r2
: e1a01003 mov r1, r3
: eaffff8a b 8ec8 <__aeabi_dmul+0x260>
909c: e135000c teq r5, ip
90a0: 1a000004 bne 90b8 <__aeabi_ddiv+0x1e4>
90a4: e1925603 orrs r5, r2, r3, lsl #
90a8: 0affff6d beq 8e64 <__aeabi_dmul+0x1fc>
90ac: e1a00002 mov r0, r2
90b0: e1a01003 mov r1, r3
90b4: eaffff83 b 8ec8 <__aeabi_dmul+0x260>
90b8: e1906081 orrs r6, r0, r1, lsl #
90bc: orrsne r6, r2, r3, lsl #
90c0: 1affff4d bne 8dfc <__aeabi_dmul+0x194>
90c4: e1904081 orrs r4, r0, r1, lsl #
90c8: 1affff78 bne 8eb0 <__aeabi_dmul+0x248>
90cc: e1925083 orrs r5, r2, r3, lsl #
90d0: 1affff63 bne 8e64 <__aeabi_dmul+0x1fc>
90d4: eaffff7b b 8ec8 <__aeabi_dmul+0x260> 000090d8 <__gedf2>:
90d8: e3e0c000 mvn ip, #
90dc: ea000002 b 90ec <__cmpdf2+0x4> 000090e0 <__ledf2>:
90e0: e3a0c001 mov ip, #
90e4: ea000000 b 90ec <__cmpdf2+0x4> 000090e8 <__cmpdf2>:
90e8: e3a0c001 mov ip, #
90ec: e52dc004 push {ip} ; (str ip, [sp, #-]!)
90f0: e1a0c081 lsl ip, r1, #
90f4: e1f0cacc mvns ip, ip, asr #
90f8: e1a0c083 lsl ip, r3, #
90fc: 11f0cacc mvnsne ip, ip, asr #
: 0a00000e beq <__cmpdf2+0x58>
: e28dd004 add sp, sp, #
: e190c081 orrs ip, r0, r1, lsl #
910c: 0192c083 orrseq ip, r2, r3, lsl #
: teqne r1, r3
: teqeq r0, r2
: 03a00000 moveq r0, #
911c: 012fff1e bxeq lr
: e3700000 cmn r0, #
: e1310003 teq r1, r3
: cmppl r1, r3
912c: cmpeq r0, r2
: 21a00fc3 asrcs r0, r3, #
: 31e00fc3 mvncc r0, r3, asr #
: e3800001 orr r0, r0, #
913c: e12fff1e bx lr
: e1a0c081 lsl ip, r1, #
: e1f0cacc mvns ip, ip, asr #
: 1a000001 bne <__cmpdf2+0x6c>
914c: e190c601 orrs ip, r0, r1, lsl #
: 1a000004 bne <__cmpdf2+0x80>
: e1a0c083 lsl ip, r3, #
: e1f0cacc mvns ip, ip, asr #
915c: 1affffe8 bne <__cmpdf2+0x1c>
: e192c603 orrs ip, r2, r3, lsl #
: 0affffe6 beq <__cmpdf2+0x1c>
: e49d0004 pop {r0} ; (ldr r0, [sp], #)
916c: e12fff1e bx lr <__aeabi_cdrcmple>:
: e1a0c000 mov ip, r0
: e1a00002 mov r0, r2
: e1a0200c mov r2, ip
917c: e1a0c001 mov ip, r1
: e1a01003 mov r1, r3
: e1a0300c mov r3, ip
: eaffffff b 918c <__aeabi_cdcmpeq> 0000918c <__aeabi_cdcmpeq>:
918c: e92d4001 push {r0, lr}
: ebffffd4 bl 90e8 <__cmpdf2>
: e3500000 cmp r0, #
: cmnmi r0, #
919c: e8bd8001 pop {r0, pc} 000091a0 <__aeabi_dcmpeq>:
91a0: e52de008 str lr, [sp, #-]!
91a4: ebfffff8 bl 918c <__aeabi_cdcmpeq>
91a8: 03a00001 moveq r0, #
91ac: 13a00000 movne r0, #
91b0: e49df008 ldr pc, [sp], # 000091b4 <__aeabi_dcmplt>:
91b4: e52de008 str lr, [sp, #-]!
91b8: ebfffff3 bl 918c <__aeabi_cdcmpeq>
91bc: 33a00001 movcc r0, #
91c0: 23a00000 movcs r0, #
91c4: e49df008 ldr pc, [sp], # 000091c8 <__aeabi_dcmple>:
91c8: e52de008 str lr, [sp, #-]!
91cc: ebffffee bl 918c <__aeabi_cdcmpeq>
91d0: 93a00001 movls r0, #
91d4: 83a00000 movhi r0, #
91d8: e49df008 ldr pc, [sp], # 000091dc <__aeabi_dcmpge>:
91dc: e52de008 str lr, [sp, #-]!
91e0: ebffffe2 bl <__aeabi_cdrcmple>
91e4: 93a00001 movls r0, #
91e8: 83a00000 movhi r0, #
91ec: e49df008 ldr pc, [sp], # 000091f0 <__aeabi_dcmpgt>:
91f0: e52de008 str lr, [sp, #-]!
91f4: ebffffdd bl <__aeabi_cdrcmple>
91f8: 33a00001 movcc r0, #
91fc: 23a00000 movcs r0, #
: e49df008 ldr pc, [sp], # <__aeabi_d2iz>:
: e1a02081 lsl r2, r1, #
: e2922602 adds r2, r2, # ; 0x200000
920c: 2a00000c bcs <__aeabi_d2iz+0x40>
: 5a000009 bpl 923c <__aeabi_d2iz+0x38>
: e3e03e3e mvn r3, # ; 0x3e0
: e0532ac2 subs r2, r3, r2, asr #
921c: 9a00000a bls 924c <__aeabi_d2iz+0x48>
: e1a03581 lsl r3, r1, #
: e3833102 orr r3, r3, #- ; 0x80000000
: e1833aa0 orr r3, r3, r0, lsr #
922c: e3110102 tst r1, #- ; 0x80000000
: e1a00233 lsr r0, r3, r2
: rsbne r0, r0, #
: e12fff1e bx lr
923c: e3a00000 mov r0, #
: e12fff1e bx lr
: e1900601 orrs r0, r0, r1, lsl #
: 1a000002 bne <__aeabi_d2iz+0x54>
924c: e2110102 ands r0, r1, #- ; 0x80000000
: 03e00102 mvneq r0, #- ; 0x80000000
: e12fff1e bx lr
: e3a00000 mov r0, #
925c: e12fff1e bx lr <__libc_csu_init>:
: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
: e1a0a000 mov sl, r0
: e1a08001 mov r8, r1
926c: e1a07002 mov r7, r2
: e59f40a8 ldr r4, [pc, #] ; <__libc_csu_init+0xc0>
: ebfffc43 bl <_init>
: e59f10a4 ldr r1, [pc, #] ; <__libc_csu_init+0xc4>
927c: e08f4004 add r4, pc, r4
: e08f0001 add r0, pc, r1
: e0649000 rsb r9, r4, r0
: e1b09149 asrs r9, r9, #
928c: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
: e3a06001 mov r6, #
: e4943004 ldr r3, [r4], #
: e1a0000a mov r0, sl
929c: e1a01008 mov r1, r8
92a0: e1a02007 mov r2, r7
92a4: e2495001 sub r5, r9, #
92a8: e12fff33 blx r3
92ac: e1560009 cmp r6, r9
92b0: e0055006 and r5, r5, r6
92b4: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
92b8: e3550000 cmp r5, #
92bc: 0a000007 beq 92e0 <__libc_csu_init+0x80>
92c0: e494c004 ldr ip, [r4], #
92c4: e1a0000a mov r0, sl
92c8: e1a01008 mov r1, r8
92cc: e1a02007 mov r2, r7
92d0: e3a06002 mov r6, #
92d4: e12fff3c blx ip
92d8: e1560009 cmp r6, r9
92dc: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
92e0: e1a05004 mov r5, r4
92e4: e4953004 ldr r3, [r5], #
92e8: e1a0000a mov r0, sl
92ec: e1a01008 mov r1, r8
92f0: e1a02007 mov r2, r7
92f4: e12fff33 blx r3
92f8: e2866002 add r6, r6, #
92fc: e594c004 ldr ip, [r4, #]
: e1a0000a mov r0, sl
: e1a01008 mov r1, r8
: e1a02007 mov r2, r7
930c: e12fff3c blx ip
: e1560009 cmp r6, r9
: e2854004 add r4, r5, #
: 1afffff0 bne 92e0 <__libc_csu_init+0x80>
931c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
: .word 0x00008184
: .word 0x00008184 <__libc_csu_fini>:
: e12fff1e bx lr Disassembly of section .fini: 0000932c <_fini>:
932c: e92d4008 push {r3, lr}
: e8bd8008 pop {r3, pc}
arm-none-linux-gnueabi-objdump -d soft.bin > objdump_soft.txt
/* arm-none-linux-gnueabi-objdump -d softfp.bin > objdump_softfp.txt */
softfp.bin: file format elf32-littlearm Disassembly of section .init: <_init>:
: e92d4008 push {r3, lr}
838c: eb000024 bl <call_gmon_start>
: e8bd8008 pop {r3, pc} Disassembly of section .plt: <.plt>:
: e52de004 push {lr} ; (str lr, [sp, #-]!)
: e59fe004 ldr lr, [pc, #] ; 83a4 <_init+0x1c>
839c: e08fe00e add lr, pc, lr
83a0: e5bef008 ldr pc, [lr, #]!
83a4: 0000865c .word 0x0000865c
83a8: e28fc600 add ip, pc, #,
83ac: e28cca08 add ip, ip, #, ; 0x8000
83b0: e5bcf65c ldr pc, [ip, #]! ; 0x65c
83b4: e28fc600 add ip, pc, #,
83b8: e28cca08 add ip, ip, #, ; 0x8000
83bc: e5bcf654 ldr pc, [ip, #]! ; 0x654
83c0: e28fc600 add ip, pc, #,
83c4: e28cca08 add ip, ip, #, ; 0x8000
83c8: e5bcf64c ldr pc, [ip, #]! ; 0x64c
83cc: e28fc600 add ip, pc, #,
83d0: e28cca08 add ip, ip, #, ; 0x8000
83d4: e5bcf644 ldr pc, [ip, #]! ; 0x644
83d8: e28fc600 add ip, pc, #,
83dc: e28cca08 add ip, ip, #, ; 0x8000
83e0: e5bcf63c ldr pc, [ip, #]! ; 0x63c Disassembly of section .text: 000083e8 <_start>:
83e8: e3a0b000 mov fp, #
83ec: e3a0e000 mov lr, #
83f0: e49d1004 pop {r1} ; (ldr r1, [sp], #)
83f4: e1a0200d mov r2, sp
83f8: e52d2004 push {r2} ; (str r2, [sp, #-]!)
83fc: e52d0004 push {r0} ; (str r0, [sp, #-]!)
: e59fc010 ldr ip, [pc, #] ; <_start+0x30>
: e52dc004 push {ip} ; (str ip, [sp, #-]!)
: e59f000c ldr r0, [pc, #] ; 841c <_start+0x34>
840c: e59f300c ldr r3, [pc, #] ; <_start+0x38>
: ebffffe7 bl 83b4 <_init+0x2c>
: ebffffef bl 83d8 <_init+0x50>
: .word 0x00008830
841c: .word 0x00008590
: .word 0x00008768 <call_gmon_start>:
: e59f0014 ldr r0, [pc, #] ; <call_gmon_start+0x1c>
: e59f2014 ldr r2, [pc, #] ; <call_gmon_start+0x20>
842c: e08f3000 add r3, pc, r0
: e7933002 ldr r3, [r3, r2]
: e3530000 cmp r3, #
: 012fff1e bxeq lr
843c: eaffffdf b 83c0 <_init+0x38>
: 000085cc .word 0x000085cc
: .word 0x00000020 <__do_global_dtors_aux>:
: e59f3010 ldr r3, [pc, #] ; <__do_global_dtors_aux+0x18>
844c: e5d32000 ldrb r2, [r3]
: e3520000 cmp r2, #
: 03a02001 moveq r2, #
: 05c32000 strbeq r2, [r3]
845c: e12fff1e bx lr
: 00010a2c .word 0x00010a2c <frame_dummy>:
: e59f0020 ldr r0, [pc, #] ; 848c <frame_dummy+0x28>
: e92d4008 push {r3, lr}
846c: e5903000 ldr r3, [r0]
: e3530000 cmp r3, #
: 08bd8008 popeq {r3, pc}
: e59f3010 ldr r3, [pc, #] ; <frame_dummy+0x2c>
847c: e3530000 cmp r3, #
: 08bd8008 popeq {r3, pc}
: e12fff33 blx r3
: e8bd8008 pop {r3, pc}
848c: .word 0x00010904
... <ln>:
: e52db004 push {fp} ; (str fp, [sp, #-]!)
849c: e28db000 add fp, sp, #
84a0: e24dd034 sub sp, sp, # ; 0x34
84a4: e14b03f4 strd r0, [fp, #-] ; 0xffffffcc
84a8: e3a0300f mov r3, #
84ac: e50b3018 str r3, [fp, #-] ; 0xffffffe8
84b0: ed1b6b0d vldr d6, [fp, #-] ; 0xffffffcc
84b4: ed9f7b33 vldr d7, [pc, #] ; <ln+0xf0>
84b8: ee365b47 vsub.f64 d5, d6, d7
84bc: ed1b6b0d vldr d6, [fp, #-] ; 0xffffffcc
84c0: ed9f7b30 vldr d7, [pc, #] ; <ln+0xf0>
84c4: ee366b07 vadd.f64 d6, d6, d7
84c8: ee857b06 vdiv.f64 d7, d5, d6
84cc: ed0b7b09 vstr d7, [fp, #-] ; 0xffffffdc
84d0: ed1b6b09 vldr d6, [fp, #-] ; 0xffffffdc
84d4: ed1b7b09 vldr d7, [fp, #-] ; 0xffffffdc
84d8: ee267b07 vmul.f64 d7, d6, d7
84dc: ed0b7b0b vstr d7, [fp, #-] ; 0xffffffd4
84e0: e51b3018 ldr r3, [fp, #-] ; 0xffffffe8
84e4: e1a03083 lsl r3, r3, #
84e8: e2833001 add r3, r3, #
84ec: e50b300c str r3, [fp, #-]
84f0: e51b300c ldr r3, [fp, #-]
84f4: ee073a90 vmov s15, r3
84f8: eeb86be7 vcvt.f64.s32 d6, s15
84fc: ed9f5b21 vldr d5, [pc, #] ; <ln+0xf0>
: ee857b06 vdiv.f64 d7, d5, d6
: ed0b7b05 vstr d7, [fp, #-] ; 0xffffffec
: e51b3018 ldr r3, [fp, #-] ; 0xffffffe8
850c: e50b3008 str r3, [fp, #-]
: ea00000f b <ln+0xbc>
: e51b300c ldr r3, [fp, #-]
: e2433002 sub r3, r3, #
851c: e50b300c str r3, [fp, #-]
: e51b300c ldr r3, [fp, #-]
: ee063a90 vmov s13, r3
: eeb87be6 vcvt.f64.s32 d7, s13
852c: ed9f5b15 vldr d5, [pc, #] ; <ln+0xf0>
: ee856b07 vdiv.f64 d6, d5, d7
: ed1b5b0b vldr d5, [fp, #-] ; 0xffffffd4
: ed1b7b05 vldr d7, [fp, #-] ; 0xffffffec
853c: ee257b07 vmul.f64 d7, d5, d7
: ee367b07 vadd.f64 d7, d6, d7
: ed0b7b05 vstr d7, [fp, #-] ; 0xffffffec
: e51b3008 ldr r3, [fp, #-]
854c: e2433001 sub r3, r3, #
: e50b3008 str r3, [fp, #-]
: e51b3008 ldr r3, [fp, #-]
: e3530000 cmp r3, #
855c: caffffec bgt <ln+0x7c>
: ed1b7b09 vldr d7, [fp, #-] ; 0xffffffdc
: ee376b07 vadd.f64 d6, d7, d7
: ed1b7b05 vldr d7, [fp, #-] ; 0xffffffec
856c: ee267b07 vmul.f64 d7, d6, d7
: ec532b17 vmov r2, r3, d7
: e1a00002 mov r0, r2
: e1a01003 mov r1, r3
857c: e28bd000 add sp, fp, #
: e8bd0800 pop {fp}
: e12fff1e bx lr
: .word 0x00000000
858c: 3ff00000 .word 0x3ff00000 <main>:
: e92d4800 push {fp, lr}
: e28db004 add fp, sp, #
: e24dd030 sub sp, sp, # ; 0x30
859c: e3a03000 mov r3, #
85a0: e50b3024 str r3, [fp, #-] ; 0xffffffdc
85a4: e3a03000 mov r3, #
85a8: e50b3020 str r3, [fp, #-] ; 0xffffffe0
85ac: e3a03000 mov r3, #
85b0: e50b302c str r3, [fp, #-] ; 0xffffffd4
85b4: e3a03000 mov r3, #
85b8: e50b3028 str r3, [fp, #-] ; 0xffffffd8
85bc: e3a00002 mov r0, #
85c0: e24b3024 sub r3, fp, # ; 0x24
85c4: e1a01003 mov r1, r3
85c8: ebffff7f bl 83cc <_init+0x44>
85cc: e28f3f53 add r3, pc, # ; 0x14c
85d0: e1c320d0 ldrd r2, [r3]
85d4: e14b21f4 strd r2, [fp, #-] ; 0xffffffec
85d8: ea00001e b <main+0xc8>
85dc: ed1b6b05 vldr d6, [fp, #-] ; 0xffffffec
85e0: ed9f7b50 vldr d7, [pc, #] ; <main+0x198>
85e4: ee266b07 vmul.f64 d6, d6, d7
85e8: e28f3d05 add r3, pc, # ; 0x140
85ec: e1c320d0 ldrd r2, [r3]
85f0: ed1b7b05 vldr d7, [fp, #-] ; 0xffffffec
85f4: ec432b15 vmov d5, r2, r3
85f8: ee355b47 vsub.f64 d5, d5, d7
85fc: ee867b05 vdiv.f64 d7, d6, d5
: ed0b7b07 vstr d7, [fp, #-] ; 0xffffffe4
: ed1b5b07 vldr d5, [fp, #-] ; 0xffffffe4
: ed9f6b4a vldr d6, [pc, #] ; <main+0x1a8>
860c: ee857b06 vdiv.f64 d7, d5, d6
: ec510b17 vmov r0, r1, d7
: ebffff9f bl <ln>
: ec410b15 vmov d5, r0, r1
861c: ed9f6b47 vldr d6, [pc, #] ; <main+0x1b0>
: ee857b06 vdiv.f64 d7, d5, d6
: ed9f6b47 vldr d6, [pc, #] ; <main+0x1b8>
: ee376b06 vadd.f64 d6, d7, d6
862c: ed9f5b3b vldr d5, [pc, #] ; <main+0x190>
: ee857b06 vdiv.f64 d7, d5, d6
: ed9f6b45 vldr d6, [pc, #] ; <main+0x1c0>
: ee377b46 vsub.f64 d7, d7, d6
863c: eefd6bc7 vcvt.s32.f64 s13, d7
: ee163a90 vmov r3, s13
: e50b3008 str r3, [fp, #-]
: ed1b6b05 vldr d6, [fp, #-] ; 0xffffffec
864c: ed9f7b33 vldr d7, [pc, #] ; <main+0x190>
: ee367b07 vadd.f64 d7, d6, d7
: ed0b7b05 vstr d7, [fp, #-] ; 0xffffffec
: ed1b6b05 vldr d6, [fp, #-] ; 0xffffffec
865c: ed9f7b33 vldr d7, [pc, #] ; <main+0x1a0>
: eeb46bc7 vcmpe.f64 d6, d7
: eef1fa10 vmrs APSR_nzcv, fpscr
: 53a03000 movpl r3, #
866c: 43a03001 movmi r3, #
: e20330ff and r3, r3, # ; 0xff
: e3530000 cmp r3, #
: 1affffd7 bne 85dc <main+0x4c>
867c: e3a00002 mov r0, #
: e24b302c sub r3, fp, # ; 0x2c
: e1a01003 mov r1, r3
: ebffff4f bl 83cc <_init+0x44>
868c: e59f10c4 ldr r1, [pc, #] ; <main+0x1c8>
: e51b2024 ldr r2, [fp, #-] ; 0xffffffdc
: e51b3020 ldr r3, [fp, #-] ; 0xffffffe0
: e1a00001 mov r0, r1
869c: e1a01002 mov r1, r2
86a0: e1a02003 mov r2, r3
86a4: ebffff3f bl 83a8 <_init+0x20>
86a8: e59f10ac ldr r1, [pc, #] ; 875c <main+0x1cc>
86ac: e51b202c ldr r2, [fp, #-] ; 0xffffffd4
86b0: e51b3028 ldr r3, [fp, #-] ; 0xffffffd8
86b4: e1a00001 mov r0, r1
86b8: e1a01002 mov r1, r2
86bc: e1a02003 mov r2, r3
86c0: ebffff38 bl 83a8 <_init+0x20>
86c4: e59f0094 ldr r0, [pc, #] ; <main+0x1d0>
86c8: e51b202c ldr r2, [fp, #-] ; 0xffffffd4
86cc: e51b3024 ldr r3, [fp, #-] ; 0xffffffdc
86d0: e0632002 rsb r2, r3, r2
86d4: e51b1028 ldr r1, [fp, #-] ; 0xffffffd8
86d8: e51b3020 ldr r3, [fp, #-] ; 0xffffffe0
86dc: e0633001 rsb r3, r3, r1
86e0: e1a01000 mov r1, r0
86e4: e1a00001 mov r0, r1
86e8: e1a01002 mov r1, r2
86ec: e1a02003 mov r2, r3
86f0: ebffff2c bl 83a8 <_init+0x20>
86f4: e59f2068 ldr r2, [pc, #] ; <main+0x1d4>
86f8: e51b3008 ldr r3, [fp, #-]
86fc: e58d3000 str r3, [sp]
: e1a03002 mov r3, r2
: e1a00003 mov r0, r3
: e14b21d4 ldrd r2, [fp, #-] ; 0xffffffec
870c: ebffff25 bl 83a8 <_init+0x20>
: e3a03000 mov r3, #
: e1a00003 mov r0, r3
: e24bd004 sub sp, fp, #
871c: e8bd8800 pop {fp, pc}
: .word 0x00000000
: 3ff00000 .word 0x3ff00000
: .word 0x00000000
872c: 40e6f300 .word 0x40e6f300
: .word 0x00000000
: 409c2000 .word 0x409c2000
: .word 0x00000000
873c: 40c38800 .word 0x40c38800
: .word 0x00000000
: 40aedc00 .word 0x40aedc00
: dcb5db83 .word 0xdcb5db83
874c: 3f6b79e1 .word 0x3f6b79e1
: .word 0x66666666
: .word 0x40711266
: .word 0x00008840
875c: 0000885c .word 0x0000885c
: .word 0x00008878
: .word 0x00008890 <__libc_csu_init>:
: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
876c: e1a0a000 mov sl, r0
: e1a08001 mov r8, r1
: e1a07002 mov r7, r2
: e59f40a8 ldr r4, [pc, #] ; <__libc_csu_init+0xc0>
877c: ebffff01 bl <_init>
: e59f10a4 ldr r1, [pc, #] ; 882c <__libc_csu_init+0xc4>
: e08f4004 add r4, pc, r4
: e08f0001 add r0, pc, r1
878c: e0649000 rsb r9, r4, r0
: e1b09149 asrs r9, r9, #
: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
: e3a06001 mov r6, #
879c: e4943004 ldr r3, [r4], #
87a0: e1a0000a mov r0, sl
87a4: e1a01008 mov r1, r8
87a8: e1a02007 mov r2, r7
87ac: e2495001 sub r5, r9, #
87b0: e12fff33 blx r3
87b4: e1560009 cmp r6, r9
87b8: e0055006 and r5, r5, r6
87bc: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
87c0: e3550000 cmp r5, #
87c4: 0a000007 beq 87e8 <__libc_csu_init+0x80>
87c8: e494c004 ldr ip, [r4], #
87cc: e1a0000a mov r0, sl
87d0: e1a01008 mov r1, r8
87d4: e1a02007 mov r2, r7
87d8: e3a06002 mov r6, #
87dc: e12fff3c blx ip
87e0: e1560009 cmp r6, r9
87e4: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
87e8: e1a05004 mov r5, r4
87ec: e4953004 ldr r3, [r5], #
87f0: e1a0000a mov r0, sl
87f4: e1a01008 mov r1, r8
87f8: e1a02007 mov r2, r7
87fc: e12fff33 blx r3
: e2866002 add r6, r6, #
: e594c004 ldr ip, [r4, #]
: e1a0000a mov r0, sl
880c: e1a01008 mov r1, r8
: e1a02007 mov r2, r7
: e12fff3c blx ip
: e1560009 cmp r6, r9
881c: e2854004 add r4, r5, #
: 1afffff0 bne 87e8 <__libc_csu_init+0x80>
: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
: .word 0x00008170
882c: .word 0x00008170 <__libc_csu_fini>:
: e12fff1e bx lr Disassembly of section .fini: <_fini>:
: e92d4008 push {r3, lr}
: e8bd8008 pop {r3, pc}
arm-none-linux-gnueabi-objdump -d softfp.bin > objdump_softfp.txt
分别执行bin文件:
可以看出相差一个数量级 硬浮点2.7ms, 软浮点29.5ms, 性能还是差距很大的!
2.驱动程序
代码如下:
#include <linux/module.h>
#include <linux/configfs.h>
#include <linux/init.h>
#include <linux/kernel.h> static double ln(double a)
{
int N = ;
int k,nk;
double x,xx,y; x = (a-)/(a+);
xx = x*x;
nk = *N+;
y = 1.0/nk;
for(k=N;k>;k--) {
nk = nk - ;
y = 1.0/nk+xx*y;
} return 2.0*x*y;
} static int hello_init(void)
{
int t1, force2int;
double Rt, Vadc;
struct timespec time_start={, },time_end={, };
double a;
a = 3.9;
a = a*a;
printk("Hello,world! %f\n", a);
printk("Hello,world! %d\n", a);
printk("Hello,world! %d\n", (int)a); time_start = current_kernel_time();
/* 根据采样电压反推热敏电阻的温度 */
for(Vadc=; Vadc<; Vadc++) {
Rt = Vadc * / (-Vadc);
t1=/(ln(Rt/)/+/298.15)-273.15;
}
time_end = current_kernel_time(); printk("start time %ld s,%ld ns\n", time_start.tv_sec, time_start.tv_nsec);
printk("end time %ld s,%ld ns\n", time_end.tv_sec, time_end.tv_nsec);
printk("duration:%ld s %ld ns\n", time_end.tv_sec-time_start.tv_sec, time_end.tv_nsec-time_start.tv_nsec); force2int = (int)Vadc;
printk("%d = %d\n", force2int, t1); return ;
} static void hello_exit(void)
{
printk("Goodbye,cruel world!\n");
} module_init(hello_init);
module_exit(hello_exit); MODULE_AUTHOR("Vedic <FZKmxcz@163.com>");
MODULE_LICENSE("Dual BSD/GPL");
Makefile:
obj-m +=driver_test.o
driver_test-objs:= hello.o KDIR:=/home/fuzk/project/Prolin/firmware_4/build_dir/linux-sc9820_sc9820_pax/linux-3.10. COMPILER=/opt/toolchain/arm-2012.03/bin/arm-none-linux-gnueabi-gcc
LD_PATH=/opt/toolchain/arm-2012.03/bin/arm-none-linux-gnueabi-ld
AR_PATH=/opt/toolchain/arm-2012.03/bin/arm-none-linux-gnueabi-ar
ARCH_TYPE=arm ccflags-y += -mfloat-abi=softfp
ldflags-y += -L/opt/toolchain/arm-2012.03/lib/gcc/arm-none-linux-gnueabi/4.6. -lgcc -static all:
make CC=$(COMPILER) LD=$(LD_PATH) AR=$(AR_PATH) ARCH=$(ARCH_TYPE) -C $(KDIR) M=$(PWD) modules clean:
make CC=$(COMPILER) LD=$(LD_PATH) ARCH=$(ARCH_TYPE) -C $(KDIR) M=$(PWD) clean
由于是驱动所以得写个Makefile, 同时printk不支持打印浮点数格式, 只能先强制类型转换int再打印, 否则打印的数值是错的, 待会贴log就可以看出来
运行时间如下:
这里需要注意的是: 驱动在内核态, 进程不会被切出去(最多task_struct结构体的flag被标志NEED_RESHEDULE), 且只有中断才能打断其执行
而时间函数current_kernel_time()更新的步进应该是每10ms产生一个中断, 所以在中断前执行完读出来的时间戳是一样的, 或者在中断完成后读到
更新后的时间戳, 总而言之该时间函数精度为10ms, 测试几次出来发现要么0要么近10ms可以推测这段代码执行时间小于10ms!
反汇编发现汇编指令跟应用程序的硬浮点是一样的, 所以推测时间也在2.7ms左右
/* arm-none-linux-gnueabi-objdump -d driver_test.o > objdump_softfp.txt */
driver_test.o: file format elf32-littlearm Disassembly of section .text: <init_module>:
: e92d41f0 push {r4, r5, r6, r7, r8, lr}
: ed2d8b02 vpush {d8}
: e24dd010 sub sp, sp, #
c: e59f217c ldr r2, [pc, #] ; <init_module+0x190>
: e59f317c ldr r3, [pc, #] ; <init_module+0x194>
: e59f017c ldr r0, [pc, #] ; <init_module+0x198>
: ebfffffe bl <printk>
1c: ed9f8b4b vldr d8, [pc, #] ; <init_module+0x150>
: e59f2168 ldr r2, [pc, #] ; <init_module+0x190>
: e59f3168 ldr r3, [pc, #] ; <init_module+0x194>
: e59f016c ldr r0, [pc, #] ; 19c <init_module+0x19c>
2c: ebfffffe bl <printk>
: e3a0100f mov r1, #
: e59f0160 ldr r0, [pc, #] ; 19c <init_module+0x19c>
: ebfffffe bl <printk>
3c: e1a0000d mov r0, sp
: ebfffffe bl <current_kernel_time>
: e59d7000 ldr r7, [sp]
: e59d5004 ldr r5, [sp, #]
4c: eeb02b48 vmov.f64 d2, d8
: ea000021 b dc <init_module+0xdc>
: ed9f0b3f vldr d0, [pc, #] ; <init_module+0x158>
: ee366b48 vsub.f64 d6, d6, d8
5c: ed9f7b3f vldr d7, [pc, #] ; <init_module+0x160>
: e3a0301f mov r3, #
: ed9f4b3f vldr d4, [pc, #] ; <init_module+0x168>
: ee280b00 vmul.f64 d0, d8, d0
6c: ee806b06 vdiv.f64 d6, d0, d6
: ee866b07 vdiv.f64 d6, d6, d7
: ee367b42 vsub.f64 d7, d6, d2
: ee366b02 vadd.f64 d6, d6, d2
7c: ee876b06 vdiv.f64 d6, d7, d6
: ee265b06 vmul.f64 d5, d6, d6
: e2433002 sub r3, r3, #
: ed9f3b30 vldr d3, [pc, #] ; <init_module+0x150>
8c: e3530001 cmp r3, #
: ee013a10 vmov s2, r3
: eeb87bc1 vcvt.f64.s32 d7, s2
: ee827b07 vdiv.f64 d7, d2, d7
9c: eeb01b47 vmov.f64 d1, d7
a0: ee051b04 vmla.f64 d1, d5, d4
a4: eeb04b41 vmov.f64 d4, d1
a8: 1afffff5 bne <init_module+0x84>
ac: ee360b06 vadd.f64 d0, d6, d6
b0: ed9f6b2e vldr d6, [pc, #] ; <init_module+0x170>
b4: ed9f5b2f vldr d5, [pc, #] ; <init_module+0x178>
b8: ee207b01 vmul.f64 d7, d0, d1
bc: ee877b06 vdiv.f64 d7, d7, d6
c0: ed9f6b2e vldr d6, [pc, #] ; <init_module+0x180>
c4: ee374b05 vadd.f64 d4, d7, d5
c8: ee834b04 vdiv.f64 d4, d3, d4
cc: ee347b46 vsub.f64 d7, d4, d6
d0: eefd1bc7 vcvt.s32.f64 s3, d7
d4: ee114a90 vmov r4, s3
d8: ee388b03 vadd.f64 d8, d8, d3
dc: ed9f6b29 vldr d6, [pc, #] ; <init_module+0x188>
e0: eeb48bc6 vcmpe.f64 d8, d6
e4: eef1fa10 vmrs APSR_nzcv, fpscr
e8: 4affffd9 bmi <init_module+0x54>
ec: e28d0008 add r0, sp, #
f0: ebfffffe bl <current_kernel_time>
f4: e59d8008 ldr r8, [sp, #]
f8: e59d600c ldr r6, [sp, #]
fc: e1a01007 mov r1, r7
: e1a02005 mov r2, r5
: e59f0094 ldr r0, [pc, #] ; 1a0 <init_module+0x1a0>
: ebfffffe bl <printk>
10c: e1a01008 mov r1, r8
: e1a02006 mov r2, r6
: e59f0088 ldr r0, [pc, #] ; 1a4 <init_module+0x1a4>
: ebfffffe bl <printk>
11c: e0671008 rsb r1, r7, r8
: e0652006 rsb r2, r5, r6
: e59f007c ldr r0, [pc, #] ; 1a8 <init_module+0x1a8>
: ebfffffe bl <printk>
12c: eefd3bc8 vcvt.s32.f64 s7, d8
: e1a02004 mov r2, r4
: e59f0070 ldr r0, [pc, #] ; 1ac <init_module+0x1ac>
: ee131a90 vmov r1, s7
13c: ebfffffe bl <printk>
: e3a00000 mov r0, #
: e28dd010 add sp, sp, #
: ecbd8b02 vpop {d8}
14c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
: .word 0x00000000
: 3ff00000 .word 0x3ff00000
: .word 0x00000000
15c: 40e6f300 .word 0x40e6f300
: .word 0x00000000
: 40c38800 .word 0x40c38800
: .word 0x08421084
16c: 3fa08421 .word 0x3fa08421
: .word 0x00000000
: 40aedc00 .word 0x40aedc00
: dcb5db83 .word 0xdcb5db83
17c: 3f6b79e1 .word 0x3f6b79e1
: .word 0x66666666
: .word 0x40711266
: .word 0x00000000
18c: 409c2000 .word 0x409c2000
: 1eb851eb .word 0x1eb851eb
: 402e6b85 .word 0x402e6b85
: .word 0x00000000
19c: .word 0x00000011
1a0: .word 0x00000022
1a4: 0000003b .word 0x0000003b
1a8: .word 0x00000054
1ac: 0000006b .word 0x0000006b 000001b0 <cleanup_module>:
1b0: e59f0000 ldr r0, [pc] ; 1b8 <cleanup_module+0x8>
1b4: eafffffe b <printk>
1b8: .word 0x00000074
1bc: e320f000 nop {}
arm-none-linux-gnueabi-objdump -d driver_test.o > objdump_softfp.txt
Makefile修改浮点为软浮点时候, 链接警告, 缺少上面说的函数, 可以我已经链接了libgcc.a, 不知道为何还是警告找不到, 因此就没深究了(怀疑这个库是应用专用)
ccflags-y += -mfloat-abi=soft
链接警告:
WARNING: "__aeabi_d2iz" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined!
WARNING: "__aeabi_i2d" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined!
WARNING: "__aeabi_dsub" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined!
WARNING: "__aeabi_dadd" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined!
WARNING: "__aeabi_dmul" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined!
WARNING: "__aeabi_ddiv" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined!
WARNING: "__aeabi_dcmplt" [/home/fuzk/test/bokeyuan/float/driver/driver_test.ko] undefined! 加载失败:
[ 1780.809417] c0 double: Unknown symbol __aeabi_ddiv (err 0)
[ 1780.815002] c0 double: Unknown symbol __aeabi_dmul (err 0)
[ 1780.820495] c0 double: Unknown symbol __aeabi_dadd (err 0)
[ 1780.826049] c0 double: Unknown symbol __aeabi_dsub (err 0)
[ 1780.831512] c0 double: Unknown symbol __aeabi_i2d (err 0)
insmod: can't insert 'driver_test.ko': unknown symbol in module, or unknown parameter
Linux内核使用浮点运算问题的更多相关文章
- 《Linux内核设计与实现》读书笔记 第一、二章
第一章 Linux内核简介 1.1Unix历史 Unix特点:1.很简洁 2.所有东西都被当成文件对待 3.Unix内核和相关的系统工具软件都是用C语言编写而成 4.进程创建非常迅速 所以Uni ...
- free-electrons linux内核和驱动
操作系统的三个作用:1.管理硬件资源:2.提供独立于架构和硬件的可移植的软件接口3.处理不同应用对相同硬件资源的同时访问 系统调用接口是稳定的,系统调用由c函数库封装,用户程序基本不需要直接调用系统函 ...
- 如何参与Linux内核开发(转)
本文来源于linux内核代码的Document文件夹下的Hoto文件.Chinese translated version of Documentation/HOWTO If you have any ...
- 《Linux内核设计与实现》读书笔记 第二章 从内核出发
一.获取内核源码 1. Git git实际上是一种开源的分布式版本控制工具. Linux作为一个开源的内核,其源代码也可以用git下载和管理 - 获取最新提交到版本树的一个副本 - $ git clo ...
- Linux内核-模块编译和安装
我安装Ubuntu的时候是没有安装源码的,在没有安装源码前 /usr/src/ 目录下是只有两个包含内核的头文件的文件夹的: 我的内核版本是: 所以接下来就是先安装内核源码: 执行后,/usr/src ...
- 嵌入式系统Linux内核开发工程师必须掌握的三十道题(转)
嵌入式系统Linux内核开发工程师必须掌握的三十道题 如果你能正确回答以下问题并理解相关知识点原理,那么你就可以算得上是基本合格的Linux内核开发工程师,试试看! 1) Linux中主要有哪几种内核 ...
- 如何参与linux 内核开发
如果想评论或更新本文的内容,请直接联系原文档的维护者.如果你使用英文 交流有困难的话,也可以向中文版维护者求助.如果本翻译更新不及时或者翻 译存在问题,请联系中文版维护者. 英文版维护者: Gre ...
- Linux内核设计基础(十)之内核开发与总结
(1)Linux层次结构: (2)Linux内核组成: 主要由进程调度(SCHED).内存管理(MM).虚拟文件系统(VFS).网络接口(NET)和进程间通信(IPC)等5个子系统组成. (3)与Un ...
- 如何参与linux内核开发
如何参与linux 内核开发 如果想评论或更新本文的内容,请直接联系原文档的维护者.如果你使用英文 交流有困难的话,也可以向中文版维护者求助.如果本翻译更新不及时或者翻 译存在问题,请联系中文版维 ...
随机推荐
- 我的 FPGA 学习历程(12)—— 电子钟项目准备
初学 FPGA 的时候,我们总是存在很多疑问,比如:xilinx 和 altera 的 FPGA 那种比较好.verilog 语言被如何综合成具体硬件电路.RTL 级电路是什么意思等等.现在我们就不会 ...
- 快速安装puppeteer (跳过安装Chromium)
npm i --save puppeteer --ignore-scripts
- [POJ1964]City Game (悬线法)
题意 其实就是BZOJ3039 不过没权限号(粗鄙之语) 同时也是洛谷4147 就是求最大子矩阵然后*3 思路 悬线法 有个博客讲的不错https://blog.csdn.net/u012288458 ...
- Go smtp发送邮件,带附件
package main import ( "net/smtp" "bytes" "time" "io/ioutil" ...
- Centos7 编译安装 Nginx Mariadb Asp.net Core2 (实测 笔记 Centos 7.3 + Openssl 1.1.0h + Mariadb 10.3.7 + Nginx 1.14.0 + Asp.net. Core 2 )
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
- 你不知道的JS之作用域和闭包(三)函数 vs. 块级作用域
原文:你不知道的js系列 在第(二)节中提到的,标识符在作用域中声明,这些作用域就像是一个容器,一个嵌套一个,这个嵌套关系是在代码编写时定义的. 那么到底是什么产生了一个新的作用域,只有函数能做到 ...
- 如何在mysql客户端即mysql提示符下执行操作系统命令
环境描述: mysql版本:5.5.57-log 操作系统版本:Red Hat Enterprise Linux Server release 6.6 (Santiago) 需求描述: 在mysql的 ...
- SQL插入数据--数据中的某一列来自本表中的数据
背景: 项目初期使用的配置库和业务库两种数据库并行,所有配置数据位于配置库,所有业务数据根据不同省份位于不同数据库.由于使用省份越来越多,各省的配置数据也越来越多导致配置库的数据量过于庞大,各省共用一 ...
- idea远程打断点
(1)用如下方式启动jar java -Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y -jar durati ...
- LeetCode编程训练 - 折半查找(Binary Search)
Binary Search基础 应用于已排序的数据查找其中特定值,是折半查找最常的应用场景.相比线性查找(Linear Search),其时间复杂度减少到O(lgn).算法基本框架如下: //704. ...