From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11017 invoked by alias); 10 Aug 2010 23:34:28 -0000 Received: (qmail 11008 invoked by uid 22791); 10 Aug 2010 23:34:28 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Aug 2010 23:34:24 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7ANYG57024525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 10 Aug 2010 19:34:17 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7ANYEVu019422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Aug 2010 19:34:16 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o7ANYENB014641; Wed, 11 Aug 2010 01:34:14 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o7ANYCht014640; Wed, 11 Aug 2010 01:34:12 +0200 Date: Tue, 10 Aug 2010 23:34:00 -0000 From: Jan Kratochvil To: Ken Werner Cc: gdb-patches@sourceware.org Subject: Re: [patch] GNU vector binop support Message-ID: <20100810233412.GA12832@host1.dyn.jankratochvil.net> References: <201008101124.22450.ken@linux.vnet.ibm.com> <201008101401.39991.ken@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008101401.39991.ken@linux.vnet.ibm.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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: 2010-08/txt/msg00136.txt.bz2 On Tue, 10 Aug 2010 14:01:39 +0200, Ken Werner wrote: > +struct value * > +vector_binop (struct value *val1, struct value *val2, enum exp_opcode op) > +{ [...] > + elsize = TYPE_LENGTH (eltype1); > + n = TYPE_LENGTH (type1) / elsize; > + val = allocate_value (type1); > + > + mark = value_mark (); > + for (i = 0; i < n; i++) > + { > + tmp = value_binop (value_subscript (val1, i), > + value_subscript (val2, i), op); There is no check whether VAL1 and VAL2 are vectors of the same length (such as the number of elements, even if the element size is the same). Thanks, Jan