From 9edb2b8dbd99636cf2d98d3253a0316f74720894 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Sun, 10 Aug 2025 02:03:50 +0200 Subject: Instruction selection for multiplication and division --- il.fun | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'il.fun') diff --git a/il.fun b/il.fun index bfe2fb0..fb549d3 100644 --- a/il.fun +++ b/il.fun @@ -404,7 +404,7 @@ functor IL(P: PARSER) = struct (if onStack then Addr else Reg) id end - fun getOffset ea field = #1 $ valOf $ P.getFieldInfo (P.getT ea) field + fun getOffset t field = #1 $ valOf $ P.getFieldInfo t field fun computeFieldFromVReg ctx v offset = let @@ -418,7 +418,7 @@ functor IL(P: PARSER) = struct fun convFieldAccessByV ctx ea field: ev = let val v: ev = convExpr ctx ea - val offset = getOffset ea field + val offset = getOffset (P.getT ea) field in case v of Addr v => computeFieldFromVReg ctx v offset @@ -429,7 +429,8 @@ functor IL(P: PARSER) = struct let val v = convExpr ctx ea - val offset = getOffset ea field + val () = printfn `"TYPE: " P.Pctype (P.getT ea) % + val offset = getOffset (P.pointsTo $ P.getT ea)field in case v of Reg v => computeFieldFromVReg ctx v offset -- cgit v1.2.3