如何判断toolchain是否支持EABI?

 根据CLF的介绍,用gcc-4.1.1, glibc-2.5的toolchain,如何确认这个toolchain支持或不支持EABI?

For example,

write a hello.c file having two fuctnions A and B. B called A with some parameters.

From hello.o, you can disassemble it and then very easily to tell how the stack/GPR get used.

 

如果你是指MIPS的EABI,那么是支持的。可以试试:

gcc -mabi=eabi test.c -o test

 

从GCC 4.0.x开始就支持EABI了

 

Why ARM's EABI Matters-from Linuxdevices.com
Why ARM's EABI Matters

by Andres Calderon and Nelson Castillo


It's common nowadays to hear of the new ARM EABI (embedded application binary interface) Linux port. There are many motivations to start using it, but there is one we especially like -- it's much faster for floating point operations. Since many ARM cores lack a hardware FPU (floating point unit), any software acceleration is more than welcome.

It might be hard to switch to EABI, though. For instance, for the Debian distribution, EABI is actually considered a new port.

Without EABI

The ARM EABI improves the floating point performance. This is not surprising, if you read how your processor is wasting a lot of cycles now. From the Debian ARM-EABI wiki:
The current Debian port creates hardfloat FPA instructions. FPA comes from "Floating Point Accelerator." Since the FPA floating point unit was implemented only in very few ARM cores, these days FPA instructions are emulated in kernel via Illegal instruction faults. This is of course very inefficient: about 10 times slower that -msoftfloat for a FIR test program. The FPA unit also has the peculiarity of having mixed-endian doubles, which is usually the biggest grief for ARM porters, along with structure packing issues.
So, what does this mean? It means that the compilers usually generate instructions for a piece of hardware, namely a Floating Point Unit, that is not actually there! When you make a floating point operation, such at 3.58*x, the CPU runs into an illegal instruction, and it raises an exception. The kernel catches this specific exception and performs the intended float point operation, and then resumes executing the program. And this is slow because it implies a context switch.

The benchmark

We decided to make a simple benchmark using our Open Hardware Free ECB_AT91 ARM(ARMv4t) development board, based on an Atmel AT91RM9200 processor.


The ECB_AT91, top and bottom
(Click each image to enlarge)

We used a simple benchmark we have used before: the dot product of two given vectors, the Euclidean distance of the vectors, and the FFT (fast Fourier transform) algorithm (complex valued, Cooley and Tukey radix-2). The source code we used is available here (GPL).

It's common to use the number of floating point operations per second (FLOPS) performed by a given program for benchmarking purposes. However, this can be misleading, because some operations (e.g. division) take more time than others (e.g. addition). To ensure uniformity, we ran the same program in both setups, with similar compiler flags.

First we tried the Old ABI using the Debian distribution (Debian Sid), and an image that we bootstrapped. Then, for the EABI test, we used the Angstrom Distribution, part of the OpenEmbedded project.

Results


EABI vx. OABI, floating point benchmark (Free_ECP_AT91_V1.5, AT92RM9200)
(Click to enlarge. Source: emQbit)



EABI/OABI speed-up, floating point benchmark (Free_ECB_AT91_V1.5, AT92RM9200)
(Click to enlarge)

In each context switch, both the data and instruction cache are flushed, and this hurts the Old ABI's performance. You will notice it in the graphs because the performance with the old ABI does not depend on the size (N) of the input data, whereas in EABI the impact of the cache in the performance is seen clearly. The dot-product performance only goes down when N > 4096 (When we use more than 16KB in memory); the Atmel processor we're using has a 16 Kbyte data cache.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值