diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-04-20 17:46:58 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-04-20 17:46:58 +0000 |
commit | 468f0c4407895557ca8089430f894a85f06afe97 (patch) | |
tree | 76d4d5bb302da822797ccbbecd8f4cfd935bf938 /test/regression/builtins-arm.c | |
parent | 600e5f3be65eeffc80d5c4cad800121fe521a1aa (diff) | |
download | compcert-468f0c4407895557ca8089430f894a85f06afe97.tar.gz compcert-468f0c4407895557ca8089430f894a85f06afe97.zip |
Add __builtin_bswap16 and __builtin_bswap32 to all ports.
Remove __builtin_{read,write}_reversed from IA32 and ARM ports.
Machregs: tighten destroyed_by_builtin
Packedstructs: use bswap if read/write-reversed not available.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2208 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/builtins-arm.c')
-rw-r--r-- | test/regression/builtins-arm.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/regression/builtins-arm.c b/test/regression/builtins-arm.c new file mode 100644 index 00000000..41ea88b5 --- /dev/null +++ b/test/regression/builtins-arm.c @@ -0,0 +1,23 @@ +/* Fun with builtins */ + +#include <stdio.h> + +int main(int argc, char ** argv) +{ + unsigned int x = 0x12345678; + unsigned int y = 0xDEADBEEF; + double a = 3.14159; + unsigned short s = 0x1234; + + printf("bswap(%x) = %x\n", x, __builtin_bswap(x)); + printf("bswap16(%x) = %x\n", s, __builtin_bswap16(s)); + printf("cntlz(%x) = %d\n", x, __builtin_cntlz(x)); + printf("fsqrt(%f) = %f\n", a, __builtin_fsqrt(a)); + + return 0; +} + + + + + |