From owner-freebsd-numerics@FreeBSD.ORG Fri May 24 08:07:08 2013 Return-Path: Delivered-To: numerics@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AD9B6140; Fri, 24 May 2013 08:07:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2026DD; Fri, 24 May 2013 08:07:07 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4O86v8A012253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 May 2013 18:06:59 +1000 Date: Fri, 24 May 2013 18:06:57 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: numerics@freebsd.org Subject: clang crash on "x" constraint for athlon-xp Message-ID: <20130524173835.T2001@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=52lMFrBwFFYA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=iyYjl1V9ma8A:10 a=Twlkf-z8AAAA:8 a=MrvP7jtUUPqbAPXLnmwA:9 a=CjuIK1q_8ugA:10 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 Cc: dim@freebsd.org X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 08:07:08 -0000 Why does clang -march=athlon-xp abort on this? @ #include @ @ void @ foo(void) @ { @ __m128 x; @ @ asm("" : "=x" (x)); @ } @ SplitVectorResult #0: 0x2a190228: v16i8 = Register %vreg1 [ORD=1] [ID=0] @ @ fatal error: error in backend: Do not know how to split the result of this operator! @ @ cc: error: clang frontend command failed with exit code 70 (use -v to see invocation) @ FreeBSD clang version 3.3 (trunk 178860) 20130405 @ Target: i386-unknown-freebsd10.0 @ Thread model: posix @ cc: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. @ cc: note: diagnostic msg: @ ******************** @ @ PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: @ Preprocessed source(s) and associated run script(s) are located at: @ cc: note: diagnostic msg: /tmp/z-SmXpwL.c @ cc: note: diagnostic msg: /tmp/z-SmXpwL.sh @ cc: note: diagnostic msg: @ @ ******************** clang also fills up /tmp with these files. gcc -march=athlon-xp works, and so does clang -march=athlon64. athlon64 has SSE1 and SSE2; athlon-xp only has SSE1. The above is trying to use only SSE1 features. I don't really understand and am using it here just to declare __m128. Perhaps it can do what I want without any asm. This is to take an 8-byte double and split it into 2 integers using SSE*, and vice versa. SSE* must be used on 32-bit systems since compilers still don't understand how to unpack and repack 64-bit objects efficiently using integer instructions (loads and stores must be 64 bits). I also need this for 10-byte long doubles. Raw asm is needed for 2 bytes of these, and it would be hard to combine this with any intrinsics. While here, I will re-report another clang asm problem: @ double_t dt; @ double d; @ @ __asm("" : "=t" (d) : "0" (dt)); This works with gcc, but fails (generates a store-load of d, but the whole point of this null asm is to avoid this store-load by pretending that the asm does it) with clang. If the constraints are changed to "=&t" and "t", then it works for clang but fails (with constraint and/or reload errors) with gcc. Bruce