forked from M-Labs/nac3
nac3core: use round instead of rint. Closes #61
This commit is contained in:
parent
3a1dd893a1
commit
fd0b11087e
@ -228,10 +228,10 @@ impl TopLevelComposer {
|
||||
codegen_callback: Some(Arc::new(GenCall::new(Box::new(|ctx, _, _, args| {
|
||||
let arg = args[0].1;
|
||||
let round_intrinsic =
|
||||
ctx.module.get_function("llvm.rint.f64").unwrap_or_else(|| {
|
||||
ctx.module.get_function("llvm.round.f64").unwrap_or_else(|| {
|
||||
let float = ctx.ctx.f64_type();
|
||||
let fn_type = float.fn_type(&[float.into()], false);
|
||||
ctx.module.add_function("llvm.rint.f64", fn_type, None)
|
||||
ctx.module.add_function("llvm.round.f64", fn_type, None)
|
||||
});
|
||||
let val = ctx
|
||||
.builder
|
||||
@ -265,10 +265,10 @@ impl TopLevelComposer {
|
||||
codegen_callback: Some(Arc::new(GenCall::new(Box::new(|ctx, _, _, args| {
|
||||
let arg = args[0].1;
|
||||
let round_intrinsic =
|
||||
ctx.module.get_function("llvm.rint.f64").unwrap_or_else(|| {
|
||||
ctx.module.get_function("llvm.round.f64").unwrap_or_else(|| {
|
||||
let float = ctx.ctx.f64_type();
|
||||
let fn_type = float.fn_type(&[float.into()], false);
|
||||
ctx.module.add_function("llvm.rint.f64", fn_type, None)
|
||||
ctx.module.add_function("llvm.round.f64", fn_type, None)
|
||||
});
|
||||
let val = ctx
|
||||
.builder
|
||||
|
Loading…
Reference in New Issue
Block a user