• Home
  • Raw
  • Download

Lines Matching refs:right

31                                                            const Expression& right) {  in eliminate_no_op_boolean()  argument
32 SkASSERT(right.is<BoolLiteral>()); in eliminate_no_op_boolean()
33 bool rightVal = right.as<BoolLiteral>().value(); in eliminate_no_op_boolean()
50 const Expression& right) { in short_circuit_boolean() argument
63 return eliminate_no_op_boolean(right, op, left); in short_circuit_boolean()
74 const Expression& right) { in simplify_vector() argument
76 SkASSERT(left.type() == right.type()); in simplify_vector()
83 switch (left.compareConstant(right)) { in simplify_vector()
103 right.getConstantSubexpression(i)->as<Literal<T>>().value()); in simplify_vector()
190 const Expression& right) { in ErrorOnDivideByZero() argument
196 if (contains_constant_zero(right)) { in ErrorOnDivideByZero()
248 const Expression& right, in simplify_no_op_arithmetic() argument
252 if (is_constant_value(right, 0.0)) { // x + 0 in simplify_no_op_arithmetic()
256 return cast_expression(context, right, resultType); in simplify_no_op_arithmetic()
261 if (is_constant_value(right, 1.0)) { // x * 1 in simplify_no_op_arithmetic()
265 return cast_expression(context, right, resultType); in simplify_no_op_arithmetic()
267 if (is_constant_value(right, 0.0) && !left.hasSideEffects()) { // x * 0 in simplify_no_op_arithmetic()
268 return cast_expression(context, right, resultType); in simplify_no_op_arithmetic()
270 if (is_constant_value(left, 0.0) && !right.hasSideEffects()) { // 0 * x in simplify_no_op_arithmetic()
276 if (is_constant_value(right, 0.0)) { // x - 0 in simplify_no_op_arithmetic()
281 cast_expression(context, right, resultType)); in simplify_no_op_arithmetic()
286 if (is_constant_value(right, 1.0)) { // x / 1 in simplify_no_op_arithmetic()
290 !is_constant_value(right, 0.0) && in simplify_no_op_arithmetic()
291 !right.hasSideEffects()) { // 0 / x (where x is not 0) in simplify_no_op_arithmetic()
298 if (is_constant_value(right, 0.0)) { // x += 0, x -= 0 in simplify_no_op_arithmetic()
307 if (is_constant_value(right, 1.0)) { // x *= 1, x /= 1 in simplify_no_op_arithmetic()
329 const Expression* right; in Simplify() local
332 right = GetConstantValueForVariable(rightExpr); in Simplify()
335 right = &rightExpr; in Simplify()
341 return right->clone(); in Simplify()
347 if (op.kind() == Token::Kind::TK_EQ && Analysis::IsSameExpressionTree(*left, *right)) { in Simplify()
348 return right->clone(); in Simplify()
352 if (left->is<BoolLiteral>() && right->is<BoolLiteral>()) { in Simplify()
354 bool rightVal = right->as<BoolLiteral>().value(); in Simplify()
369 return short_circuit_boolean(*left, op, *right); in Simplify()
373 if (right->is<BoolLiteral>()) { in Simplify()
377 return short_circuit_boolean(*right, op, *left); in Simplify()
381 return eliminate_no_op_boolean(*left, op, *right); in Simplify()
384 if (op.kind() == Token::Kind::TK_EQEQ && Analysis::IsSameExpressionTree(*left, *right)) { in Simplify()
390 if (op.kind() == Token::Kind::TK_NEQ && Analysis::IsSameExpressionTree(*left, *right)) { in Simplify()
396 if (ErrorOnDivideByZero(context, offset, op, *right)) { in Simplify()
402 const Type& rightType = right->type(); in Simplify()
405 std::unique_ptr<Expression> expr = simplify_no_op_arithmetic(context, *left, op, *right, in Simplify()
413 if (!left->isCompileTimeConstant() || !right->isCompileTimeConstant()) { in Simplify()
424 if (left->is<IntLiteral>() && right->is<IntLiteral>()) { in Simplify()
426 SKSL_INT rightVal = right->as<IntLiteral>().value(); in Simplify()
473 if (left->is<FloatLiteral>() && right->is<FloatLiteral>()) { in Simplify()
475 SKSL_FLOAT rightVal = right->as<FloatLiteral>().value(); in Simplify()
494 return simplify_vector<SKSL_FLOAT>(context, *left, op, *right); in Simplify()
497 return simplify_vector<SKSL_INT, SKSL_UINT>(context, *left, op, *right); in Simplify()
506 splat_scalar(*right, left->type())); in Simplify()
510 splat_scalar(*right, left->type())); in Simplify()
518 return simplify_vector<SKSL_FLOAT>(context, splat_scalar(*left, right->type()), op, in Simplify()
519 *right); in Simplify()
522 return simplify_vector<SKSL_INT, SKSL_UINT>(context, splat_scalar(*left, right->type()), in Simplify()
523 op, *right); in Simplify()
543 switch (left->compareConstant(*right)) { in Simplify()