public void caseCastExpr(CastExpr arg0) { Type cast_type = arg0.getCastType(); OpenCLType ocl_type = new OpenCLType(cast_type); m_output.append("(" + ocl_type.getCudaTypeString() + ") "); Value rhs = arg0.getOp(); rhs.apply(this); }
public void caseUshrExpr(UshrExpr arg0) { m_output.append("("); arg0.getOp1().apply(this); m_output.append(" >> "); arg0.getOp2().apply(this); m_output.append(" ) & "); OpenCLType lhs_ocl_type = new OpenCLType(arg0.getOp1().getType()); OpenCLType rhs_ocl_type = new OpenCLType(arg0.getOp2().getType()); int max_size = lhs_ocl_type.getSize(); if (rhs_ocl_type.getSize() > max_size) { max_size = rhs_ocl_type.getSize(); } String mask = ""; switch (max_size) { case 1: mask = "0x7f"; break; case 2: mask = "0x7fff"; break; case 4: mask = "0x7fffffff"; break; case 8: mask = "0x7fffffffffffffffL"; break; } m_output.append(mask); }