🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #475

Re: interrupt handling latency and weird register use (was Re: OT: Epic RISC-V rant)

#475
From: Josh Vanderhoof
Date: Sat, 31 Oct 2026 05:02
68 lines
4472 bytes
MitchAlsup <user5857@newsgrouper.org.invalid> writes:

> Josh Vanderhoof <x@y.z> posted: 
> 
>> MitchAlsup <user5857@newsgrouper.org.invalid> writes:  
>> >> > Note to µArchitects, put the instruction in even if you 
>> >> > are  going to TRAP to SW emulation. Later on when DIV is 
>> >> > implemented it just runs faster and you had to do nothing 
>> >> > (but put it in).  
>> >>  You need to make it fast enough so that compilers are not  
>> >> tempted to call software emulation.  Also beware of 
>> >> interrput  latency,  
>> >  I am shooting at 10 cycles there and 10 cycles back.  
>>  Would it be possible to have a hardware version of polyfill? 
>> The  basic idea would be that instead of emulation via 
>> trapping, the  software calls a standardized divide routine. 
>> On hardware with a  divide instruction it checks the routine 
>> and if it sees it's the  standard divide routine it just uses 
>> its divide instruction  instead.  If it doesn't have hardware 
>> division it just runs the  divide routine. 
> 
> I do not see any justification of NOT having DIV as an 
> instruction and in HW (by means of some king of sequencer). In 
> the same way we can put 16 GBOoO cores on a single die with 
> 256-bit wide SIMD,  the amount of area saved not doing DIV is 
> invisible when seen at  the die-level. 
> 
> In the smallest conceivable implementations, DIV is a 
> multiplexer in the feedback-loop around the integer ADDer and a 
> 5-state sequencer. 
> 
> For me, I can't see building a core that does not have a 64×64 
> multiplier, either.  

I get that, but I'm not really talking about the necessity of 
divide instructions.  I'm talking about dealing with processors 
with different sets of features.

Say instead it's for something called featurex and some processors 
want it in hardware and some don't.  It'd be much easier for 
someone writing the software if a standard sequence of 
instructions for doing featurex was defined and new processors 
that do featurex in hardware automatically checked call targets 
and recognize when the instruction sequence matches featurex. 
Then when the routine is called later uses the dedicated 
instruction instead doing the call.

It's be really nice because the code would be identical for 
everything and also run about as fast as possible on everything. 
I have no idea how hard it would be to keep the track of which 
subroutines are actually new instructions though.

I'd much rather have something like this than have to write 
multiple versions of things depending on whether or not some CPUID 
bit is set.
 
>> I think I'd be more likely to use new instructions if they 
>> worked  this way, providing the standard polyfill routine in 
>> the  documentation for the new instruction.  The way things 
>> work now I  only use them after they've been around for a 
>> decade. 
> 
> I have no idea what you mean by polyfill. 

When they add new stuff to Javascript they provide equivalent code 
that works in older versions that's called "polyfill".  It's 
convenient because it lets you use the new API without needing 
alternate versions for older interpreters.
Technical Details
Message-ID: <ygnjymy5uo2.fsf@y.z>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx02.iad.POSTED!not-for-mail
References: <87qzk0nejz.fsf@nightsong.com> <116d89d$27baf$1@paganini.bofh.team> <87ecfcagiw.fsf_-_@debian> <2026Sep1.225146@mips.complang.tuwien.ac.at> <11bpfm8$190ap$1@dont-email.me> <2026Oct27.171414@mips.complang.tuwien.ac.at> <1793120789-5857@newsgrouper.org> <11bsq36$36q1t$3@paganini.bofh.team> <1793202439-5857@newsgrouper.org> <ygnwlr084yt.fsf@y.z> <1793320218-5857@newsgrouper.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx02.iad.POSTED!not-for-mail
From: Josh Vanderhoof <x@y.z>
Newsgroups: comp.arch
Subject: Re: interrupt handling latency and weird register use (was Re: OT: Epic RISC-V rant)
References: <87qzk0nejz.fsf@nightsong.com>
	<116d89d$27baf$1@paganini.bofh.team> <87ecfcagiw.fsf_-_@debian>
	<2026Sep1.225146@mips.complang.tuwien.ac.at>
	<11bpfm8$190ap$1@dont-email.me>
	<2026Oct27.171414@mips.complang.tuwien.ac.at>
	<1793120789-5857@newsgrouper.org> <11bsq36$36q1t$3@paganini.bofh.team>
	<1793202439-5857@newsgrouper.org> <ygnwlr084yt.fsf@y.z>
	<1793320218-5857@newsgrouper.org>
User-Agent: Gnus/5.13 (Gnus v5.13)
Reply-To: Josh Vanderhoof <jlv@mxsimulator.com>
Message-ID: <ygnjymy5uo2.fsf@y.z>
Cancel-Lock: sha1:va1uVGc2gqqox89WflOGxkxVFBI=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 68
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sat, 31 Oct 2026 05:00:49 UTC
Date: Sat, 31 Oct 2026 01:02:53 -0400
X-Received-Bytes: 4240