fix f64 indexing, introduce bespoke F64Table type (#3065)
This commit is contained in:
@@ -1233,9 +1233,7 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
||||
let mut preprocessor = Preprocessor::new(settings);
|
||||
let clause = preprocessor.try_term_to_tl(self, term)?;
|
||||
|
||||
let f64_tbl = &LS::machine_st(&mut self.payload).arena.f64_tbl;
|
||||
|
||||
let mut cg = CodeGenerator::new(f64_tbl, settings);
|
||||
let mut cg = CodeGenerator::new(settings);
|
||||
let clause_code = cg.compile_predicate(vec![clause])?;
|
||||
|
||||
Ok(StandaloneCompileResult {
|
||||
@@ -1264,9 +1262,7 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
||||
clauses.push(preprocessor.try_term_to_tl(self, term)?);
|
||||
}
|
||||
|
||||
let f64_tbl = &LS::machine_st(&mut self.payload).arena.f64_tbl;
|
||||
|
||||
let mut cg = CodeGenerator::new(f64_tbl, settings);
|
||||
let mut cg = CodeGenerator::new(settings);
|
||||
let mut code = cg.compile_predicate(clauses)?;
|
||||
|
||||
if settings.is_extensible {
|
||||
|
||||
@@ -1413,7 +1413,7 @@ impl MachineState {
|
||||
}
|
||||
}
|
||||
(HeapCellValueTag::Cons | HeapCellValueTag::Fixnum | HeapCellValueTag::F64Offset) => {
|
||||
term_stack.push(Term::Literal(Cell::default(), Literal::try_from(addr).unwrap()));
|
||||
term_stack.push(Term::Literal(Cell::default(), Literal::try_from((addr, &self.arena.f64_tbl)).unwrap()));
|
||||
}
|
||||
(HeapCellValueTag::StackVar, h) => {
|
||||
term_stack.push(Term::Var(Cell::default(), VarPtr::from(format!("s_{h}"))));
|
||||
|
||||
@@ -25,7 +25,6 @@ use crate::machine::partial_string::*;
|
||||
use crate::machine::stack::*;
|
||||
use crate::machine::streams::*;
|
||||
use crate::machine::{get_structure_index, Machine, VERIFY_ATTR_INTERRUPT_LOC};
|
||||
use crate::offset_table::*;
|
||||
use crate::parser::ast::*;
|
||||
use crate::parser::char_reader::*;
|
||||
use crate::parser::dashu::Integer;
|
||||
@@ -1010,8 +1009,8 @@ impl MachineState {
|
||||
Ok(Term::Literal(_, Literal::Rational(n))) => {
|
||||
self.unify_rational(n, nx);
|
||||
}
|
||||
Ok(Term::Literal(_, Literal::F64Offset(n))) => {
|
||||
self.unify_f64(n, nx);
|
||||
Ok(Term::Literal(_, Literal::F64(offset, _n))) => {
|
||||
self.unify_f64(offset, nx);
|
||||
}
|
||||
Ok(Term::Literal(_, Literal::Integer(n))) => {
|
||||
self.unify_big_int(n, nx);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use crate::machine::Number;
|
||||
use crate::offset_table::OffsetTable;
|
||||
use crate::Machine;
|
||||
use ordered_float::OrderedFloat;
|
||||
use puruspe::beta::*;
|
||||
|
||||
Reference in New Issue
Block a user