上一篇博文中 电池温度检测原理和示例代码 ,由于驱动要使用对数函数而从网上参看一个实现
double ln(double a)
{
int N = 15;
int k,nk;
double x,xx,y;
x = (a-1)/(a+1);
xx = x*x;
nk = 2*N+1;
y = 1.0/nk;
for(k=N;k>0;k--) {
nk = nk - 2;
y = 1.0/nk+xx*y;
}
return 2.0*x*y;
}
尴尬的是当时内核不支持浮点运算所以停滞了, 时间紧迫只能折中先列出各个温度和电压对应表, 通过查表方式处理, 今天着重了解一下为何内核使用浮点运算“前世今生”
一、早期处理器
由于早期处理器硬件压根没有浮点运算功能, 所以编译器自然不会编译出对应指令, 但是确实有需要的场景, 无论应用程序还是内核驱动, 所有出现了浮点模拟器,具体配置在:
原理很简单, 就是编译器对浮点运算代码还是编译对应“指令”, 当运行时ARM指令集没有该“指令”从而导致指令异常, 然后在异常处理函数中调用浮点模拟器函数计算该“指令”并返回结果
优点不言而喻是能够支持浮点需求场景, 对应用程序还是驱动都透明;缺点也显而易见, 这种“指令异常” 方式会增加系统无效负载, 影响中断响应时间等。
Linus Torvalds认为内核不应该进行浮点运算, 所以后来的内核版本menuconfig我没看到有这个浮点模拟器, 相比于内核应用程序使用到浮点运算需求更大, 总不能“躺枪”也不能用吧?
所以就出现了个软浮点库, 编译器在编译应用程序发现这是一条浮点运算时会用函数进行替代! 比如上面ln()函数的x = (a-1)/(a+1); 减法 加法 最后相除都调用函数解决!
x = (a-1)/(a+1);
反汇编如下:
84c8: e3a0300f mov r3, #15
84cc: e50b3020 str r3, [fp, #-32] ; 0xffffffe0
84d0: e14b03dc ldrd r0, [fp, #-60] ; 0xffffffc4
84d4: e3a02000 mov r2, #0
84d8: e3a035ff mov r3, #1069547520 ; 0x3fc00000
84dc: e2833603 add r3, r3, #3145728 ; 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, #-60] ; 0xffffffc4
84f8: e3a02000 mov r2, #0
84fc: e3a035ff mov r3, #1069547520 ; 0x3fc00000
8500: e2833603 add r3, r3, #3145728 ; 0x300000
8504: eb000180 bl 8b0c <__adddf3>
8508: e1a02000 mov r2, r0
850c: e1a03001 mov r3, r1
8510: e1a00004 mov r0, r4
8514: e1a01005 mov r1, r5
8518: eb000301 bl 9124 <__aeabi_ddiv>
这很好理解, 毕竟应用使用浮点频率较高, 靠浮点模拟器总产生异常应用态切成内核态处理完再返回用户态, 太耗性能了。
二、现代处理器
现代处理器硬件已经支持浮点运算, 而且作为一个组件对待, 可选配, 根据需求和方案选型处理器时评估是否需要硬件支持。在STM系列浮点硬件单元叫做FPU(float process unit)吧,
ARM中归属协处理器那边的。所以我们知道如果要使用硬件浮点的话, 需要满足三个条件:
1. 硬件要有浮点运算单元
2. 软件要配置使能硬件浮点,比如Linux内核要选中下面配置(主要设置协处理器)
3. 编译器指定-mfloat-abi=softfp 或-mfloat-abi=hard 编译浮点指令而不是用函数替换!
同样是上面ln()函数的x = (a-1)/(a+1); 采用了硬浮点指令后反汇编代码如下:
x = (a-1)/(a+1);
反汇编如下:
84b0: ed1b6b0d vldr d6, [fp, #-52] ; 0xffffffcc
84b4: ed9f7b33 vldr d7, [pc, #204] ; 8588 <ln+0xf0>
84b8: ee365b47 vsub.f64 d5, d6, d7
84bc: ed1b6b0d vldr d6, [fp, #-52] ; 0xffffffcc
84c0: ed9f7b30 vldr d7, [pc, #192] ; 8588 <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 = 15;
int k,nk;
double x,xx,y;
x = (a-1)/(a+1);
xx = x*x;
nk = 2*N+1;
y = 1.0/nk;
for(k=N;k>0;k--) {
nk = nk - 2;
y = 1.0/nk+xx*y;
}
return 2.0*x*y;
}
int main()
{
int t1;
double Rt, Vadc;
struct timespec time_start={0, 0},time_end={0, 0};
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time_start);
/* 根据采样电压反推热敏电阻的温度 */
for(Vadc=1; Vadc<1800; Vadc++) {
Rt = Vadc * 47000 / (1800-Vadc);
t1=1/(ln(Rt/10000)/3950+1/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 0;
}
反汇编可以看出硬浮点直接指令, 软浮点是用函数替换而且是静态链接, 导致bin文件比较大
/* arm-none-linux-gnueabi-objdump -d soft.bin > objdump_soft.txt */
soft.bin: file format elf32-littlearm
Disassembly of section .init:
00008388 <_init>:
8388: e92d4008 push {r3, lr}
838c: eb000024 bl 8424 <call_gmon_start>
8390: e8bd8008 pop {r3, pc}
Disassembly of section .plt:
00008394 <.plt>:
8394: e52de004 push {lr} ; (str lr, [sp, #-4]!)
8398: e59fe004 ldr lr, [pc, #4] ; 83a4 <_init+0x1c>
839c: e08fe00e add lr, pc, lr
83a0: e5bef008 ldr pc, [lr, #8]!
83a4: 00009168 .word 0x00009168
83a8: e28fc600 add ip, pc, #0, 12
83ac: e28cca09 add ip, ip, #36864 ; 0x9000
83b0: e5bcf168 ldr pc, [ip, #360]! ; 0x168
83b4: e28fc600 add ip, pc, #0, 12
83b8: e28cca09 add ip, ip, #36864 ; 0x9000
83bc: e5bcf160 ldr pc, [ip, #352]! ; 0x160
83c0: e28fc600 add ip, pc, #0, 12
83c4: e28cca09 add ip, ip, #36864 ; 0x9000
83c8: e5bcf158 ldr pc, [ip, #344]! ; 0x158
83cc: e28fc600 add ip, pc, #0, 12
83d0: e28cca09 add ip, ip, #36864 ; 0x9000
83d4: e5bcf150 ldr pc, [ip, #336]! ; 0x150
83d8: e28fc600 add ip, pc, #0, 12
83dc: e28cca09 add ip, ip, #36864 ; 0x9000
83e0: e5bcf148 ldr pc, [ip, #328]! ; 0x148
Disassembly of section .text:
000083e8 <_start>:
83e8: e3a0b000 mov fp, #0
83ec: e3a0e000 mov lr, #0
83f0: e49d1004 pop {r1} ; (ldr r1, [sp], #4)
83f4: e1a0200d mov r2, sp
83f8: e52d2004 push {r2} ; (str r2, [sp, #-4]!)
83fc: e52d0004 push {r0} ; (str r0, [sp, #-4]!)
8400: e59fc010 ldr ip, [pc, #16] ; 8418 <_start+0x30>
8404: e52dc004 push {ip} ; (str ip, [sp, #-4]!)
8408: e59f000c ldr r0, [pc, #12] ; 841c <_start+0x34>
840c: e59f300c ldr r3, [pc, #12] ; 8420 <_start+0x38>
8410: ebffffe7 bl 83b4 <_init+0x2c>
8414: ebffffef bl 83d8 <_init+0x50>
8418: 00009328 .word 0x00009328
841c: 00008628 .word 0x00008628
8420: 00009260 .word 0x00009260
00008424 <call_gmon_start>:
8424: e59f0014 ldr r0, [pc, #20] ; 8440 <call_gmon_start+0x1c>
8428: e59f2014 ldr r2, [pc, #20] ; 8444 <call_gmon_start+0x20>
842c: e08f3000 add r3, pc, r0
8430: e7933002 ldr r3, [r3, r2]
8434: e3530000 cmp r3, #0
8438: 012fff1e bxeq lr
843c: eaffffdf b 83c0 <_init+0x38>
8440: 000090d8 .word 0x000090d8
8444: 00000020 .word 0x00000020
00008448 <__do_global_dtors_aux>:
8448: e59f3010 ldr r3, [pc, #16] ; 8460 <__do_global_dtors_aux+0x18>
844c: e5d32000 ldrb r2, [r3]
8450: e3520000 cmp r2, #0
8454: 03a02001 moveq r2, #1
8458: 05c32000 strbeq r2, [r3]
845c: e12fff1e bx lr
8460: 00011538 .word 0x00011538
00008464 <frame_dummy>:
8464: e59f0020 ldr r0, [pc, #32] ; 848c <frame_dummy+0x28>
8468: e92d4008 push {r3, lr}
846c: e5903000 ldr r3, [r0]
8470: e3530000 cmp r3, #0
8474: 08bd8008 popeq {r3, pc}
8478: e59f3010 ldr r3, [pc, #16] ; 8490 <frame_dummy+0x2c>
847c: e3530000 cmp r3, #0
8480: 08bd8008 popeq {r3, pc}
8484: e12fff33 blx r3
8488: e8bd8008 pop {r3, pc}
848c: 00011410 .word 0x00011410
...
00008498 <ln>:
8498: e92d4830 push {r4, r5, fp, lr}
849c: e28db00c add fp, sp, #12
84a0: e24dd030 sub sp, sp, #48 ; 0x30
84a4: e14b03fc strd r0, [fp, #-60] ; 0xffffffc4
84a8: e3a0300f mov r3, #15
84ac: e50b3020 str r3, [fp, #-32] ; 0xffffffe0
84b0: e14b03dc ldrd r0, [fp, #-60] ; 0xffffffc4
84b4: e3a02000 mov r2, #0
84b8: e3a035ff mov r3, #1069547520 ; 0x3fc00000
84bc: e2833603 add r3, r3, #3145728 ; 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, #-60] ; 0xffffffc4
84d8: e3a02000 mov r2, #0
84dc: e3a035ff mov r3, #1069547520 ; 0x3fc00000
84e0: e2833603 add r3, r3, #3145728 ; 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
8500: e1a03001 mov r3, r1
8504: e14b22fc strd r2, [fp, #-44] ; 0xffffffd4
8508: e14b02dc ldrd r0, [fp, #-44] ; 0xffffffd4
850c: e14b22dc ldrd r2, [fp, #-44] ; 0xffffffd4
8510: eb0001d4 bl 8c68 <__aeabi_dmul>
8514: e1a02000 mov r2, r0
8518: e1a03001 mov r3, r1
851c: e14b23f4 strd r2, [fp, #-52] ; 0xffffffcc
8520: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
8524: e1a03083 lsl r3, r3, #1
8528: e2833001 add r3, r3, #1
852c: e50b3014 str r3, [fp, #-20] ; 0xffffffec
8530: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
8534: eb000194 bl 8b8c <__aeabi_i2d>
8538: e1a02000 mov r2, r0
853c: e1a03001 mov r3, r1
8540: e3a00000 mov r0, #0
8544: e3a015ff mov r1, #1069547520 ; 0x3fc00000
8548: e2811603 add r1, r1, #3145728 ; 0x300000
854c: eb000260 bl 8ed4 <__aeabi_ddiv>
8550: e1a02000 mov r2, r0
8554: e1a03001 mov r3, r1
8558: e14b21fc strd r2, [fp, #-28] ; 0xffffffe4
855c: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
8560: e50b3010 str r3, [fp, #-16]
8564: ea00001c b 85dc <ln+0x144>
8568: e51b3014 ldr r3, [fp, #-20] ; 0xffffffec
856c: e2433002 sub r3, r3, #2
8570: e50b3014 str r3, [fp, #-20] ; 0xffffffec
8574: e51b0014 ldr r0, [fp, #-20] ; 0xffffffec
8578: eb000183 bl 8b8c <__aeabi_i2d>
857c: e1a02000 mov r2, r0
8580: e1a03001 mov r3, r1
8584: e3a00000 mov r0, #0
8588: e3a015ff mov r1, #1069547520 ; 0x3fc00000
858c: e2811603 add r1, r1, #3145728 ; 0x300000
8590: eb00024f bl 8ed4 <__aeabi_ddiv>
8594: e1a02000 mov r2, r0
8598: e1a03001 mov r3, r1
859c: e1a04002 mov r4, r2
85a0: e1a05003 mov r5, r3
85a4: e14b03d4 ldrd r0, [fp, #-52] ; 0xffffffcc
85a8: e14b21dc ldrd r2, [fp, #-28] ; 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, #-28] ; 0xffffffe4
85d0: e51b3010 ldr r3, [fp, #-16]
85d4: e2433001 sub r3, r3, #1
85d8: e50b3010 str r3, [fp, #-16]
85dc: e51b3010 ldr r3, [fp, #-16]
85e0: e3530000 cmp r3, #0
85e4: caffffdf bgt 8568 <ln+0xd0>
85e8: e14b22dc ldrd r2, [fp, #-44] ; 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
8600: e1a00002 mov r0, r2
8604: e1a01003 mov r1, r3
8608: e14b21dc ldrd r2, [fp, #-28] ; 0xffffffe4
860c: eb000195 bl 8c68 <__aeabi_dmul>
8610: e1a02000 mov r2, r0
8614: e1a03001 mov r3, r1
8618: e1a00002 mov r0, r2
861c: e1a01003 mov r1, r3
8620: e24bd00c sub sp, fp, #12
8624: e8bd8830 pop {r4, r5, fp, pc}
00008628 <main>:
8628: e92d4830 push {r4, r5, fp, lr}
862c: e28db00c add fp, sp, #12
8630: e24dd030 sub sp, sp, #48 ; 0x30
8634: e3a03000 mov r3, #0
8638: e50b302c str r3, [fp, #-44] ; 0xffffffd4
863c: e3a03000 mov r3, #0
8640: e50b3028 str r3, [fp, #-40] ; 0xffffffd8
8644: e3a03000 mov r3, #0
8648: e50b3034 str r3, [fp, #-52] ; 0xffffffcc
864c: e3a03000 mov r3, #0
8650: e50b3030 str r3, [fp, #-48] ; 0xffffffd0
8654: e3a00002 mov r0, #2
8658: e24b302c sub r3, fp, #44 ; 0x2c
865c: e1a01003 mov r1, r3
8660: ebffff59 bl 83cc <_init+0x44>
8664: e3a02000 mov r2, #0
8668: e3a035ff mov r3, #1069547520 ; 0x3fc00000
866c: e2833603 add r3, r3, #3145728 ; 0x300000
8670: e14b21fc strd r2, [fp, #-28] ; 0xffffffe4
8674: ea000046 b 8794 <main+0x16c>
8678: e14b01dc ldrd r0, [fp, #-28] ; 0xffffffe4
867c: e28f3f7b add r3, pc, #492 ; 0x1ec
8680: e1c320d0 ldrd r2, [r3]
8684: eb000177 bl 8c68 <__aeabi_dmul>
8688: e1a02000 mov r2, r0
868c: e1a03001 mov r3, r1
8690: e1a04002 mov r4, r2
8694: e1a05003 mov r5, r3
8698: e28f1f76 add r1, pc, #472 ; 0x1d8
869c: e1c100d0 ldrd r0, [r1]
86a0: e14b21dc ldrd r2, [fp, #-28] ; 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, #-36] ; 0xffffffdc
86c8: e14b02d4 ldrd r0, [fp, #-36] ; 0xffffffdc
86cc: e28f3f6b add r3, pc, #428 ; 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 8498 <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, #388 ; 0x184
8700: e1c320d0 ldrd r2, [r3]
8704: eb0001f2 bl 8ed4 <__aeabi_ddiv>
8708: e1a02000 mov r2, r0
870c: e1a03001 mov r3, r1
8710: e1a00002 mov r0, r2
8714: e1a01003 mov r1, r3
8718: e28f3e17 add r3, pc, #368 ; 0x170
871c: e1c320d0 ldrd r2, [r3]
8720: eb000065 bl 88bc <__adddf3>
8724: e1a02000 mov r2, r0
8728: e1a03001 mov r3, r1
872c: e3a00000 mov r0, #0
8730: e3a015ff mov r1, #1069547520 ; 0x3fc00000
8734: e2811603 add r1, r1, #3145728 ; 0x300000
8738: eb0001e5 bl 8ed4 <__aeabi_ddiv>
873c: e1a02000 mov r2, r0
8740: e1a03001 mov r3, r1
8744: e1a00002 mov r0, r2
8748: e1a01003 mov r1, r3
874c: e28f3f51 add r3, pc, #324 ; 0x144
8750: e1c320d0 ldrd r2, [r3]
8754: eb000057 bl 88b8 <__aeabi_dsub>
8758: e1a02000 mov r2, r0
875c: e1a03001 mov r3, r1
8760: e1a00002 mov r0, r2
8764: e1a01003 mov r1, r3
8768: eb0002a5 bl 9204 <__aeabi_d2iz>
876c: e1a03000 mov r3, r0
8770: e50b3010 str r3, [fp, #-16]
8774: e14b01dc ldrd r0, [fp, #-28] ; 0xffffffe4
8778: e3a02000 mov r2, #0
877c: e3a035ff mov r3, #1069547520 ; 0x3fc00000
8780: e2833603 add r3, r3, #3145728 ; 0x300000
8784: eb00004c bl 88bc <__adddf3>
8788: e1a02000 mov r2, r0
878c: e1a03001 mov r3, r1
8790: e14b21fc strd r2, [fp, #-28] ; 0xffffffe4
8794: e3a03001 mov r3, #1
8798: e1a04003 mov r4, r3
879c: e14b01dc ldrd r0, [fp, #-28] ; 0xffffffe4
87a0: e28f30d0 add r3, pc, #208 ; 0xd0
87a4: e1c320d0 ldrd r2, [r3]
87a8: eb000281 bl 91b4 <__aeabi_dcmplt>
87ac: e1a03000 mov r3, r0
87b0: e3530000 cmp r3, #0
87b4: 1a000001 bne 87c0 <main+0x198>
87b8: e3a03000 mov r3, #0
87bc: e1a04003 mov r4, r3
87c0: e20430ff and r3, r4, #255 ; 0xff
87c4: e3530000 cmp r3, #0
87c8: 1affffaa bne 8678 <main+0x50>
87cc: e3a00002 mov r0, #2
87d0: e24b3034 sub r3, fp, #52 ; 0x34
87d4: e1a01003 mov r1, r3
87d8: ebfffefb bl 83cc <_init+0x44>
87dc: e59f10bc ldr r1, [pc, #188] ; 88a0 <main+0x278>
87e0: e51b202c ldr r2, [fp, #-44] ; 0xffffffd4
87e4: e51b3028 ldr r3, [fp, #-40] ; 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, #164] ; 88a4 <main+0x27c>
87fc: e51b2034 ldr r2, [fp, #-52] ; 0xffffffcc
8800: e51b3030 ldr r3, [fp, #-48] ; 0xffffffd0
8804: e1a00001 mov r0, r1
8808: e1a01002 mov r1, r2
880c: e1a02003 mov r2, r3
8810: ebfffee4 bl 83a8 <_init+0x20>
8814: e59f008c ldr r0, [pc, #140] ; 88a8 <main+0x280>
8818: e51b2034 ldr r2, [fp, #-52] ; 0xffffffcc
881c: e51b302c ldr r3, [fp, #-44] ; 0xffffffd4
8820: e0632002 rsb r2, r3, r2
8824: e51b1030 ldr r1, [fp, #-48] ; 0xffffffd0
8828: e51b3028 ldr r3, [fp, #-40] ; 0xffffffd8
882c: e0633001 rsb r3, r3, r1
8830: e1a01000 mov r1, r0
8834: e1a00001 mov r0, r1
8838: e1a01002 mov r1, r2
883c: e1a02003 mov r2, r3
8840: ebfffed8 bl 83a8 <_init+0x20>
8844: e59f2060 ldr r2, [pc, #96] ; 88ac <main+0x284>
8848: e51b3010 ldr r3, [fp, #-16]
884c: e58d3000 str r3, [sp]
8850: e1a03002 mov r3, r2
8854: e1a00003 mov r0, r3
8858: e14b21dc ldrd r2, [fp, #-28] ; 0xffffffe4
885c: ebfffed1 bl 83a8 <_init+0x20>
8860: e3a03000 mov r3, #0
8864: e1a00003 mov r0, r3
8868: e24bd00c sub sp, fp, #12
886c: e8bd8830 pop {r4, r5, fp, pc}
8870: 00000000 .word 0x00000000
8874: 40e6f300 .word 0x40e6f300
8878: 00000000 .word 0x00000000
887c: 409c2000 .word 0x409c2000
8880: 00000000 .word 0x00000000
8884: 40c38800 .word 0x40c38800
8888: 00000000 .word 0x00000000
888c: 40aedc00 .word 0x40aedc00
8890: dcb5db83 .word 0xdcb5db83
8894: 3f6b79e1 .word 0x3f6b79e1
8898: 66666666 .word 0x66666666
889c: 40711266 .word 0x40711266
88a0: 00009338 .word 0x00009338
88a4: 00009354 .word 0x00009354
88a8: 00009370 .word 0x00009370
88ac: 00009388 .word 0x00009388
000088b0 <__aeabi_drsub>:
88b0: e2211102 eor r1, r1, #-2147483648 ; 0x80000000
88b4: ea000000 b 88bc <__adddf3>
000088b8 <__aeabi_dsub>:
88b8: e2233102 eor r3, r3, #-2147483648 ; 0x80000000
000088bc <__adddf3>:
88bc: e92d4030 push {r4, r5, lr}
88c0: e1a04081 lsl r4, r1, #1
88c4: e1a05083 lsl r5, r3, #1
88c8: e1340005 teq r4, r5
88cc: 01300002 teqeq r0, r2
88d0: 1194c000 orrsne ip, r4, r0
88d4: 1195c002 orrsne ip, r5, r2
88d8: 11f0cac4 mvnsne ip, r4, asr #21
88dc: 11f0cac5 mvnsne ip, r5, asr #21
88e0: 0a000079 beq 8acc <__adddf3+0x210>
88e4: e1a04aa4 lsr r4, r4, #21
88e8: e0745aa5 rsbs r5, r4, r5, lsr #21
88ec: b2655000 rsblt r5, r5, #0
88f0: da000006 ble 8910 <__adddf3+0x54>
88f4: e0844005 add r4, r4, r5
88f8: e0202002 eor r2, r0, r2
88fc: e0213003 eor r3, r1, r3
8900: e0220000 eor r0, r2, r0
8904: e0231001 eor r1, r3, r1
8908: e0202002 eor r2, r0, r2
890c: e0213003 eor r3, r1, r3
8910: e3550036 cmp r5, #54 ; 0x36
8914: 88bd8030 pophi {r4, r5, pc}
8918: e3110102 tst r1, #-2147483648 ; 0x80000000
891c: e1a01601 lsl r1, r1, #12
8920: e3a0c601 mov ip, #1048576 ; 0x100000
8924: e18c1621 orr r1, ip, r1, lsr #12
8928: 0a000001 beq 8934 <__adddf3+0x78>
892c: e2700000 rsbs r0, r0, #0
8930: e2e11000 rsc r1, r1, #0
8934: e3130102 tst r3, #-2147483648 ; 0x80000000
8938: e1a03603 lsl r3, r3, #12
893c: e18c3623 orr r3, ip, r3, lsr #12
8940: 0a000001 beq 894c <__adddf3+0x90>
8944: e2722000 rsbs r2, r2, #0
8948: e2e33000 rsc r3, r3, #0
894c: e1340005 teq r4, r5
8950: 0a000057 beq 8ab4 <__adddf3+0x1f8>
8954: e2444001 sub r4, r4, #1
8958: e275e020 rsbs lr, r5, #32
895c: ba000005 blt 8978 <__adddf3+0xbc>
8960: e1a0ce12 lsl ip, r2, lr
8964: e0900532 adds r0, r0, r2, lsr r5
8968: e2a11000 adc r1, r1, #0
896c: e0900e13 adds r0, r0, r3, lsl lr
8970: e0b11553 adcs r1, r1, r3, asr r5
8974: ea000006 b 8994 <__adddf3+0xd8>
8978: e2455020 sub r5, r5, #32
897c: e28ee020 add lr, lr, #32
8980: e3520001 cmp r2, #1
8984: e1a0ce13 lsl ip, r3, lr
8988: 238cc002 orrcs ip, ip, #2
898c: e0900553 adds r0, r0, r3, asr r5
8990: e0b11fc3 adcs r1, r1, r3, asr #31
8994: e2015102 and r5, r1, #-2147483648 ; 0x80000000
8998: 5a000002 bpl 89a8 <__adddf3+0xec>
899c: e27cc000 rsbs ip, ip, #0
89a0: e2f00000 rscs r0, r0, #0
89a4: e2e11000 rsc r1, r1, #0
89a8: e3510601 cmp r1, #1048576 ; 0x100000
89ac: 3a00000e bcc 89ec <__adddf3+0x130>
89b0: e3510602 cmp r1, #2097152 ; 0x200000
89b4: 3a000006 bcc 89d4 <__adddf3+0x118>
89b8: e1b010a1 lsrs r1, r1, #1
89bc: e1b00060 rrxs r0, r0
89c0: e1a0c06c rrx ip, ip
89c4: e2844001 add r4, r4, #1
89c8: e1a02a84 lsl r2, r4, #21
89cc: e3720501 cmn r2, #4194304 ; 0x400000
89d0: 2a000055 bcs 8b2c <__adddf3+0x270>
89d4: e35c0102 cmp ip, #-2147483648 ; 0x80000000
89d8: 01b0c0a0 lsrseq ip, r0, #1
89dc: e2b00000 adcs r0, r0, #0
89e0: e0a11a04 adc r1, r1, r4, lsl #20
89e4: e1811005 orr r1, r1, r5
89e8: e8bd8030 pop {r4, r5, pc}
89ec: e1b0c08c lsls ip, ip, #1
89f0: e0b00000 adcs r0, r0, r0
89f4: e0a11001 adc r1, r1, r1
89f8: e3110601 tst r1, #1048576 ; 0x100000
89fc: e2444001 sub r4, r4, #1
8a00: 1afffff3 bne 89d4 <__adddf3+0x118>
8a04: e3310000 teq r1, #0
8a08: 01a01000 moveq r1, r0
8a0c: 03a00000 moveq r0, #0
8a10: e16f3f11 clz r3, r1
8a14: 02833020 addeq r3, r3, #32
8a18: e243300b sub r3, r3, #11
8a1c: e2532020 subs r2, r3, #32
8a20: aa000007 bge 8a44 <__adddf3+0x188>
8a24: e292200c adds r2, r2, #12
8a28: da000004 ble 8a40 <__adddf3+0x184>
8a2c: e282c014 add ip, r2, #20
8a30: e262200c rsb r2, r2, #12
8a34: e1a00c11 lsl r0, r1, ip
8a38: e1a01231 lsr r1, r1, r2
8a3c: ea000004 b 8a54 <__adddf3+0x198>
8a40: e2822014 add r2, r2, #20
8a44: d262c020 rsble ip, r2, #32
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 #20
8a5c: a1811005 orrge r1, r1, r5
8a60: a8bd8030 popge {r4, r5, pc}
8a64: e1e04004 mvn r4, r4
8a68: e254401f subs r4, r4, #31
8a6c: aa00000d bge 8aa8 <__adddf3+0x1ec>
8a70: e294400c adds r4, r4, #12
8a74: ca000005 bgt 8a90 <__adddf3+0x1d4>
8a78: e2844014 add r4, r4, #20
8a7c: e2642020 rsb r2, r4, #32
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, #12
8a94: e2642020 rsb r2, r4, #32
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, #0
8ab8: e2233601 eor r3, r3, #1048576 ; 0x100000
8abc: 02211601 eoreq r1, r1, #1048576 ; 0x100000
8ac0: 02844001 addeq r4, r4, #1
8ac4: 12455001 subne r5, r5, #1
8ac8: eaffffa1 b 8954 <__adddf3+0x98>
8acc: e1f0cac4 mvns ip, r4, asr #21
8ad0: 11f0cac5 mvnsne ip, r5, asr #21
8ad4: 0a000018 beq 8b3c <__adddf3+0x280>
8ad8: e1340005 teq r4, r5
8adc: 01300002 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, #0
8afc: 13a00000 movne r0, #0
8b00: 18bd8030 popne {r4, r5, pc}
8b04: e1b0caa4 lsrs ip, r4, #21
8b08: 1a000003 bne 8b1c <__adddf3+0x260>
8b0c: e1b00080 lsls r0, r0, #1
8b10: e0b11001 adcs r1, r1, r1
8b14: 23811102 orrcs r1, r1, #-2147483648 ; 0x80000000
8b18: e8bd8030 pop {r4, r5, pc}
8b1c: e2944501 adds r4, r4, #4194304 ; 0x400000
8b20: 32811601 addcc r1, r1, #1048576 ; 0x100000
8b24: 38bd8030 popcc {r4, r5, pc}
8b28: e2015102 and r5, r1, #-2147483648 ; 0x80000000
8b2c: e385147f orr r1, r5, #2130706432 ; 0x7f000000
8b30: e381160f orr r1, r1, #15728640 ; 0xf00000
8b34: e3a00000 mov r0, #0
8b38: e8bd8030 pop {r4, r5, pc}
8b3c: e1f0cac4 mvns ip, r4, asr #21
8b40: 11a01003 movne r1, r3
8b44: 11a00002 movne r0, r2
8b48: 01f0cac5 mvnseq ip, r5, asr #21
8b4c: 11a03001 movne r3, r1
8b50: 11a02000 movne r2, r0
8b54: e1904601 orrs r4, r0, r1, lsl #12
8b58: 01925603 orrseq r5, r2, r3, lsl #12
8b5c: 01310003 teqeq r1, r3
8b60: 13811702 orrne r1, r1, #524288 ; 0x80000
8b64: e8bd8030 pop {r4, r5, pc}
00008b68 <__aeabi_ui2d>:
8b68: e3300000 teq r0, #0
8b6c: 03a01000 moveq r1, #0
8b70: 012fff1e bxeq lr
8b74: e92d4030 push {r4, r5, lr}
8b78: e3a04b01 mov r4, #1024 ; 0x400
8b7c: e2844032 add r4, r4, #50 ; 0x32
8b80: e3a05000 mov r5, #0
8b84: e3a01000 mov r1, #0
8b88: eaffff9d b 8a04 <__adddf3+0x148>
00008b8c <__aeabi_i2d>:
8b8c: e3300000 teq r0, #0
8b90: 03a01000 moveq r1, #0
8b94: 012fff1e bxeq lr
8b98: e92d4030 push {r4, r5, lr}
8b9c: e3a04b01 mov r4, #1024 ; 0x400
8ba0: e2844032 add r4, r4, #50 ; 0x32
8ba4: e2105102 ands r5, r0, #-2147483648 ; 0x80000000
8ba8: 42600000 rsbmi r0, r0, #0
8bac: e3a01000 mov r1, #0
8bb0: eaffff93 b 8a04 <__adddf3+0x148>
00008bb4 <__aeabi_f2d>:
8bb4: e1b02080 lsls r2, r0, #1
8bb8: e1a011c2 asr r1, r2, #3
8bbc: e1a01061 rrx r1, r1
8bc0: e1a00e02 lsl r0, r2, #28
8bc4: 121234ff andsne r3, r2, #-16777216 ; 0xff000000
8bc8: 133304ff teqne r3, #-16777216 ; 0xff000000
8bcc: 1221130e eorne r1, r1, #939524096 ; 0x38000000
8bd0: 112fff1e bxne lr
8bd4: e3320000 teq r2, #0
8bd8: 133304ff teqne r3, #-16777216 ; 0xff000000
8bdc: 012fff1e bxeq lr
8be0: e92d4030 push {r4, r5, lr}
8be4: e3a04d0e mov r4, #896 ; 0x380
8be8: e2015102 and r5, r1, #-2147483648 ; 0x80000000
8bec: e3c11102 bic r1, r1, #-2147483648 ; 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, #0
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, #-2147483648 ; 0x80000000
8c18: 5a000001 bpl 8c24 <__aeabi_l2d+0x1c>
8c1c: e2700000 rsbs r0, r0, #0
8c20: e2e11000 rsc r1, r1, #0
8c24: e3a04b01 mov r4, #1024 ; 0x400
8c28: e2844032 add r4, r4, #50 ; 0x32
8c2c: e1b0cb21 lsrs ip, r1, #22
8c30: 0affff5c beq 89a8 <__adddf3+0xec>
8c34: e3a02003 mov r2, #3
8c38: e1b0c1ac lsrs ip, ip, #3
8c3c: 12822003 addne r2, r2, #3
8c40: e1b0c1ac lsrs ip, ip, #3
8c44: 12822003 addne r2, r2, #3
8c48: e08221ac add r2, r2, ip, lsr #3
8c4c: e2623020 rsb r3, r2, #32
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, #255 ; 0xff
8c70: e38ccc07 orr ip, ip, #1792 ; 0x700
8c74: e01c4a21 ands r4, ip, r1, lsr #20
8c78: 101c5a23 andsne r5, ip, r3, lsr #20
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 #21
8c94: e1c33a8c bic r3, r3, ip, lsl #21
8c98: e1905601 orrs r5, r0, r1, lsl #12
8c9c: 11925603 orrsne r5, r2, r3, lsl #12
8ca0: e3811601 orr r1, r1, #1048576 ; 0x100000
8ca4: e3833601 orr r3, r3, #1048576 ; 0x100000
8ca8: 0a00001c beq 8d20 <__aeabi_dmul+0xb8>
8cac: e08ec290 umull ip, lr, r0, r2
8cb0: e3a05000 mov r5, #0
8cb4: e0a5e291 umlal lr, r5, r1, r2
8cb8: e2062102 and r2, r6, #-2147483648 ; 0x80000000
8cbc: e0a5e390 umlal lr, r5, r0, r3
8cc0: e3a06000 mov r6, #0
8cc4: e0a65391 umlal r5, r6, r1, r3
8cc8: e33c0000 teq ip, #0
8ccc: 138ee001 orrne lr, lr, #1
8cd0: e24440ff sub r4, r4, #255 ; 0xff
8cd4: e3560c02 cmp r6, #512 ; 0x200
8cd8: e2c44c03 sbc r4, r4, #768 ; 0x300
8cdc: 2a000002 bcs 8cec <__aeabi_dmul+0x84>
8ce0: e1b0e08e lsls lr, lr, #1
8ce4: e0b55005 adcs r5, r5, r5
8ce8: e0a66006 adc r6, r6, r6
8cec: e1821586 orr r1, r2, r6, lsl #11
8cf0: e1811aa5 orr r1, r1, r5, lsr #21
8cf4: e1a00585 lsl r0, r5, #11
8cf8: e1800aae orr r0, r0, lr, lsr #21
8cfc: e1a0e58e lsl lr, lr, #11
8d00: e254c0fd subs ip, r4, #253 ; 0xfd
8d04: 835c0c07 cmphi ip, #1792 ; 0x700
8d08: 8a00000f bhi 8d4c <__aeabi_dmul+0xe4>
8d0c: e35e0102 cmp lr, #-2147483648 ; 0x80000000
8d10: 01b0e0a0 lsrseq lr, r0, #1
8d14: e2b00000 adcs r0, r0, #0
8d18: e0a11a04 adc r1, r1, r4, lsl #20
8d1c: e8bd8070 pop {r4, r5, r6, pc}
8d20: e2066102 and r6, r6, #-2147483648 ; 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 #1
8d34: c074500c rsbsgt r5, r4, ip
8d38: c1811a04 orrgt r1, r1, r4, lsl #20
8d3c: c8bd8070 popgt {r4, r5, r6, pc}
8d40: e3811601 orr r1, r1, #1048576 ; 0x100000
8d44: e3a0e000 mov lr, #0
8d48: e2544001 subs r4, r4, #1
8d4c: ca000058 bgt 8eb4 <__aeabi_dmul+0x24c>
8d50: e3740036 cmn r4, #54 ; 0x36
8d54: d3a00000 movle r0, #0
8d58: d2011102 andle r1, r1, #-2147483648 ; 0x80000000
8d5c: d8bd8070 pople {r4, r5, r6, pc}
8d60: e2644000 rsb r4, r4, #0
8d64: e2544020 subs r4, r4, #32
8d68: aa000018 bge 8dd0 <__aeabi_dmul+0x168>
8d6c: e294400c adds r4, r4, #12
8d70: ca00000b bgt 8da4 <__aeabi_dmul+0x13c>
8d74: e2844014 add r4, r4, #20
8d78: e2645020 rsb r5, r4, #32
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, #-2147483648 ; 0x80000000
8d8c: e3c11102 bic r1, r1, #-2147483648 ; 0x80000000
8d90: e0900fa3 adds r0, r0, r3, lsr #31
8d94: e0a21431 adc r1, r2, r1, lsr r4
8d98: e19ee083 orrs lr, lr, r3, lsl #1
8d9c: 01c00fa3 biceq r0, r0, r3, lsr #31
8da0: e8bd8070 pop {r4, r5, r6, pc}
8da4: e264400c rsb r4, r4, #12
8da8: e2645020 rsb r5, r4, #32
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, #-2147483648 ; 0x80000000
8dbc: e0900fa3 adds r0, r0, r3, lsr #31
8dc0: e2a11000 adc r1, r1, #0
8dc4: e19ee083 orrs lr, lr, r3, lsl #1
8dc8: 01c00fa3 biceq r0, r0, r3, lsr #31
8dcc: e8bd8070 pop {r4, r5, r6, pc}
8dd0: e2645020 rsb r5, r4, #32
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, #-2147483648 ; 0x80000000
8de8: e1c00431 bic r0, r0, r1, lsr r4
8dec: e0800fa3 add r0, r0, r3, lsr #31
8df0: e19ee083 orrs lr, lr, r3, lsl #1
8df4: 01c00fa3 biceq r0, r0, r3, lsr #31
8df8: e8bd8070 pop {r4, r5, r6, pc}
8dfc: e3340000 teq r4, #0
8e00: 1a000008 bne 8e28 <__aeabi_dmul+0x1c0>
8e04: e2016102 and r6, r1, #-2147483648 ; 0x80000000
8e08: e1b00080 lsls r0, r0, #1
8e0c: e0a11001 adc r1, r1, r1
8e10: e3110601 tst r1, #1048576 ; 0x100000
8e14: 02444001 subeq r4, r4, #1
8e18: 0afffffa beq 8e08 <__aeabi_dmul+0x1a0>
8e1c: e1811006 orr r1, r1, r6
8e20: e3350000 teq r5, #0
8e24: 112fff1e bxne lr
8e28: e2036102 and r6, r3, #-2147483648 ; 0x80000000
8e2c: e1b02082 lsls r2, r2, #1
8e30: e0a33003 adc r3, r3, r3
8e34: e3130601 tst r3, #1048576 ; 0x100000
8e38: 02455001 subeq r5, r5, #1
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 #20
8e50: 1135000c teqne r5, ip
8e54: 0a000006 beq 8e74 <__aeabi_dmul+0x20c>
8e58: e1906081 orrs r6, r0, r1, lsl #1
8e5c: 11926083 orrsne r6, r2, r3, lsl #1
8e60: 1affffe5 bne 8dfc <__aeabi_dmul+0x194>
8e64: e0211003 eor r1, r1, r3
8e68: e2011102 and r1, r1, #-2147483648 ; 0x80000000
8e6c: e3a00000 mov r0, #0
8e70: e8bd8070 pop {r4, r5, r6, pc}
8e74: e1906081 orrs r6, r0, r1, lsl #1
8e78: 01a00002 moveq r0, r2
8e7c: 01a01003 moveq r1, r3
8e80: 11926083 orrsne r6, r2, r3, lsl #1
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 #12
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 #12
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, #-2147483648 ; 0x80000000
8eb8: e381147f orr r1, r1, #2130706432 ; 0x7f000000
8ebc: e381160f orr r1, r1, #15728640 ; 0xf00000
8ec0: e3a00000 mov r0, #0
8ec4: e8bd8070 pop {r4, r5, r6, pc}
8ec8: e381147f orr r1, r1, #2130706432 ; 0x7f000000
8ecc: e381173e orr r1, r1, #16252928 ; 0xf80000
8ed0: e8bd8070 pop {r4, r5, r6, pc}
00008ed4 <__aeabi_ddiv>:
8ed4: e92d4070 push {r4, r5, r6, lr}
8ed8: e3a0c0ff mov ip, #255 ; 0xff
8edc: e38ccc07 orr ip, ip, #1792 ; 0x700
8ee0: e01c4a21 ands r4, ip, r1, lsr #20
8ee4: 101c5a23 andsne r5, ip, r3, lsr #20
8ee8: 1134000c teqne r4, ip
8eec: 1135000c teqne r5, ip
8ef0: 0b00005c bleq 9068 <__aeabi_ddiv+0x194>
8ef4: e0444005 sub r4, r4, r5
8ef8: e021e003 eor lr, r1, r3
8efc: e1925603 orrs r5, r2, r3, lsl #12
8f00: e1a01601 lsl r1, r1, #12
8f04: 0a00004b beq 9038 <__aeabi_ddiv+0x164>
8f08: e1a03603 lsl r3, r3, #12
8f0c: e3a05201 mov r5, #268435456 ; 0x10000000
8f10: e1853223 orr r3, r5, r3, lsr #4
8f14: e1833c22 orr r3, r3, r2, lsr #24
8f18: e1a02402 lsl r2, r2, #8
8f1c: e1855221 orr r5, r5, r1, lsr #4
8f20: e1855c20 orr r5, r5, r0, lsr #24
8f24: e1a06400 lsl r6, r0, #8
8f28: e20e1102 and r1, lr, #-2147483648 ; 0x80000000
8f2c: e1550003 cmp r5, r3
8f30: 01560002 cmpeq r6, r2
8f34: e2a440fd adc r4, r4, #253 ; 0xfd
8f38: e2844c03 add r4, r4, #768 ; 0x300
8f3c: 2a000001 bcs 8f48 <__aeabi_ddiv+0x74>
8f40: e1b030a3 lsrs r3, r3, #1
8f44: e1a02062 rrx r2, r2
8f48: e0566002 subs r6, r6, r2
8f4c: e0c55003 sbc r5, r5, r3
8f50: e1b030a3 lsrs r3, r3, #1
8f54: e1a02062 rrx r2, r2
8f58: e3a00601 mov r0, #1048576 ; 0x100000
8f5c: e3a0c702 mov ip, #524288 ; 0x80000
8f60: e056e002 subs lr, r6, r2
8f64: e0d5e003 sbcs lr, r5, r3
8f68: 20466002 subcs r6, r6, r2
8f6c: 21a0500e movcs r5, lr
8f70: 2180000c orrcs r0, r0, ip
8f74: e1b030a3 lsrs r3, r3, #1
8f78: e1a02062 rrx r2, r2
8f7c: e056e002 subs lr, r6, r2
8f80: e0d5e003 sbcs lr, r5, r3
8f84: 20466002 subcs r6, r6, r2
8f88: 21a0500e movcs r5, lr
8f8c: 218000ac orrcs r0, r0, ip, lsr #1
8f90: e1b030a3 lsrs r3, r3, #1
8f94: e1a02062 rrx r2, r2
8f98: e056e002 subs lr, r6, r2
8f9c: e0d5e003 sbcs lr, r5, r3
8fa0: 20466002 subcs r6, r6, r2
8fa4: 21a0500e movcs r5, lr
8fa8: 2180012c orrcs r0, r0, ip, lsr #2
8fac: e1b030a3 lsrs r3, r3, #1
8fb0: e1a02062 rrx r2, r2
8fb4: e056e002 subs lr, r6, r2
8fb8: e0d5e003 sbcs lr, r5, r3
8fbc: 20466002 subcs r6, r6, r2
8fc0: 21a0500e movcs r5, lr
8fc4: 218001ac orrcs r0, r0, ip, lsr #3
8fc8: e195e006 orrs lr, r5, r6
8fcc: 0a00000d beq 9008 <__aeabi_ddiv+0x134>
8fd0: e1a05205 lsl r5, r5, #4
8fd4: e1855e26 orr r5, r5, r6, lsr #28
8fd8: e1a06206 lsl r6, r6, #4
8fdc: e1a03183 lsl r3, r3, #3
8fe0: e1833ea2 orr r3, r3, r2, lsr #29
8fe4: e1a02182 lsl r2, r2, #3
8fe8: e1b0c22c lsrs ip, ip, #4
8fec: 1affffdb bne 8f60 <__aeabi_ddiv+0x8c>
8ff0: e3110601 tst r1, #1048576 ; 0x100000
8ff4: 1a000006 bne 9014 <__aeabi_ddiv+0x140>
8ff8: e1811000 orr r1, r1, r0
8ffc: e3a00000 mov r0, #0
9000: e3a0c102 mov ip, #-2147483648 ; 0x80000000
9004: eaffffd5 b 8f60 <__aeabi_ddiv+0x8c>
9008: e3110601 tst r1, #1048576 ; 0x100000
900c: 01811000 orreq r1, r1, r0
9010: 03a00000 moveq r0, #0
9014: e254c0fd subs ip, r4, #253 ; 0xfd
9018: 835c0c07 cmphi ip, #1792 ; 0x700
901c: 8affff4a bhi 8d4c <__aeabi_dmul+0xe4>
9020: e055c003 subs ip, r5, r3
9024: 0056c002 subseq ip, r6, r2
9028: 01b0c0a0 lsrseq ip, r0, #1
902c: e2b00000 adcs r0, r0, #0
9030: e0a11a04 adc r1, r1, r4, lsl #20
9034: e8bd8070 pop {r4, r5, r6, pc}
9038: e20ee102 and lr, lr, #-2147483648 ; 0x80000000
903c: e18e1621 orr r1, lr, r1, lsr #12
9040: e09440ac adds r4, r4, ip, lsr #1
9044: c074500c rsbsgt r5, r4, ip
9048: c1811a04 orrgt r1, r1, r4, lsl #20
904c: c8bd8070 popgt {r4, r5, r6, pc}
9050: e3811601 orr r1, r1, #1048576 ; 0x100000
9054: e3a0e000 mov lr, #0
9058: e2544001 subs r4, r4, #1
905c: eaffff3a b 8d4c <__aeabi_dmul+0xe4>
9060: e185e006 orr lr, r5, r6
9064: eaffff38 b 8d4c <__aeabi_dmul+0xe4>
9068: e00c5a23 and r5, ip, r3, lsr #20
906c: e134000c teq r4, ip
9070: 0135000c teqeq r5, ip
9074: 0affff93 beq 8ec8 <__aeabi_dmul+0x260>
9078: e134000c teq r4, ip
907c: 1a000006 bne 909c <__aeabi_ddiv+0x1c8>
9080: e1904601 orrs r4, r0, r1, lsl #12
9084: 1affff8f bne 8ec8 <__aeabi_dmul+0x260>
9088: e135000c teq r5, ip
908c: 1affff87 bne 8eb0 <__aeabi_dmul+0x248>
9090: e1a00002 mov r0, r2
9094: e1a01003 mov r1, r3
9098: 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 #12
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 #1
90bc: 11926083 orrsne r6, r2, r3, lsl #1
90c0: 1affff4d bne 8dfc <__aeabi_dmul+0x194>
90c4: e1904081 orrs r4, r0, r1, lsl #1
90c8: 1affff78 bne 8eb0 <__aeabi_dmul+0x248>
90cc: e1925083 orrs r5, r2, r3, lsl #1
90d0: 1affff63 bne 8e64 <__aeabi_dmul+0x1fc>
90d4: eaffff7b b 8ec8 <__aeabi_dmul+0x260>
000090d8 <__gedf2>:
90d8: e3e0c000 mvn ip, #0
90dc: ea000002 b 90ec <__cmpdf2+0x4>
000090e0 <__ledf2>:
90e0: e3a0c001 mov ip, #1
90e4: ea000000 b 90ec <__cmpdf2+0x4>
000090e8 <__cmpdf2>:
90e8: e3a0c001 mov ip, #1
90ec: e52dc004 push {ip} ; (str ip, [sp, #-4]!)
90f0: e1a0c081 lsl ip, r1, #1
90f4: e1f0cacc mvns ip, ip, asr #21
90f8: e1a0c083 lsl ip, r3, #1
90fc: 11f0cacc mvnsne ip, ip, asr #21
9100: 0a00000e beq 9140 <__cmpdf2+0x58>
9104: e28dd004 add sp, sp, #4
9108: e190c081 orrs ip, r0, r1, lsl #1
910c: 0192c083 orrseq ip, r2, r3, lsl #1
9110: 11310003 teqne r1, r3
9114: 01300002 teqeq r0, r2
9118: 03a00000 moveq r0, #0
911c: 012fff1e bxeq lr
9120: e3700000 cmn r0, #0
9124: e1310003 teq r1, r3
9128: 51510003 cmppl r1, r3
912c: 01500002 cmpeq r0, r2
9130: 21a00fc3 asrcs r0, r3, #31
9134: 31e00fc3 mvncc r0, r3, asr #31
9138: e3800001 orr r0, r0, #1
913c: e12fff1e bx lr
9140: e1a0c081 lsl ip, r1, #1
9144: e1f0cacc mvns ip, ip, asr #21
9148: 1a000001 bne 9154 <__cmpdf2+0x6c>
914c: e190c601 orrs ip, r0, r1, lsl #12
9150: 1a000004 bne 9168 <__cmpdf2+0x80>
9154: e1a0c083 lsl ip, r3, #1
9158: e1f0cacc mvns ip, ip, asr #21
915c: 1affffe8 bne 9104 <__cmpdf2+0x1c>
9160: e192c603 orrs ip, r2, r3, lsl #12
9164: 0affffe6 beq 9104 <__cmpdf2+0x1c>
9168: e49d0004 pop {r0} ; (ldr r0, [sp], #4)
916c: e12fff1e bx lr
00009170 <__aeabi_cdrcmple>:
9170: e1a0c000 mov ip, r0
9174: e1a00002 mov r0, r2
9178: e1a0200c mov r2, ip
917c: e1a0c001 mov ip, r1
9180: e1a01003 mov r1, r3
9184: e1a0300c mov r3, ip
9188: eaffffff b 918c <__aeabi_cdcmpeq>
0000918c <__aeabi_cdcmpeq>:
918c: e92d4001 push {r0, lr}
9190: ebffffd4 bl 90e8 <__cmpdf2>
9194: e3500000 cmp r0, #0
9198: 43700000 cmnmi r0, #0
919c: e8bd8001 pop {r0, pc}
000091a0 <__aeabi_dcmpeq>:
91a0: e52de008 str lr, [sp, #-8]!
91a4: ebfffff8 bl 918c <__aeabi_cdcmpeq>
91a8: 03a00001 moveq r0, #1
91ac: 13a00000 movne r0, #0
91b0: e49df008 ldr pc, [sp], #8
000091b4 <__aeabi_dcmplt>:
91b4: e52de008 str lr, [sp, #-8]!
91b8: ebfffff3 bl 918c <__aeabi_cdcmpeq>
91bc: 33a00001 movcc r0, #1
91c0: 23a00000 movcs r0, #0
91c4: e49df008 ldr pc, [sp], #8
000091c8 <__aeabi_dcmple>:
91c8: e52de008 str lr, [sp, #-8]!
91cc: ebffffee bl 918c <__aeabi_cdcmpeq>
91d0: 93a00001 movls r0, #1
91d4: 83a00000 movhi r0, #0
91d8: e49df008 ldr pc, [sp], #8
000091dc <__aeabi_dcmpge>:
91dc: e52de008 str lr, [sp, #-8]!
91e0: ebffffe2 bl 9170 <__aeabi_cdrcmple>
91e4: 93a00001 movls r0, #1
91e8: 83a00000 movhi r0, #0
91ec: e49df008 ldr pc, [sp], #8
000091f0 <__aeabi_dcmpgt>:
91f0: e52de008 str lr, [sp, #-8]!
91f4: ebffffdd bl 9170 <__aeabi_cdrcmple>
91f8: 33a00001 movcc r0, #1
91fc: 23a00000 movcs r0, #0
9200: e49df008 ldr pc, [sp], #8
00009204 <__aeabi_d2iz>:
9204: e1a02081 lsl r2, r1, #1
9208: e2922602 adds r2, r2, #2097152 ; 0x200000
920c: 2a00000c bcs 9244 <__aeabi_d2iz+0x40>
9210: 5a000009 bpl 923c <__aeabi_d2iz+0x38>
9214: e3e03e3e mvn r3, #992 ; 0x3e0
9218: e0532ac2 subs r2, r3, r2, asr #21
921c: 9a00000a bls 924c <__aeabi_d2iz+0x48>
9220: e1a03581 lsl r3, r1, #11
9224: e3833102 orr r3, r3, #-2147483648 ; 0x80000000
9228: e1833aa0 orr r3, r3, r0, lsr #21
922c: e3110102 tst r1, #-2147483648 ; 0x80000000
9230: e1a00233 lsr r0, r3, r2
9234: 12600000 rsbne r0, r0, #0
9238: e12fff1e bx lr
923c: e3a00000 mov r0, #0
9240: e12fff1e bx lr
9244: e1900601 orrs r0, r0, r1, lsl #12
9248: 1a000002 bne 9258 <__aeabi_d2iz+0x54>
924c: e2110102 ands r0, r1, #-2147483648 ; 0x80000000
9250: 03e00102 mvneq r0, #-2147483648 ; 0x80000000
9254: e12fff1e bx lr
9258: e3a00000 mov r0, #0
925c: e12fff1e bx lr
00009260 <__libc_csu_init>:
9260: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
9264: e1a0a000 mov sl, r0
9268: e1a08001 mov r8, r1
926c: e1a07002 mov r7, r2
9270: e59f40a8 ldr r4, [pc, #168] ; 9320 <__libc_csu_init+0xc0>
9274: ebfffc43 bl 8388 <_init>
9278: e59f10a4 ldr r1, [pc, #164] ; 9324 <__libc_csu_init+0xc4>
927c: e08f4004 add r4, pc, r4
9280: e08f0001 add r0, pc, r1
9284: e0649000 rsb r9, r4, r0
9288: e1b09149 asrs r9, r9, #2
928c: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
9290: e3a06001 mov r6, #1
9294: e4943004 ldr r3, [r4], #4
9298: e1a0000a mov r0, sl
929c: e1a01008 mov r1, r8
92a0: e1a02007 mov r2, r7
92a4: e2495001 sub r5, r9, #1
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, #0
92bc: 0a000007 beq 92e0 <__libc_csu_init+0x80>
92c0: e494c004 ldr ip, [r4], #4
92c4: e1a0000a mov r0, sl
92c8: e1a01008 mov r1, r8
92cc: e1a02007 mov r2, r7
92d0: e3a06002 mov r6, #2
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], #4
92e8: e1a0000a mov r0, sl
92ec: e1a01008 mov r1, r8
92f0: e1a02007 mov r2, r7
92f4: e12fff33 blx r3
92f8: e2866002 add r6, r6, #2
92fc: e594c004 ldr ip, [r4, #4]
9300: e1a0000a mov r0, sl
9304: e1a01008 mov r1, r8
9308: e1a02007 mov r2, r7
930c: e12fff3c blx ip
9310: e1560009 cmp r6, r9
9314: e2854004 add r4, r5, #4
9318: 1afffff0 bne 92e0 <__libc_csu_init+0x80>
931c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
9320: 00008184 .word 0x00008184
9324: 00008184 .word 0x00008184
00009328 <__libc_csu_fini>:
9328: e12fff1e bx lr
Disassembly of section .fini:
0000932c <_fini>:
932c: e92d4008 push {r3, lr}
9330: 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:
00008388 <_init>:
8388: e92d4008 push {r3, lr}
838c: eb000024 bl 8424 <call_gmon_start>
8390: e8bd8008 pop {r3, pc}
Disassembly of section .plt:
00008394 <.plt>:
8394: e52de004 push {lr} ; (str lr, [sp, #-4]!)
8398: e59fe004 ldr lr, [pc, #4] ; 83a4 <_init+0x1c>
839c: e08fe00e add lr, pc, lr
83a0: e5bef008 ldr pc, [lr, #8]!
83a4: 0000865c .word 0x0000865c
83a8: e28fc600 add ip, pc, #0, 12
83ac: e28cca08 add ip, ip, #8, 20 ; 0x8000
83b0: e5bcf65c ldr pc, [ip, #1628]! ; 0x65c
83b4: e28fc600 add ip, pc, #0, 12
83b8: e28cca08 add ip, ip, #8, 20 ; 0x8000
83bc: e5bcf654 ldr pc, [ip, #1620]! ; 0x654
83c0: e28fc600 add ip, pc, #0, 12
83c4: e28cca08 add ip, ip, #8, 20 ; 0x8000
83c8: e5bcf64c ldr pc, [ip, #1612]! ; 0x64c
83cc: e28fc600 add ip, pc, #0, 12
83d0: e28cca08 add ip, ip, #8, 20 ; 0x8000
83d4: e5bcf644 ldr pc, [ip, #1604]! ; 0x644
83d8: e28fc600 add ip, pc, #0, 12
83dc: e28cca08 add ip, ip, #8, 20 ; 0x8000
83e0: e5bcf63c ldr pc, [ip, #1596]! ; 0x63c
Disassembly of section .text:
000083e8 <_start>:
83e8: e3a0b000 mov fp, #0
83ec: e3a0e000 mov lr, #0
83f0: e49d1004 pop {r1} ; (ldr r1, [sp], #4)
83f4: e1a0200d mov r2, sp
83f8: e52d2004 push {r2} ; (str r2, [sp, #-4]!)
83fc: e52d0004 push {r0} ; (str r0, [sp, #-4]!)
8400: e59fc010 ldr ip, [pc, #16] ; 8418 <_start+0x30>
8404: e52dc004 push {ip} ; (str ip, [sp, #-4]!)
8408: e59f000c ldr r0, [pc, #12] ; 841c <_start+0x34>
840c: e59f300c ldr r3, [pc, #12] ; 8420 <_start+0x38>
8410: ebffffe7 bl 83b4 <_init+0x2c>
8414: ebffffef bl 83d8 <_init+0x50>
8418: 00008830 .word 0x00008830
841c: 00008590 .word 0x00008590
8420: 00008768 .word 0x00008768
00008424 <call_gmon_start>:
8424: e59f0014 ldr r0, [pc, #20] ; 8440 <call_gmon_start+0x1c>
8428: e59f2014 ldr r2, [pc, #20] ; 8444 <call_gmon_start+0x20>
842c: e08f3000 add r3, pc, r0
8430: e7933002 ldr r3, [r3, r2]
8434: e3530000 cmp r3, #0
8438: 012fff1e bxeq lr
843c: eaffffdf b 83c0 <_init+0x38>
8440: 000085cc .word 0x000085cc
8444: 00000020 .word 0x00000020
00008448 <__do_global_dtors_aux>:
8448: e59f3010 ldr r3, [pc, #16] ; 8460 <__do_global_dtors_aux+0x18>
844c: e5d32000 ldrb r2, [r3]
8450: e3520000 cmp r2, #0
8454: 03a02001 moveq r2, #1
8458: 05c32000 strbeq r2, [r3]
845c: e12fff1e bx lr
8460: 00010a2c .word 0x00010a2c
00008464 <frame_dummy>:
8464: e59f0020 ldr r0, [pc, #32] ; 848c <frame_dummy+0x28>
8468: e92d4008 push {r3, lr}
846c: e5903000 ldr r3, [r0]
8470: e3530000 cmp r3, #0
8474: 08bd8008 popeq {r3, pc}
8478: e59f3010 ldr r3, [pc, #16] ; 8490 <frame_dummy+0x2c>
847c: e3530000 cmp r3, #0
8480: 08bd8008 popeq {r3, pc}
8484: e12fff33 blx r3
8488: e8bd8008 pop {r3, pc}
848c: 00010904 .word 0x00010904
...
00008498 <ln>:
8498: e52db004 push {fp} ; (str fp, [sp, #-4]!)
849c: e28db000 add fp, sp, #0
84a0: e24dd034 sub sp, sp, #52 ; 0x34
84a4: e14b03f4 strd r0, [fp, #-52] ; 0xffffffcc
84a8: e3a0300f mov r3, #15
84ac: e50b3018 str r3, [fp, #-24] ; 0xffffffe8
84b0: ed1b6b0d vldr d6, [fp, #-52] ; 0xffffffcc
84b4: ed9f7b33 vldr d7, [pc, #204] ; 8588 <ln+0xf0>
84b8: ee365b47 vsub.f64 d5, d6, d7
84bc: ed1b6b0d vldr d6, [fp, #-52] ; 0xffffffcc
84c0: ed9f7b30 vldr d7, [pc, #192] ; 8588 <ln+0xf0>
84c4: ee366b07 vadd.f64 d6, d6, d7
84c8: ee857b06 vdiv.f64 d7, d5, d6
84cc: ed0b7b09 vstr d7, [fp, #-36] ; 0xffffffdc
84d0: ed1b6b09 vldr d6, [fp, #-36] ; 0xffffffdc
84d4: ed1b7b09 vldr d7, [fp, #-36] ; 0xffffffdc
84d8: ee267b07 vmul.f64 d7, d6, d7
84dc: ed0b7b0b vstr d7, [fp, #-44] ; 0xffffffd4
84e0: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
84e4: e1a03083 lsl r3, r3, #1
84e8: e2833001 add r3, r3, #1
84ec: e50b300c str r3, [fp, #-12]
84f0: e51b300c ldr r3, [fp, #-12]
84f4: ee073a90 vmov s15, r3
84f8: eeb86be7 vcvt.f64.s32 d6, s15
84fc: ed9f5b21 vldr d5, [pc, #132] ; 8588 <ln+0xf0>
8500: ee857b06 vdiv.f64 d7, d5, d6
8504: ed0b7b05 vstr d7, [fp, #-20] ; 0xffffffec
8508: e51b3018 ldr r3, [fp, #-24] ; 0xffffffe8
850c: e50b3008 str r3, [fp, #-8]
8510: ea00000f b 8554 <ln+0xbc>
8514: e51b300c ldr r3, [fp, #-12]
8518: e2433002 sub r3, r3, #2
851c: e50b300c str r3, [fp, #-12]
8520: e51b300c ldr r3, [fp, #-12]
8524: ee063a90 vmov s13, r3
8528: eeb87be6 vcvt.f64.s32 d7, s13
852c: ed9f5b15 vldr d5, [pc, #84] ; 8588 <ln+0xf0>
8530: ee856b07 vdiv.f64 d6, d5, d7
8534: ed1b5b0b vldr d5, [fp, #-44] ; 0xffffffd4
8538: ed1b7b05 vldr d7, [fp, #-20] ; 0xffffffec
853c: ee257b07 vmul.f64 d7, d5, d7
8540: ee367b07 vadd.f64 d7, d6, d7
8544: ed0b7b05 vstr d7, [fp, #-20] ; 0xffffffec
8548: e51b3008 ldr r3, [fp, #-8]
854c: e2433001 sub r3, r3, #1
8550: e50b3008 str r3, [fp, #-8]
8554: e51b3008 ldr r3, [fp, #-8]
8558: e3530000 cmp r3, #0
855c: caffffec bgt 8514 <ln+0x7c>
8560: ed1b7b09 vldr d7, [fp, #-36] ; 0xffffffdc
8564: ee376b07 vadd.f64 d6, d7, d7
8568: ed1b7b05 vldr d7, [fp, #-20] ; 0xffffffec
856c: ee267b07 vmul.f64 d7, d6, d7
8570: ec532b17 vmov r2, r3, d7
8574: e1a00002 mov r0, r2
8578: e1a01003 mov r1, r3
857c: e28bd000 add sp, fp, #0
8580: e8bd0800 pop {fp}
8584: e12fff1e bx lr
8588: 00000000 .word 0x00000000
858c: 3ff00000 .word 0x3ff00000
00008590 <main>:
8590: e92d4800 push {fp, lr}
8594: e28db004 add fp, sp, #4
8598: e24dd030 sub sp, sp, #48 ; 0x30
859c: e3a03000 mov r3, #0
85a0: e50b3024 str r3, [fp, #-36] ; 0xffffffdc
85a4: e3a03000 mov r3, #0
85a8: e50b3020 str r3, [fp, #-32] ; 0xffffffe0
85ac: e3a03000 mov r3, #0
85b0: e50b302c str r3, [fp, #-44] ; 0xffffffd4
85b4: e3a03000 mov r3, #0
85b8: e50b3028 str r3, [fp, #-40] ; 0xffffffd8
85bc: e3a00002 mov r0, #2
85c0: e24b3024 sub r3, fp, #36 ; 0x24
85c4: e1a01003 mov r1, r3
85c8: ebffff7f bl 83cc <_init+0x44>
85cc: e28f3f53 add r3, pc, #332 ; 0x14c
85d0: e1c320d0 ldrd r2, [r3]
85d4: e14b21f4 strd r2, [fp, #-20] ; 0xffffffec
85d8: ea00001e b 8658 <main+0xc8>
85dc: ed1b6b05 vldr d6, [fp, #-20] ; 0xffffffec
85e0: ed9f7b50 vldr d7, [pc, #320] ; 8728 <main+0x198>
85e4: ee266b07 vmul.f64 d6, d6, d7
85e8: e28f3d05 add r3, pc, #320 ; 0x140
85ec: e1c320d0 ldrd r2, [r3]
85f0: ed1b7b05 vldr d7, [fp, #-20] ; 0xffffffec
85f4: ec432b15 vmov d5, r2, r3
85f8: ee355b47 vsub.f64 d5, d5, d7
85fc: ee867b05 vdiv.f64 d7, d6, d5
8600: ed0b7b07 vstr d7, [fp, #-28] ; 0xffffffe4
8604: ed1b5b07 vldr d5, [fp, #-28] ; 0xffffffe4
8608: ed9f6b4a vldr d6, [pc, #296] ; 8738 <main+0x1a8>
860c: ee857b06 vdiv.f64 d7, d5, d6
8610: ec510b17 vmov r0, r1, d7
8614: ebffff9f bl 8498 <ln>
8618: ec410b15 vmov d5, r0, r1
861c: ed9f6b47 vldr d6, [pc, #284] ; 8740 <main+0x1b0>
8620: ee857b06 vdiv.f64 d7, d5, d6
8624: ed9f6b47 vldr d6, [pc, #284] ; 8748 <main+0x1b8>
8628: ee376b06 vadd.f64 d6, d7, d6
862c: ed9f5b3b vldr d5, [pc, #236] ; 8720 <main+0x190>
8630: ee857b06 vdiv.f64 d7, d5, d6
8634: ed9f6b45 vldr d6, [pc, #276] ; 8750 <main+0x1c0>
8638: ee377b46 vsub.f64 d7, d7, d6
863c: eefd6bc7 vcvt.s32.f64 s13, d7
8640: ee163a90 vmov r3, s13
8644: e50b3008 str r3, [fp, #-8]
8648: ed1b6b05 vldr d6, [fp, #-20] ; 0xffffffec
864c: ed9f7b33 vldr d7, [pc, #204] ; 8720 <main+0x190>
8650: ee367b07 vadd.f64 d7, d6, d7
8654: ed0b7b05 vstr d7, [fp, #-20] ; 0xffffffec
8658: ed1b6b05 vldr d6, [fp, #-20] ; 0xffffffec
865c: ed9f7b33 vldr d7, [pc, #204] ; 8730 <main+0x1a0>
8660: eeb46bc7 vcmpe.f64 d6, d7
8664: eef1fa10 vmrs APSR_nzcv, fpscr
8668: 53a03000 movpl r3, #0
866c: 43a03001 movmi r3, #1
8670: e20330ff and r3, r3, #255 ; 0xff
8674: e3530000 cmp r3, #0
8678: 1affffd7 bne 85dc <main+0x4c>
867c: e3a00002 mov r0, #2
8680: e24b302c sub r3, fp, #44 ; 0x2c
8684: e1a01003 mov r1, r3
8688: ebffff4f bl 83cc <_init+0x44>
868c: e59f10c4 ldr r1, [pc, #196] ; 8758 <main+0x1c8>
8690: e51b2024 ldr r2, [fp, #-36] ; 0xffffffdc
8694: e51b3020 ldr r3, [fp, #-32] ; 0xffffffe0
8698: 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, #172] ; 875c <main+0x1cc>
86ac: e51b202c ldr r2, [fp, #-44] ; 0xffffffd4
86b0: e51b3028 ldr r3, [fp, #-40] ; 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, #148] ; 8760 <main+0x1d0>
86c8: e51b202c ldr r2, [fp, #-44] ; 0xffffffd4
86cc: e51b3024 ldr r3, [fp, #-36] ; 0xffffffdc
86d0: e0632002 rsb r2, r3, r2
86d4: e51b1028 ldr r1, [fp, #-40] ; 0xffffffd8
86d8: e51b3020 ldr r3, [fp, #-32] ; 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, #104] ; 8764 <main+0x1d4>
86f8: e51b3008 ldr r3, [fp, #-8]
86fc: e58d3000 str r3, [sp]
8700: e1a03002 mov r3, r2
8704: e1a00003 mov r0, r3
8708: e14b21d4 ldrd r2, [fp, #-20] ; 0xffffffec
870c: ebffff25 bl 83a8 <_init+0x20>
8710: e3a03000 mov r3, #0
8714: e1a00003 mov r0, r3
8718: e24bd004 sub sp, fp, #4
871c: e8bd8800 pop {fp, pc}
8720: 00000000 .word 0x00000000
8724: 3ff00000 .word 0x3ff00000
8728: 00000000 .word 0x00000000
872c: 40e6f300 .word 0x40e6f300
8730: 00000000 .word 0x00000000
8734: 409c2000 .word 0x409c2000
8738: 00000000 .word 0x00000000
873c: 40c38800 .word 0x40c38800
8740: 00000000 .word 0x00000000
8744: 40aedc00 .word 0x40aedc00
8748: dcb5db83 .word 0xdcb5db83
874c: 3f6b79e1 .word 0x3f6b79e1
8750: 66666666 .word 0x66666666
8754: 40711266 .word 0x40711266
8758: 00008840 .word 0x00008840
875c: 0000885c .word 0x0000885c
8760: 00008878 .word 0x00008878
8764: 00008890 .word 0x00008890
00008768 <__libc_csu_init>:
8768: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
876c: e1a0a000 mov sl, r0
8770: e1a08001 mov r8, r1
8774: e1a07002 mov r7, r2
8778: e59f40a8 ldr r4, [pc, #168] ; 8828 <__libc_csu_init+0xc0>
877c: ebffff01 bl 8388 <_init>
8780: e59f10a4 ldr r1, [pc, #164] ; 882c <__libc_csu_init+0xc4>
8784: e08f4004 add r4, pc, r4
8788: e08f0001 add r0, pc, r1
878c: e0649000 rsb r9, r4, r0
8790: e1b09149 asrs r9, r9, #2
8794: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
8798: e3a06001 mov r6, #1
879c: e4943004 ldr r3, [r4], #4
87a0: e1a0000a mov r0, sl
87a4: e1a01008 mov r1, r8
87a8: e1a02007 mov r2, r7
87ac: e2495001 sub r5, r9, #1
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, #0
87c4: 0a000007 beq 87e8 <__libc_csu_init+0x80>
87c8: e494c004 ldr ip, [r4], #4
87cc: e1a0000a mov r0, sl
87d0: e1a01008 mov r1, r8
87d4: e1a02007 mov r2, r7
87d8: e3a06002 mov r6, #2
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], #4
87f0: e1a0000a mov r0, sl
87f4: e1a01008 mov r1, r8
87f8: e1a02007 mov r2, r7
87fc: e12fff33 blx r3
8800: e2866002 add r6, r6, #2
8804: e594c004 ldr ip, [r4, #4]
8808: e1a0000a mov r0, sl
880c: e1a01008 mov r1, r8
8810: e1a02007 mov r2, r7
8814: e12fff3c blx ip
8818: e1560009 cmp r6, r9
881c: e2854004 add r4, r5, #4
8820: 1afffff0 bne 87e8 <__libc_csu_init+0x80>
8824: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
8828: 00008170 .word 0x00008170
882c: 00008170 .word 0x00008170
00008830 <__libc_csu_fini>:
8830: e12fff1e bx lr
Disassembly of section .fini:
00008834 <_fini>:
8834: e92d4008 push {r3, lr}
8838: 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 = 15;
int k,nk;
double x,xx,y;
x = (a-1)/(a+1);
xx = x*x;
nk = 2*N+1;
y = 1.0/nk;
for(k=N;k>0;k--) {
nk = nk - 2;
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={0, 0},time_end={0, 0};
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=1; Vadc<1800; Vadc++) {
Rt = Vadc * 47000 / (1800-Vadc);
t1=1/(ln(Rt/10000)/3950+1/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 0;
}
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.65
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.3 -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:
00000000 <init_module>:
0: e92d41f0 push {r4, r5, r6, r7, r8, lr}
4: ed2d8b02 vpush {d8}
8: e24dd010 sub sp, sp, #16
c: e59f217c ldr r2, [pc, #380] ; 190 <init_module+0x190>
10: e59f317c ldr r3, [pc, #380] ; 194 <init_module+0x194>
14: e59f017c ldr r0, [pc, #380] ; 198 <init_module+0x198>
18: ebfffffe bl 0 <printk>
1c: ed9f8b4b vldr d8, [pc, #300] ; 150 <init_module+0x150>
20: e59f2168 ldr r2, [pc, #360] ; 190 <init_module+0x190>
24: e59f3168 ldr r3, [pc, #360] ; 194 <init_module+0x194>
28: e59f016c ldr r0, [pc, #364] ; 19c <init_module+0x19c>
2c: ebfffffe bl 0 <printk>
30: e3a0100f mov r1, #15
34: e59f0160 ldr r0, [pc, #352] ; 19c <init_module+0x19c>
38: ebfffffe bl 0 <printk>
3c: e1a0000d mov r0, sp
40: ebfffffe bl 0 <current_kernel_time>
44: e59d7000 ldr r7, [sp]
48: e59d5004 ldr r5, [sp, #4]
4c: eeb02b48 vmov.f64 d2, d8
50: ea000021 b dc <init_module+0xdc>
54: ed9f0b3f vldr d0, [pc, #252] ; 158 <init_module+0x158>
58: ee366b48 vsub.f64 d6, d6, d8
5c: ed9f7b3f vldr d7, [pc, #252] ; 160 <init_module+0x160>
60: e3a0301f mov r3, #31
64: ed9f4b3f vldr d4, [pc, #252] ; 168 <init_module+0x168>
68: ee280b00 vmul.f64 d0, d8, d0
6c: ee806b06 vdiv.f64 d6, d0, d6
70: ee866b07 vdiv.f64 d6, d6, d7
74: ee367b42 vsub.f64 d7, d6, d2
78: ee366b02 vadd.f64 d6, d6, d2
7c: ee876b06 vdiv.f64 d6, d7, d6
80: ee265b06 vmul.f64 d5, d6, d6
84: e2433002 sub r3, r3, #2
88: ed9f3b30 vldr d3, [pc, #192] ; 150 <init_module+0x150>
8c: e3530001 cmp r3, #1
90: ee013a10 vmov s2, r3
94: eeb87bc1 vcvt.f64.s32 d7, s2
98: 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 84 <init_module+0x84>
ac: ee360b06 vadd.f64 d0, d6, d6
b0: ed9f6b2e vldr d6, [pc, #184] ; 170 <init_module+0x170>
b4: ed9f5b2f vldr d5, [pc, #188] ; 178 <init_module+0x178>
b8: ee207b01 vmul.f64 d7, d0, d1
bc: ee877b06 vdiv.f64 d7, d7, d6
c0: ed9f6b2e vldr d6, [pc, #184] ; 180 <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, #164] ; 188 <init_module+0x188>
e0: eeb48bc6 vcmpe.f64 d8, d6
e4: eef1fa10 vmrs APSR_nzcv, fpscr
e8: 4affffd9 bmi 54 <init_module+0x54>
ec: e28d0008 add r0, sp, #8
f0: ebfffffe bl 0 <current_kernel_time>
f4: e59d8008 ldr r8, [sp, #8]
f8: e59d600c ldr r6, [sp, #12]
fc: e1a01007 mov r1, r7
100: e1a02005 mov r2, r5
104: e59f0094 ldr r0, [pc, #148] ; 1a0 <init_module+0x1a0>
108: ebfffffe bl 0 <printk>
10c: e1a01008 mov r1, r8
110: e1a02006 mov r2, r6
114: e59f0088 ldr r0, [pc, #136] ; 1a4 <init_module+0x1a4>
118: ebfffffe bl 0 <printk>
11c: e0671008 rsb r1, r7, r8
120: e0652006 rsb r2, r5, r6
124: e59f007c ldr r0, [pc, #124] ; 1a8 <init_module+0x1a8>
128: ebfffffe bl 0 <printk>
12c: eefd3bc8 vcvt.s32.f64 s7, d8
130: e1a02004 mov r2, r4
134: e59f0070 ldr r0, [pc, #112] ; 1ac <init_module+0x1ac>
138: ee131a90 vmov r1, s7
13c: ebfffffe bl 0 <printk>
140: e3a00000 mov r0, #0
144: e28dd010 add sp, sp, #16
148: ecbd8b02 vpop {d8}
14c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
150: 00000000 .word 0x00000000
154: 3ff00000 .word 0x3ff00000
158: 00000000 .word 0x00000000
15c: 40e6f300 .word 0x40e6f300
160: 00000000 .word 0x00000000
164: 40c38800 .word 0x40c38800
168: 08421084 .word 0x08421084
16c: 3fa08421 .word 0x3fa08421
170: 00000000 .word 0x00000000
174: 40aedc00 .word 0x40aedc00
178: dcb5db83 .word 0xdcb5db83
17c: 3f6b79e1 .word 0x3f6b79e1
180: 66666666 .word 0x66666666
184: 40711266 .word 0x40711266
188: 00000000 .word 0x00000000
18c: 409c2000 .word 0x409c2000
190: 1eb851eb .word 0x1eb851eb
194: 402e6b85 .word 0x402e6b85
198: 00000000 .word 0x00000000
19c: 00000011 .word 0x00000011
1a0: 00000022 .word 0x00000022
1a4: 0000003b .word 0x0000003b
1a8: 00000054 .word 0x00000054
1ac: 0000006b .word 0x0000006b
000001b0 <cleanup_module>:
1b0: e59f0000 ldr r0, [pc] ; 1b8 <cleanup_module+0x8>
1b4: eafffffe b 0 <printk>
1b8: 00000074 .word 0x00000074
1bc: e320f000 nop {0}
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