From 468f0c4407895557ca8089430f894a85f06afe97 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 20 Apr 2013 17:46:58 +0000 Subject: 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 --- test/regression/builtins-ia32.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/regression/builtins-ia32.c (limited to 'test/regression/builtins-ia32.c') 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 + +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; +} + + + + + -- cgit