Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: minforth Newsgroups: comp.lang.forth Subject: Re: 3dup again Date: Fri, 3 Oct 2025 11:09:07 +0200 Lines: 24 Message-ID: References: <2025Sep30.183350@mips.complang.tuwien.ac.at> <68de4aaa@news.ausics.net> <2025Oct2.224440@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 7WMSfiQMoGMDAiPDrYv1egOeD9MCs8e5VjxPc14kgu8q1lKi10 Cancel-Lock: sha1:Ry8KsVXSdDOq3UTXGMsopkxglMk= sha256:udbVNz8pLZBeZqFmvIAJR6wbG+D0qOhvTx46YPMzpSY= User-Agent: Mozilla Thunderbird In-Reply-To: Xref: csiph.com comp.lang.forth:134239 Am 03.10.2025 um 11:02 schrieb albert@spenarnc.xs4all.nl: > In article <2025Oct2.224440@mips.complang.tuwien.ac.at>, > Anton Ertl wrote: >> dxf writes: >>> For 3DUP I believe this is the one to beat: >>> >>> : 3DUP ( a b c -- a b c a b c ) dup 2over rot ; >>> >>> With NTF/LFX the locals version will break even. >> >> As we already discussed in the thread including >> <2021Sep11.083507@mips.complang.tuwien.ac.at>, NTF/LXF produces the >> same (optimal for the calling convention used by NTF/LXF) code for >> 3DUP versions using the data stack, return stack, or locals. That's >> because the actual data flow is always the same, and NTF/LXF can see >> this data flow in all three cases. > > The problem with 3DUP is that it is actually used in context. > What is the data that is going to 3DUP ped? In my view this > amounts to double use of data that is in registers (32 in the riscv) > anyway, after an optimiser does his thing. > Code inlining will mend it.