forked from M-Labs/nac3
implement division
This commit is contained in:
parent
056b9631a0
commit
c5efa615a2
|
@ -222,6 +222,11 @@ impl<'ctx> CodeGen<'ctx> {
|
||||||
=> Ok(self.builder.build_float_sub(a, b, "tmpsub").into()),
|
=> Ok(self.builder.build_float_sub(a, b, "tmpsub").into()),
|
||||||
(Mult, values::BasicValueEnum::FloatValue(a), values::BasicValueEnum::FloatValue(b))
|
(Mult, values::BasicValueEnum::FloatValue(a), values::BasicValueEnum::FloatValue(b))
|
||||||
=> Ok(self.builder.build_float_mul(a, b, "tmpmul").into()),
|
=> Ok(self.builder.build_float_mul(a, b, "tmpmul").into()),
|
||||||
|
|
||||||
|
(Div, values::BasicValueEnum::FloatValue(a), values::BasicValueEnum::FloatValue(b))
|
||||||
|
=> Ok(self.builder.build_float_div(a, b, "tmpdiv").into()),
|
||||||
|
(FloorDiv, values::BasicValueEnum::IntValue(a), values::BasicValueEnum::IntValue(b))
|
||||||
|
=> Ok(self.builder.build_int_signed_div(a, b, "tmpdiv").into()),
|
||||||
_ => return Err(self.compile_error(CompileErrorKind::Unsupported("unimplemented operation"))),
|
_ => return Err(self.compile_error(CompileErrorKind::Unsupported("unimplemented operation"))),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue