Article View: comp.arch
Article #23444Re: Win95 performance counter interface?
From: Paul Hsieh
Date: Sun, 29 Nov 1998 00:00
Date: Sun, 29 Nov 1998 00:00
43 lines
2860 bytes
2860 bytes
SpamYourselFtwest@agora.rdrop.kom says... > Paul Hsieh <qed@pobox.com> wrote: > >That's not correct. All modern x86 CPUs have a functioning/compatible > >RDTSC instruction. > > That's funny; rdtsc is not in any instruction set listing for the K5, > K6, MediaGX, MII, or WinChip I've ever seen, including ones from AMD, > Cyrix, and IDT. WinChip, 6x86MX/MII, K5 and all K6's have RDTSC. I don't know about the MediaGX. > [...] If they're too lazy to complete their manuals within a > year of shipping a part, that's not my fault. Even close-mouthed Intel > manages that. ;-) There is no good manual on x86 instruction set compatibility that I know of. Nevertheless, if you have a good one it should document the CPUID instruction which you can test function 1, bit 4 of edx. That's how you know whether or not your CPU supports the TSC register. > I would also argue that ring 0 read model specific register and read > performance counter instructions are not compatible, as rdtsc is a ring > 3 instruction. RDTSC operates in all rings; It does not run in 16 bit v86 mode. > [...] Likewise, I don't think the "undocumented" ways of > sneaking into the performance registers really count either---it's not > like you can bit test and know they'll work, as you can with rdtsc (at > least on an Intel part). I, for one, have better things to do with my > time than guessing what instructions an x86 processor supports. You don't have to guess. Use the CPUID instruction above -- it tells you all the additional features that your processor supports. > FWIW, I've also had invalid opcode faults on rdtsc on an early K6, Impossible. Unless you are in 16 bit v86 mode (ask Intel about that.) -- Paul Hsieh qed@pobox.com
Technical Details
Message-ID:
<73sam6$s06$1@winter.news.rcn.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<72kj98$lpj$1@autumn.news.rcn.net> <73p61n$3tr$1@winter.news.rcn.net> <73pf0i$op$1@winter.news.rcn.net> <73q7r3$c63$4@winter.news.rcn.net> <73ro0u$j8t$1@winter.news.rcn.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110292,80c509bc716c6415 X-Google-Attributes: gid110292,public X-Google-Thread: f9d87,80c509bc716c6415 X-Google-Attributes: gidf9d87,public X-Google-Thread: 114917,80c509bc716c6415 X-Google-Attributes: gid114917,public X-Google-Thread: 102b75,80c509bc716c6415 X-Google-Attributes: gid102b75,public From: qed@pobox.com (Paul Hsieh) Subject: Re: Win95 performance counter interface? Date: 1998/11/29 Message-ID: <73sam6$s06$1@winter.news.rcn.net> X-Deja-AN: 416856294 Approved: <johnfine@erols.com> References: <72kj98$lpj$1@autumn.news.rcn.net> <73p61n$3tr$1@winter.news.rcn.net> <73pf0i$op$1@winter.news.rcn.net> <73q7r3$c63$4@winter.news.rcn.net> <73ro0u$j8t$1@winter.news.rcn.net> X-Trace: dI793NVydKimqYxpAFu4a5+Wn3sDgSmjHWIo522xa88= Organization: A Million Monkeys X-Server-Date: 29 Nov 1998 19:59:16 GMT NNTP-Posting-Date: 29 Nov 1998 20:26:46 GMT Newsgroups: comp.arch,comp.lang.asm.x86,comp.sys.intel,intel.microprocessors.pentium_ii X-Mozilla-Status: 0801 X-Complaints-To: abuse@rcn.com