Lines Matching refs:Dividend
27 /// remainder, which will have the sign of the dividend. Builder's insert point
32 static Value *generateSignedRemainderCode(Value *Dividend, Value *Divisor,
36 // ; %dividend_sgn = ashr i32 %dividend, 31
38 // ; %dvd_xor = xor i32 %dividend, %dividend_sgn
42 // ; %urem = urem i32 %dividend, %divisor
45 Value *DividendSign = Builder.CreateAShr(Dividend, ThirtyOne);
47 Value *DvdXor = Builder.CreateXor(Dividend, DividendSign);
67 static Value *generatedUnsignedRemainderCode(Value *Dividend, Value *Divisor,
69 // Remainder = Dividend - Quotient*Divisor
71 // ; %quotient = udiv i32 %dividend, %divisor
73 // ; %remainder = sub i32 %dividend, %product
74 Value *Quotient = Builder.CreateUDiv(Dividend, Divisor);
76 Value *Remainder = Builder.CreateSub(Dividend, Product);
89 static Value *generateSignedDivisionCode(Value *Dividend, Value *Divisor,
95 // ; %tmp = ashr i32 %dividend, 31
97 // ; %tmp2 = xor i32 %tmp, %dividend
105 Value *Tmp = Builder.CreateAShr(Dividend, ThirtyOne);
107 Value *Tmp2 = Builder.CreateXor(Tmp, Dividend);
125 static Value *generateUnsignedDivisionCode(Value *Dividend, Value *Divisor,
193 // First off, check for special cases: dividend or divisor is zero, divisor
194 // is greater than dividend, and divisor is 1.
197 // ; %ret0_2 = icmp eq i32 %dividend, 0
200 // ; %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %dividend, i1 true)
205 // ; %retVal = select i1 %ret0, i32 0, i32 %dividend
210 Value *Ret0_2 = Builder.CreateICmpEQ(Dividend, Zero);
213 Value *Tmp1 = Builder.CreateCall2(CTLZi32, Dividend, True);
218 Value *RetVal = Builder.CreateSelect(Ret0, Zero, Dividend);
225 // ; %q = shl i32 %dividend, %tmp2
231 Value *Q = Builder.CreateShl(Dividend, Tmp2);
236 // ; %tmp3 = lshr i32 %dividend, %sr_1
240 Value *Tmp3 = Builder.CreateLShr(Dividend, SR_1);