Lines Matching refs:right
31 const Expression& right) {
32 bool rightVal = right.as<Literal>().boolValue();
49 const Expression& right) {
59 // We can't eliminate the right-side expression via short-circuit, but we might still be able to
61 return eliminate_no_op_boolean(right, op, left);
67 const Expression& right) {
71 switch (left.compareConstant(right)) {
89 const Expression& right) {
91 SkASSERT(left.type() == right.type());
95 if (std::unique_ptr<Expression> result = simplify_vector_equality(context, left, op, right)) {
121 double value = foldFn(*left.getConstantValue(i), *right.getConstantValue(i));
180 const Expression& right) {
186 if (contains_constant_zero(right)) {
234 const Expression& right,
238 if (is_constant_value(right, 0.0)) { // x + 0
242 return cast_expression(context, right, resultType);
247 if (is_constant_value(right, 1.0)) { // x * 1
251 return cast_expression(context, right, resultType);
253 if (is_constant_value(right, 0.0) && !left.hasSideEffects()) { // x * 0
254 return cast_expression(context, right, resultType);
256 if (is_constant_value(left, 0.0) && !right.hasSideEffects()) { // 0 * x
262 if (is_constant_value(right, 0.0)) { // x - 0
266 if (std::unique_ptr<Expression> val = cast_expression(context, right, resultType)) {
273 if (is_constant_value(right, 1.0)) { // x / 1
280 if (is_constant_value(right, 0.0)) { // x += 0, x -= 0
290 if (is_constant_value(right, 1.0)) { // x *= 1, x /= 1
341 const Expression* right = GetConstantValueForVariable(rightExpr);
346 return right->clone();
352 if (op.kind() == Token::Kind::TK_EQ && Analysis::IsSameExpressionTree(*left, *right)) {
353 return right->clone();
357 if (left->isBoolLiteral() && right->isBoolLiteral()) {
359 bool rightVal = right->as<Literal>().boolValue();
374 return short_circuit_boolean(*left, op, *right);
377 // If the right side is a Boolean literal...
378 if (right->isBoolLiteral()) {
382 return short_circuit_boolean(*right, op, *left);
386 return eliminate_no_op_boolean(*left, op, *right);
389 if (op.kind() == Token::Kind::TK_EQEQ && Analysis::IsSameExpressionTree(*left, *right)) {
395 if (op.kind() == Token::Kind::TK_NEQ && Analysis::IsSameExpressionTree(*left, *right)) {
401 if (error_on_divide_by_zero(context, line, op, *right)) {
407 const Type& rightType = right->type();
410 std::unique_ptr<Expression> expr = simplify_no_op_arithmetic(context, *left, op, *right,
418 if (!left->isCompileTimeConstant() || !right->isCompileTimeConstant()) {
426 if (left->isIntLiteral() && right->isIntLiteral()) {
428 SKSL_INT rightVal = right->as<Literal>().intValue();
482 if (left->isFloatLiteral() && right->isFloatLiteral()) {
484 SKSL_FLOAT rightVal = right->as<Literal>().floatValue();
506 return simplify_vector(context, *left, op, *right);
509 return simplify_vector(context, *left, op, *right);
512 return simplify_vector_equality(context, *left, op, *right);
520 return simplify_vector(context, *left, op, ConstructorSplat(*right, left->type()));
523 return simplify_vector(context, *left, op, ConstructorSplat(*right, left->type()));
527 ConstructorSplat(*right, left->type()));
535 return simplify_vector(context, ConstructorSplat(*left, right->type()), op, *right);
538 return simplify_vector(context, ConstructorSplat(*left, right->type()), op, *right);
541 return simplify_vector_equality(context, ConstructorSplat(*left, right->type()),
542 op, *right);
562 switch (left->compareConstant(*right)) {