ts-7000
[Top] [All Lists]

[ts-7000] Why we use an EABI cross-compiler

To:
Subject: [ts-7000] Why we use an EABI cross-compiler
From: "andy.shinsel" <>
Date: Sun, 09 Aug 2009 03:29:33 -0000


Hi everyone.

Here are some interesting things we found, that convinced us to use EABI instead of OABI.

Why is EABI better?
(paraphrasing http://embebido.org/draft-abi-oabi and http://wiki.debian.org/ArmEabiPort)

The biggest problem with OABI comes from the fact that in OABI binaries, it's assuming a specific hardware FPU is there. That particular FPU is rare and is not in many ARM cores. The code runs, and then when it hits an FPU instruction not implemented, it results in an illegal instruction. The kernel catches this and does the instruction in an emulated manner. It's slow.

Very slow.

All sounds good in theory, let's test it out...
This is the program that we used as a benchmark.

#include <stdio.h>

int main(int argc, char *argv[])
{

double z = 0.0;
int x, y;

for (x = 0; x < 10000; x++)
{
for (y = 0; y < 10000; y++)
{
z += (float)(y * x);
z /= 15.23;
}
}
printf("%f\n", z);

return 0;

}

Test 1
Compile Command:
arm-ts-linux-gnueabi-gcc -mcpu=ep9312 -O -ffast-math floatTest.c -o floatTestEABI

Run Command:
time { ./floatTestEABI; }

Result:
real 1m 53.11s
user 1m 53.10s
sys 0m 0.00s

Test 2 - (Using Maverick Floating Point Unit)
Compile Command:
arm-ts-linux-gnueabi-gcc -mcpu=ep9312 -mfpu=maverick -mfloat-abi=softfp -O -ffast-math floatTest.c -o floatTestEABIMaverick

Run Command:
time { ./floatTestEABIMaverick; }

Result:
real 0m 18.03s
user 0m 18.02s
sys 0m 0.00s

We were very impressed with this performance increase gained by using the Maverick FPU, around 6x faster than without! (in this test).

Test 3 - OABI
Compile Command:
arm-ts-linux-gnu-gcc floatTest.c -o floatTestOABI

Run Command:
time { ./floatTestOABI; }

Result:
Ok, to be honest, we don't know the real result, we let the program run for 20 minutes, and got sick of waiting, this was the output when we broke out of the program:
Command terminated by signal 15
real 21m 21.97s
user 0m 15.74s
sys 21m 5.42s - Notice that sys in the other tests is 0!

Someday we will try to finish the test and get a real result, but this is still impressive, just by switching to EABI, we increase performance by over 10x (while performing floating point math)

So the moral of the story is - If you are using a lot of floating point math, USE EABI!!!


__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU