[PATCH] Support for floating point vector logical operations

Tanya Lattner lattner at apple.com
Tue Feb 12 14:22:58 PST 2013


1) Use, isFPOrFPVectorTy() instead of getScalarType()->isFloatingPointTy()
2) Why are you removing the newline at the start of the functions?
3) // OpenCL v1.1 s6.3.f/g/h, add very short description of what the rule your are checking is.
4) I'm not sure this patch is complete. I get errors when I run your test cases. 

error: 'error' diagnostics seen but not expected: 
  Line 27: can't convert between vector values of different size ('float4' and 'int')
  Line 27: invalid operands to binary expression ('float4' and 'int')
  Line 28: can't convert between vector values of different size ('float4' and 'int')
  Line 28: invalid operands to binary expression ('float4' and 'int')
  Line 29: redefinition of 'f4baf'
  Line 30: redefinition of 'f4bof'
error: 'note' diagnostics seen but not expected: 
  Line 24: previous definition is here
  Line 25: previous definition is here
8 errors generated.

I think you are missing some logic in Sema when checking vector operands.  I can integrate this with your changes if you want. Its actually from a previous proposed patch that didn't make it into mainline yet. 

5) I think you should add test cases for double as well. 

-Tanya





On Feb 8, 2013, at 9:10 AM, Joey Gouly <joey.gouly at arm.com> wrote:

> Hi all!
> 
> This patch adds support for floating point logical operations for OpenCL
> 1.2, and errors for OpenCL 1.1.
> 
> VisitUnaryLNot, VisitBinLAnd and VisitBinLOr were changed to support
> floating point types.
> 
> In lib/Sema/SemaExpr.cpp, CheckVectorLogicalOperands, there was a line:
>> if (vType.isNull() || vType->isFloatingType())
> I don't think the isFloatingType() could ever be true, since the type from
> CheckVectorOperands would always be a VectorType?
> I removed this part, and did a build/test and nothing failed, so I think it
> was dead code.
> 
> Any comments?
> 
> Thanks,
> Joey<logical_ops.diff>_______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130212/e58fac2d/attachment.html>


More information about the cfe-commits mailing list