<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>I'm just rereading M3C.m3, cleaning stuff up.</div><div><br></div><div>I'm looking at copy_n.</div><div><br></div><div>It takes a type to copy and a count of that type, on the stack.</div><div>I have to multiply by the byte size of the type and call memcpy or memmove.</div><div><br></div><div><br></div><div>I'm curious how to handle the count, and converting it for the multiplication and pass of to memcpy/memmove.</div><div>I would rather like to assume it is always Target.Word.cg_type.</div><div><br></div><div>The only pass the frontend calls copy_n is here:</div><div> cg.copy_n (Target.Integer.cg_type, t, overlap);</div><div><br></div><div><br></div><div>Is that really intended?</div><div><br></div><div><br></div><div>Am I supposed to output a runtime check that the value is positive?</div><div><br></div><div><br></div><div>Similarly nearby in the frontend, in Copy_n:</div><div><div> cg.div (Target.Integer.cg_type, Sign.Positive, Sign.Positive);</div></div><div><br></div><div><br></div><div>Might as well that be Target.Word.cg_type?</div><div><br></div><div><br></div><div>(My meta-point is I still believe signed types over used, both in a lot of C code and definitely in Modula-3.</div><div>And CARDINAL doesn't really cut it -- unsigned types shouldn't have their range cut in half..)<br><br></div><div><br></div><div> - Jay</div> </div></body>
</html>