Home | History | Annotate | Download | only in Utils

Lines Matching full:divisor

34 static Value *generateSignedRemainderCode(Value *Dividend, Value *Divisor,
50 // ; %divisor_sgn = ashr i32 %divisor, 31
52 // ; %dvs_xor = xor i32 %divisor, %divisor_sgn
55 // ; %urem = urem i32 %dividend, %divisor
59 Value *DivisorSign = Builder.CreateAShr(Divisor, Shift);
61 Value *DvsXor = Builder.CreateXor(Divisor, DivisorSign);
80 static Value *generatedUnsignedRemainderCode(Value *Dividend, Value *Divisor,
82 // Remainder = Dividend - Quotient*Divisor
86 // ; %quotient = udiv i32 %dividend, %divisor
87 // ; %product = mul i32 %divisor, %quotient
89 Value *Quotient = Builder.CreateUDiv(Dividend, Divisor);
90 Value *Product = Builder.CreateMul(Divisor, Quotient);
104 static Value *generateSignedDivisionCode(Value *Dividend, Value *Divisor,
122 // ; %tmp1 = ashr i32 %divisor, 31
125 // ; %tmp3 = xor i32 %tmp1, %divisor
132 Value *Tmp1 = Builder.CreateAShr(Divisor, Shift);
135 Value *Tmp3 = Builder.CreateXor(Tmp1, Divisor);
151 static Value *generateUnsignedDivisionCode(Value *Dividend, Value *Divisor,
236 // First off, check for special cases: dividend or divisor is zero, divisor
237 // is greater than dividend, and divisor is 1.
239 // ; %ret0_1 = icmp eq i32 %divisor, 0
242 // ; %tmp0 = tail call i32 @llvm.ctlz.i32(i32 %divisor, i1 true)
252 Value *Ret0_1 = Builder.CreateICmpEQ(Divisor, Zero);
255 Value *Tmp0 = Builder.CreateCall(CTLZ, {Divisor, True});
280 // ; %tmp4 = add i32 %divisor, -1
284 Value *Tmp4 = Builder.CreateAdd(Divisor, NegOne);
300 // ; %tmp11 = and i32 %tmp10, %divisor
318 Value *Tmp11 = Builder.CreateAnd(Tmp10, Divisor);