Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: mitchalsup@aol.com (MitchAlsup1) Newsgroups: comp.arch Subject: Re: 80286 protected mode Date: Sat, 12 Oct 2024 18:32:48 +0000 Organization: Rocksolid Light Message-ID: References: <2024Oct6.150415@mips.complang.tuwien.ac.at> <2024Oct7.093314@mips.complang.tuwien.ac.at> <7c8e5c75ce0f1e7c95ec3ae4bdbc9249@www.novabbs.org> <2024Oct8.092821@mips.complang.tuwien.ac.at> <73e776d6becb377b484c5dcc72b526dc@www.novabbs.org> <2b31e1343b1f3fadd55ad6b87d879b78@www.novabbs.org> <35cb536e6310a38f0269788881cffdaf@www.novabbs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="1738784"; mail-complaints-to="usenet@i2pn2.org"; posting-account="o5SwNDfMfYu6Mv4wwLiW6e/jbA93UAdzFodw5PEa6eU"; User-Agent: Rocksolid Light X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Site: $2y$10$9ZCrn3rsWwapJ.CqlQTBd.5jzBer6Sio5fGBnsrnuCEUQhFXuXZxa X-Rslight-Posting-User: cb29269328a20fe5719ed6a1c397e21f651bda71 Bytes: 2563 Lines: 35 On Sat, 12 Oct 2024 5:06:05 +0000, Brett wrote: > MitchAlsup1 wrote: >> On Fri, 11 Oct 2024 12:10:13 +0000, David Brown wrote: >> >>> >>> Do you think you can just write this : >>> >>> void * memmove(void * s1, const void * s2, size_t n) >>> { >>> return memmove(s1, s2, n); >>> } >>> >>> in your library's source? >> >> .global memmove >> memmove: >> MM R2,R1,R3 >> RET >> >> sure ! >> > > Can R3 be a const, that causes issues for restartability, but branch > prediction is easier and the code is shorter. The 3rd Operand can, indeed, be a constant. That causes no restartability problem when you have a place to store the current count==index, so that when control returns and you re-execute MM, it sees that x amount has already been done, and C-X is left. > > Though I guess forwarding a const is probably a thing today to improve > branch prediction, which is normally HORRIBLE for short branch counts. That is what Predication is for.