Mul returns x * y. The types of the two values must be equal.
(x, y *Value)
| 190 | |
| 191 | // Mul returns x * y. The types of the two values must be equal. |
| 192 | func (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. |
| 206 | func (b *Builder) MulS(x *Value, y interface{}) *Value { |
no test coverage detected