[macstl-dev] gcc 3.3 on YellowDogLinux
Michael LeBlanc
leblanc at skycomputers.com
Mon Mar 28 20:59:54 WST 2005
That almost works. I think I never tried removing the outer ()-s. I'm
using
typedef __vector unsigned int generator_returns;
template <unsigned int v0, unsigned int v1, unsigned
int v2, unsigned int v3>
struct generator
{
generator_returns
operator() () const
Cross your fingers. I think that leaves one issue!
/usrb/leblanc/macstl/macstl/impl/vec_altivec.h: In function `
macstl::vec<unsigned int, 4>
macstl::altivec::impl::estimate_divide(const
macstl::vec<unsigned int, 4>&, const macstl::vec<unsigned int, 4>&)':
/usrb/leblanc/macstl/macstl/impl/vec_altivec.h:1263: error: conversion
from `
const macstl::vec<int, 4>' to non-scalar type `
macstl::vec<macstl::boolean<int>, 4>' requested
This, and others like it, are caused by my "fencing" a few bool things.
Recall that GCC stomps on the keyword bool in altivec.h by making it a
macro.
#ifndef MACSTL_BOOL_IS_SIGNED
template <> struct data_vec <__vector bool char>
{ typedef vec <boolean <char>, 16> type; };
template <> struct data_vec <__vector bool short>
{ typedef vec <boolean <short>, 8> type; };
template <> struct data_vec <__vector bool int>
{ typedef vec <boolean <int>, 4> type; };
template <> struct data_vec <__vector pixel>
{ typedef vec <pixel, 8> type; };
#endif
Any ideas?
On Mar 27, 2005, at 1:07 PM, Glen Low wrote:
> That looks good, however it would make all the explicit
> specializations of generator into partial specializations, which may
> in turn slow the compiler down.
>
> Is it at all possible to compile
>
> __vector unsigned char zz = (__vector unsigned char) generator <0> ()
> (); // declared "template <unsigned int v0> struct generator"
>
> The compiler should parse this as a cast to vector of the result of
> generator <0> () () -- and not having any brackets around generator
> <0> () () it should not think it is a vector initialization.
>
> If that doesn't work, looks like we will go with your suggestion.
More information about the macstl-dev
mailing list