9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Riddler <riddler876@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Floating point and dividing by 0
Date: Fri, 18 Apr 2014 22:32:36 +0100	[thread overview]
Message-ID: <CAGMcHPpdp119i-zmfMjemANGtiAGJOD-_WYAm6N9vrd_R7hZJw@mail.gmail.com> (raw)
In-Reply-To: <0fed1dd0d6f322fa0cc6745a835bdfd1@ladd.quanstro.net>

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

I imagine I was expecting a bit much. I was expecting that it would execute
the instruction, thus putting infinity in the variable, then trigger a
"divide by 0" note. Meaning if I continued infinity would be there.

Thinking about it in hindsight, I could see the CPU/FPU/X doing "get
instruction -> check divisor -> trigger interrupt". With fcr deciding if
the last step is "trigger interrupt" (assuming interrupts are triggering
the note) or "return infinity".
​
I can certainly see potential for lots of hardware edge cases, and why
doing this the way I am probably isn't a safe.

Thinking about the 'skipping an instruction' thing. I imagine you have to
or you would never be able to continue from any note that was triggered due
to an instruction in the program. At least not without some logic in the
note system to check what triggered it, where and ignore it if needed.
Wouldn't be so keen on it if the note was triggered by another program or
something though.
Might go look at the note system, I'm curious how these situations are
handled now.

[-- Attachment #2: Type: text/html, Size: 1231 bytes --]

  reply	other threads:[~2014-04-18 21:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18 19:52 Riddler
2014-04-18 19:56 ` erik quanstrom
2014-04-18 20:10 ` erik quanstrom
2014-04-18 20:44   ` Riddler
2014-04-18 20:54     ` erik quanstrom
2014-04-18 21:32       ` Riddler [this message]
2014-04-18 21:39         ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGMcHPpdp119i-zmfMjemANGtiAGJOD-_WYAm6N9vrd_R7hZJw@mail.gmail.com \
    --to=riddler876@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).