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-ia32.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-ia32.c')
-rw-r--r-- | test/regression/builtins-ia32.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/regression/builtins-ia32.c b/test/regression/builtins-ia32.c new file mode 100644 index 00000000..43e45668 --- /dev/null +++ b/test/regression/builtins-ia32.c @@ -0,0 +1,25 @@ +/* Fun with builtin functions */ + +#include <stdio.h> + +int main(int argc, char ** argv) +{ + unsigned int x = 0x12345678; + double a = 3.14159; + double b = 2.718; + unsigned short s = 0x1234; + + printf("bswap(%x) = %x\n", x, __builtin_bswap(x)); + printf("bswap16(%x) = %x\n", s, __builtin_bswap16(s)); + + printf("fsqrt(%f) = %f\n", a, __builtin_fsqrt(a)); + printf("fmin(%f, %f) = %f\n", a, b, __builtin_fmin(a, b)); + printf("fmax(%f, %f) = %f\n", a, b, __builtin_fmax(a, b)); + + return 0; +} + + + + + |