From 7f0e6ea654037eda11c2e84946f99bad3f1ab6e4 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Wed, 26 Jul 2023 00:48:43 -0400 Subject: Division fixes --- tnslc/tnslc.tnsl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tnslc/tnslc.tnsl') diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl index 5c1e6f9..772897e 100644 --- a/tnslc/tnslc.tnsl +++ b/tnslc/tnslc.tnsl @@ -1258,8 +1258,11 @@ ;data`.csec = string_join( { data`.csec, "\tmov ", get_reg(0, sz), ", ", self.norm_loc(sz), "\n", - "\tmov ", get_reg(3, sz), ", ", v.norm_loc(sz), "\n", - "\t", op, " ", get_reg(3, sz), "\n", + "\txor rdx, rdx\n", + "\tpush rsi\n", + "\tmov ", get_reg(4, sz), ", ", v.norm_loc(sz), "\n", + "\t", op, " ", get_reg(4, sz), "\n", + "\tpop rsi\n", "\tmov ", self.norm_loc(sz), ", ", get_reg(keep, sz), "\n" }, "") ;/ @@ -1784,7 +1787,7 @@ /; new_tmp_var (Type t, ~CompData out) [Variable] ;Variable new = {"##tmp", t, 0, 0} ;new.loc_type = LOCATION.STACK - ;new.location = self.get_full_tmp_stack() + self.tmp + new.norm_size() + ;new.location = self.get_full_tmp_stack() + new.norm_size() ;self.tmp = self.tmp + new.norm_size() ;out`.csec = string_join( { out`.csec, -- cgit v1.2.3