On Fri, Jun 26, 2009 at 11:22 AM, Nate Begeman<[email protected]> wrote:
> -  // Check for vector->vector bitcast.
> -  if (SE->getType()->isVectorType())
> +  // Check for vector->vector bitcast and scalar->vector splat.
> +  if (SETy->isVectorType()) {
>     return this->Visit(const_cast<Expr*>(SE));
> +  } else if (SETy->isIntegerType()) {
> +    APSInt IntResult;
> +    if (EvaluateInteger(SE, IntResult, Info))
> +      Result = APValue(IntResult);
> +  } else if (SETy->isRealFloatingType()) {
> +    APFloat F(0.0);
> +    if (EvaluateFloat(SE, F, Info))
> +      Result = APValue(F);
> +  }
>
> -  return APValue();
> +  if (Result.isInt() || Result.isFloat()) {
> +    unsigned NumElts = E->getType()->getAsVectorType()->getNumElements();
> +    llvm::SmallVector<APValue, 4> Elts(NumElts, Result);
> +    Result = APValue(&Elts[0], Elts.size());
> +  }
> +  return Result;
>  }

This code looks a little suspicious; does it handle stuff like "v2f32
x = (v2f32)4LL;" correctly?

-Eli

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to