MCPcopy Create free account
hub / github.com/google/gapid / Mul

Method Mul

core/codegen/arithmetic.go:192–203  ·  view source on GitHub ↗

Mul returns x * y. The types of the two values must be equal.

(x, y *Value)

Source from the content-addressed store, hash-verified

190
191// Mul returns x * y. The types of the two values must be equal.
192func (b *Builder) Mul(x, y *Value) *Value {
193 assertTypesEqual(x.Type(), y.Type())
194 ty := Scalar(x.Type())
195 switch {
196 case IsInteger(ty):
197 return b.val(x.Type(), b.llvm.CreateMul(x.llvm, y.llvm, x.Name()+"*"+y.Name()))
198 case IsFloat(ty):
199 return b.val(x.Type(), b.llvm.CreateFMul(x.llvm, y.llvm, x.Name()+"*"+y.Name()))
200 default:
201 panic(fmt.Errorf("Cannot multiply values of type %v", ty))
202 }
203}
204
205// MulS returns x * y. The types of the two values must be equal.
206func (b *Builder) MulS(x *Value, y interface{}) *Value {

Callers 12

MulSMethod · 0.95
copyMethod · 0.80
sliceAssignMethod · 0.80
doCastMethod · 0.80
doBinaryOpMethod · 0.80
makeMethod · 0.80
pointerRangeMethod · 0.80
sliceIndexMethod · 0.80
buildBufferFuncsMethod · 0.80
AllocMethod · 0.80
ReallocMethod · 0.80
observedMethod · 0.80

Calls 7

valMethod · 0.95
assertTypesEqualFunction · 0.85
ScalarFunction · 0.85
IsFloatFunction · 0.85
IsIntegerFunction · 0.70
TypeMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected