Article View: comp.unix.programmer
Article #3488Re: SysV shared memory coherency issues
From: Ryan Underwood
Date: Tue, 14 Feb 2006 20:37
Date: Tue, 14 Feb 2006 20:37
29 lines
3485 bytes
3485 bytes
Robert Redelmeier <redelm@ev1.net.invalid> writes:
>In comp.lang.asm.x86 Ryan Underwood <spamtrap@crayne.org> wrote in part:
>> if (m_Mailbox[STALE_MBOX] != 1)
>> { /* these actions are never taken */ }
>>
>> which generated the following assembly:
>>
>> movl 8(%ebp), %eax # this, this
>> movl 32(%eax), %eax # <variable>.m_Mail
>> addl $288, %eax #, D.40882
>> fldl (%eax) #* D.40882
>> fld1
>Egads! You're not testing FP numbers for _equality_, are you?
>This is a cardinal sin! FP numbers are like sandpiles.
>Whenever you move them, you lose some sand, and mix some dirt in.
No, no. This person is testing it for inequality. I understand what you're
saying, but in that case shouldn't that code block ALWAYS be executed rather
than NEVER? :) I agree that it is bad style, but check out the generated asm
in the correction post.
>In theory, if you start with clean FP registers (load an integer)
>and never do anything nasty with them (like divide by non-2powers
>or multiply by non-integers) then maybe they'll stay clean enough
>for an equality compare. But I wouldn't count on it!
Yes, excellent point.
Technical Details
Message-ID:
<qMqdnbRjI-wQom_eRVn-jA@fidnet.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!transit1.news.xs4all.nl!transit.news.xs4all.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!sn-ams-06!sn-xt-ams-05!sn-post-ams-01!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mailReferences:
<-Z-dneLPKKkNlWzeRVn-oQ@fidnet.com> <vQlIf.47893$dW3.82@newssvr21.news.prodigy.com>Show Full Headers
Complete Article Headers
X-Google-Thread: fc89c,83404d35faeda18b X-Google-Thread: f5392,83404d35faeda18b X-Google-Thread: 11318c,83404d35faeda18b X-Google-Thread: 114917,83404d35faeda18b X-Google-Attributes: gidfc89c,gidf5392,gid11318c,gid114917,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!transit1.news.xs4all.nl!transit.news.xs4all.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!sn-ams-06!sn-xt-ams-05!sn-post-ams-01!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail From: Ryan Underwood <spamtrap@crayne.org> Newsgroups: comp.unix.programmer,comp.os.linux.development.system,gnu.gcc.help,comp.lang.asm.x86 Subject: Re: SysV shared memory coherency issues Approved: CLAX86 Moderators <ccrayne@crayne.org> Date: Tue, 14 Feb 2006 14:37:33 -0600 Organization: Crayne Consulting Message-ID: <qMqdnbRjI-wQom_eRVn-jA@fidnet.com> Sender: clax86@wotan.crayne.org References: <-Z-dneLPKKkNlWzeRVn-oQ@fidnet.com> <vQlIf.47893$dW3.82@newssvr21.news.prodigy.com> X-CLAX86-Policy: http://www.pacificsites.com/~ccrayne/clax86.html X-CLAX86-Faq: http://www.faqs.org/faqs/by-newsgroup/comp/comp.lang.asm.x86.html X-CLAX86-Info-1: Send submissions to comp-lang-asm-x86@moderators.isc.org X-CLAX86-Info-2: Send technical complaints to clax86-admin@crayne.org X-CLAX86-Info-3: Send complaints about policy to clax86-admin@crayne.org X-Comment: moderators do not necessarily agree or disagree with this article. X-Authentication-Warning: serv3.gc.dca.giganews.com: news set sender to poster@giganews.com using -f User-Agent: nn/6.7.2 X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 X-PacificInternet-MailScanner-Information: Please contact the ISP for more information X-PacificInternet-MailScanner: Found to be clean X-PacificInternet-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=0, required 5.5, autolearn=disabled) X-PacificInternet-MailScanner-From: poster@giganews.com X-Spam-Status: No X-UIDL: *QX"!Kh/!!5fb!!2PX!! X-Complaints-To: abuse@supernews.com Lines: 30