From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15491 invoked by alias); 29 Nov 2012 17:50:17 -0000 Received: (qmail 15291 invoked by uid 22791); 29 Nov 2012 17:50:02 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,MSGID_FROM_MTA_HEADER,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 17:49:57 +0000 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Nov 2012 17:49:54 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 29 Nov 2012 17:49:39 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qATHnV5W64422062 for ; Thu, 29 Nov 2012 17:49:31 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qATHncFW030821 for ; Thu, 29 Nov 2012 10:49:38 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id qATHnbBM030788; Thu, 29 Nov 2012 10:49:37 -0700 Message-Id: <201211291749.qATHnbBM030788@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Thu, 29 Nov 2012 18:49:36 +0100 Subject: Re: [PATCH] Vector to scalar casting and widening To: aburgess@broadcom.com (Andrew Burgess) Date: Thu, 29 Nov 2012 17:50:00 -0000 From: "Ulrich Weigand" Cc: tromey@redhat.com, gdb-patches@sourceware.org, ken@linux.vnet.ibm.com In-Reply-To: <50B68B43.8080106@broadcom.com> from "Andrew Burgess" at Nov 28, 2012 10:08:03 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit x-cbid: 12112917-1948-0000-0000-000003A86C32 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00884.txt.bz2 Andrew Burgess wrote: > On 26/11/2012 2:18 PM, Ulrich Weigand wrote: > > Thus, I'd prefer a patch that: > > - changes the default behaviour of value_cast etc. to the GCC behaviour, and > > - adds handling of UNOP_CAST etc. to evaluate_subexp_opencl to implement the > > OpenCL semantics. > > The latest patch below is is closer to the initial patch I posted, the > behaviour of value_cast now follows GCC, and the UNOP_CAST case is handled > in evaluate_subexp_opencl. I wasn't sure what the "etc" in the above point > referred to, I believe UNOP_CAST is all I need to catch, let me know if I've > missed anything. Well, there's the whole "vector scalar" issue; with your patch, this is now only supported if the scalar type is widened, and rejected if it is truncated. This does not correspond to OpenCL semantics, where truncation is explicitly supported. Another problem: in several places in opencl-lang.c, the code calls value_cast with the explicit assumption that this will splat a scalar across all vector components. Those uses would now have to be changed to a value_cast/value_vector_widen pair, I guess. > > Unfortunately the only environment I know of to test the GDB OpenCL support > > is the IBM OpenCL SDK for PowerPC. I'll be happy to run the test for you ... > > I've built and tested on x86-64 GNU/Linux, but I've not run any OpenCL tests. If > you were able to give this patch a go and let me know if I've broken any of the > OpenCL tests I'd be very grateful. As expected, given the above, a whole bunch of tests fail ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com