Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vsipl++] Re: [vsipl++-csl] [patch] Vector assignment, sarsim bits


  • To: Stefan Seefeld <stefan@xxxxxxxxxxxxxxxx>
  • Subject: Re: [vsipl++] Re: [vsipl++-csl] [patch] Vector assignment, sarsim bits
  • From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Date: Mon, 26 Sep 2005 12:58:53 -0700

Stefan Seefeld wrote:
> Mark Mitchell wrote:
> 
>> A conforming compiler is required to promote to int.  See [expr]/9:
>> "Otherwise, the integral promotions shall be performed on both
>> operands".  There's nothing special about "^"; the usual arithmetic
>> conversions are applied to all operands of arithmetic binary operators,
>> like +, -, *, etc., and, as a result, the type of such expressions is
>> always at least as wide as "int".
> 
> 
> Considering this logic, I'm wondering why the VSIPL++ specs require
> two distinct versions of operator^, one doing a binary and the other
> a logical xor, depending on the operands having type bool or not.
> Isn't that inconsistent with the above ?

I'm sure that comes from VSIPL, but I'm not sure exactly why.  Perhaps
in VSIPL, "a lxor b" works even if "a" and "b" are of type "int"; i.e.,
maybe "a lxor b" is the C++ operation "bool(bool(a) ^ bool(b))".

-- 
Mark Mitchell
CodeSourcery, LLC
mark@xxxxxxxxxxxxxxxx
(916) 791-8304