Lines Matching refs:Op
150 ComplexPairTy EmitCast(CastKind CK, Expr *Op, QualType DestTy);
235 ComplexPairTy EmitBinAdd(const BinOpInfo &Op);
236 ComplexPairTy EmitBinSub(const BinOpInfo &Op);
237 ComplexPairTy EmitBinMul(const BinOpInfo &Op);
238 ComplexPairTy EmitBinDiv(const BinOpInfo &Op);
241 const BinOpInfo &Op);
423 ComplexPairTy ComplexExprEmitter::EmitCast(CastKind CK, Expr *Op,
428 // Atomic to non-atomic casts may be more than a no-op for some platforms and
435 return Visit(Op);
438 LValue origLV = CGF.EmitLValue(Op);
441 return EmitLoadOfLValue(CGF.MakeAddrLValue(V, DestTy), Op->getExprLoc());
491 return EmitScalarToComplexCast(CGF.EmitScalarExpr(Op), Op->getType(),
492 DestTy, Op->getExprLoc());
498 return EmitComplexToComplexCast(Visit(Op), Op->getType(), DestTy,
499 Op->getExprLoc());
508 ComplexPairTy Op = Visit(E->getSubExpr());
511 if (Op.first->getType()->isFloatingPointTy()) {
512 ResR = Builder.CreateFNeg(Op.first, "neg.r");
513 ResI = Builder.CreateFNeg(Op.second, "neg.i");
515 ResR = Builder.CreateNeg(Op.first, "neg.r");
516 ResI = Builder.CreateNeg(Op.second, "neg.i");
525 ComplexPairTy Op = Visit(E->getSubExpr());
527 if (Op.second->getType()->isFloatingPointTy())
528 ResI = Builder.CreateFNeg(Op.second, "conj.i");
530 ResI = Builder.CreateNeg(Op.second, "conj.i");
532 return ComplexPairTy(Op.first, ResI);
535 ComplexPairTy ComplexExprEmitter::EmitBinAdd(const BinOpInfo &Op) {
538 if (Op.LHS.first->getType()->isFloatingPointTy()) {
539 ResR = Builder.CreateFAdd(Op.LHS.first, Op.RHS.first, "add.r");
540 if (Op.LHS.second && Op.RHS.second)
541 ResI = Builder.CreateFAdd(Op.LHS.second, Op.RHS.second, "add.i");
543 ResI = Op.LHS.second ? Op.LHS.second : Op.RHS.second;
546 ResR = Builder.CreateAdd(Op.LHS.first, Op.RHS.first, "add.r");
547 assert(Op.LHS.second && Op.RHS.second &&
549 ResI = Builder.CreateAdd(Op.LHS.second, Op.RHS.second, "add.i");
554 ComplexPairTy ComplexExprEmitter::EmitBinSub(const BinOpInfo &Op) {
556 if (Op.LHS.first->getType()->isFloatingPointTy()) {
557 ResR = Builder.CreateFSub(Op.LHS.first, Op.RHS.first, "sub.r");
558 if (Op.LHS.second && Op.RHS.second)
559 ResI = Builder.CreateFSub(Op.LHS.second, Op.RHS.second, "sub.i");
561 ResI = Op.LHS.second ? Op.LHS.second
562 : Builder.CreateFNeg(Op.RHS.second, "sub.i");
565 ResR = Builder.CreateSub(Op.LHS.first, Op.RHS.first, "sub.r");
566 assert(Op.LHS.second && Op.RHS.second &&
568 ResI = Builder.CreateSub(Op.LHS.second, Op.RHS.second, "sub.i");
575 const BinOpInfo &Op) {
577 Args.add(RValue::get(Op.LHS.first),
578 Op.Ty->castAs<ComplexType>()->getElementType());
579 Args.add(RValue::get(Op.LHS.second),
580 Op.Ty->castAs<ComplexType>()->getElementType());
581 Args.add(RValue::get(Op.RHS.first),
582 Op.Ty->castAs<ComplexType>()->getElementType());
583 Args.add(RValue::get(Op.RHS.second),
584 Op.Ty->castAs<ComplexType>()->getElementType());
596 4, Op.Ty->castAs<ComplexType>()->getElementType());
597 QualType FQTy = CGF.getContext().getFunctionType(Op.Ty, ArgsQTys, EPI);
634 ComplexPairTy ComplexExprEmitter::EmitBinMul(const BinOpInfo &Op) {
639 if (Op.LHS.first->getType()->isFloatingPointTy()) {
648 if (Op.LHS.second && Op.RHS.second) {
659 Value *AC = Builder.CreateFMul(Op.LHS.first, Op.RHS.first, "mul_ac");
660 Value *BD = Builder.CreateFMul(Op.LHS.second, Op.RHS.second, "mul_bd");
661 Value *AD = Builder.CreateFMul(Op.LHS.first, Op.RHS.second, "mul_ad");
662 Value *BC = Builder.CreateFMul(Op.LHS.second, Op.RHS.first, "mul_bc");
693 getComplexMultiplyLibCallName(Op.LHS.first->getType()), Op);
709 assert((Op.LHS.second || Op.RHS.second) &&
715 ResR = Builder.CreateFMul(Op.LHS.first, Op.RHS.first, "mul.rl");
717 ResI = Op.LHS.second
718 ? Builder.CreateFMul(Op.LHS.second, Op.RHS.first, "mul.il")
719 : Builder.CreateFMul(Op.LHS.first, Op.RHS.second, "mul.ir");
721 assert(Op.LHS.second && Op.RHS.second &&
723 Value *ResRl = Builder.CreateMul(Op.LHS.first, Op.RHS.first, "mul.rl");
724 Value *ResRr = Builder.CreateMul(Op.LHS.second, Op.RHS.second, "mul.rr");
727 Value *ResIl = Builder.CreateMul(Op.LHS.second, Op.RHS.first, "mul.il");
728 Value *ResIr = Builder.CreateMul(Op.LHS.first, Op.RHS.second, "mul.ir");
736 ComplexPairTy ComplexExprEmitter::EmitBinDiv(const BinOpInfo &Op) {
737 llvm::Value *LHSr = Op.LHS.first, *LHSi = Op.LHS.second;
738 llvm::Value *RHSr = Op.RHS.first, *RHSi = Op.RHS.second;
749 BinOpInfo LibCallOp = Op;
777 assert(Op.LHS.second && Op.RHS.second &&
792 if (Op.Ty->castAs<ComplexType>()->getElementType()->isUnsignedIntegerType()) {
1083 static CompoundFunc getComplexOp(BinaryOperatorKind Op) {
1084 switch (Op) {
1096 CompoundFunc Op = getComplexOp(E->getOpcode());
1098 return ComplexExprEmitter(*this).EmitCompoundAssignLValue(E, Op, Val);
1104 CompoundFunc Op = getComplexOp(E->getOpcode());
1106 LValue Ret = ComplexExprEmitter(*this).EmitCompoundAssignLValue(E, Op, Val);