Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #393201 > unrolled thread

Intel's Skylake Prime Number Bug.

Started by"Skybuck Flying" <skybuck2000@hotmail.com>
First post2016-01-11 16:44 +0100
Last post2016-01-11 23:46 -0800
Articles 20 on this page of 64 — 30 participants

Back to article view | Back to sci.electronics.design


Contents

  Intel's Skylake Prime Number Bug. "Skybuck Flying" <skybuck2000@hotmail.com> - 2016-01-11 16:44 +0100
    Re: Intel's Skylake Prime Number Bug. Larc <larc@notmyaddress.com> - 2016-01-11 11:10 -0500
      Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-11 10:22 -0800
        Re: Intel's Skylake Prime Number Bug. Jerry Stuckle <jstucklex@attglobal.net> - 2016-01-11 13:42 -0500
          Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-11 11:12 -0800
            Re: Intel's Skylake Prime Number Bug. David Brown <david.brown@hesbynett.no> - 2016-01-12 11:06 +0100
              Re: Intel's Skylake Prime Number Bug. Richard Heathfield <rjh@cpax.org.uk> - 2016-01-12 10:21 +0000
                Re: Intel's Skylake Prime Number Bug. David Brown <david.brown@hesbynett.no> - 2016-01-12 11:42 +0100
              t cluttered John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-12 09:25 -0800
                Re: t cluttered David Brown <david.brown@hesbynett.no> - 2016-01-12 22:05 +0100
                  Re: t cluttered Ivan Godard <ivan@millcomputing.com> - 2016-01-12 14:03 -0800
                    Re: t cluttered Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2016-01-12 21:44 -0800
                      Re: t cluttered Terje Mathisen <terje.mathisen@tmsw.no> - 2016-01-13 15:41 +0800
                        Re: t cluttered krw <krw@nowhere.com> - 2016-01-13 21:39 -0500
                  Re: t cluttered Rick Jones <rick.jones2@hpe.com> - 2016-01-12 22:41 +0000
                    Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-12 23:01 +0000
                      Re: t cluttered Ivan Godard <ivan@millcomputing.com> - 2016-01-12 16:16 -0800
                        Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-13 10:35 +0000
                          Re: t cluttered Anonymous <no_email@invalid.invalid> - 2016-01-13 14:36 +0000
                            Re: t cluttered Robert Wessel <robertwessel2@yahoo.com> - 2016-01-14 02:48 -0600
                              Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-14 10:50 +0000
                          Re: t cluttered Ivan Godard <ivan@millcomputing.com> - 2016-01-13 11:54 -0800
                            Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-13 20:41 +0000
                            Re: t cluttered mrs@kithrup.com (Mike Stump) - 2016-01-18 13:37 +0000
                              Re: t cluttered Terje Mathisen <terje.mathisen@tmsw.no> - 2016-01-19 00:06 +0800
                              Re: t cluttered Ivan Godard <ivan@millcomputing.com> - 2016-01-18 15:27 -0800
                                Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-19 09:43 +0000
                                  Re: t cluttered Terje Mathisen <terje.mathisen@tmsw.no> - 2016-01-19 18:00 +0800
                                    Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-19 11:25 +0000
                                      Re: t cluttered Terje Mathisen <terje.mathisen@tmsw.no> - 2016-01-19 19:48 +0700
                                        Re: t cluttered Walter Banks <walter@bytecraft.com> - 2016-01-19 09:54 -0500
                                          Re: t cluttered nmm@wheeler.UUCP (Nick Maclaren) - 2016-01-19 16:49 +0000
                  Re: t cluttered krw <krw@nowhere.com> - 2016-01-12 20:53 -0500
                    Re: t cluttered Dennis <dennis@none.none> - 2016-01-13 14:56 -0600
                      Re: t cluttered krw <krw@nowhere.com> - 2016-01-13 21:43 -0500
                Re: t cluttered upsidedown@downunder.com - 2016-01-13 10:15 +0200
          Re: Intel's Skylake Prime Number Bug. JJ <jj4public@vfemail.net> - 2016-01-12 13:11 +0700
          Re: Intel's Skylake Prime Number Bug. "Tom Del Rosso" <fizzbintuesday@that-google-mail-domain.com> - 2016-01-12 02:45 -0500
            Re: Intel's Skylake Prime Number Bug. Paul <nospam@needed.com> - 2016-01-12 04:38 -0500
            Re: Intel's Skylake Prime Number Bug. krw <krw@nowhere.com> - 2016-01-12 12:35 -0500
        Re: Intel's Skylake Prime Number Bug. DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-01-11 15:37 -0500
          Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-11 20:35 -0800
            Re: Intel's Skylake Prime Number Bug. DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-01-12 02:38 -0500
              Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-12 09:27 -0800
            Re: Intel's Skylake Prime Number Bug. Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2016-01-12 09:11 +0000
              Re: Intel's Skylake Prime Number Bug. DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-01-12 13:08 +0000
              Re: Intel's Skylake Prime Number Bug. DecadentLinuxUserNumeroUno <DLU1@DecadentLinuxUser.org> - 2016-01-12 09:45 -0500
              Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-12 09:29 -0800
                Re: Intel's Skylake Prime Number Bug. Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2016-01-12 17:55 +0000
                  Re: Intel's Skylake Prime Number Bug. M Philbrook <jamie_ka1lpa@charter.net> - 2016-01-12 18:25 -0500
                    Re: Intel's Skylake Prime Number Bug. Spehro Pefhany <speffSNIP@interlogDOTyou.knowwhat> - 2016-01-13 12:03 -0500
                  Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-12 16:18 -0800
                  Re: Intel's Skylake Prime Number Bug. John Larkin <jjlarkin@highlandtechnology.com> - 2016-01-12 20:10 -0800
          Re: Intel's Skylake Prime Number Bug. Joe Hey <joehey@mailinator.com> - 2016-01-12 08:05 +0000
        Re: Intel's Skylake Prime Number Bug. Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2016-01-11 22:21 +0000
          Re: Intel's Skylake Prime Number Bug. krw <krw@nowhere.com> - 2016-01-11 21:38 -0500
        Re: Intel's Skylake Prime Number Bug. krw <krw@nowhere.com> - 2016-01-11 21:37 -0500
        Re: Intel's Skylake Prime Number Bug. Robert Baer <robertbaer@localnet.com> - 2016-01-12 20:23 -0800
        Re: Intel's Skylake Prime Number Bug. John Levine <johnl@iecc.com> - 2016-01-13 05:19 +0000
      Re: Intel's Skylake Prime Number Bug. "Skybuck Flying" <skybuck2000@hotmail.com> - 2016-01-11 21:44 +0100
        Re: Intel's Skylake Prime Number Bug. Paul <nospam@needed.com> - 2016-01-11 16:55 -0500
          Re: Intel's Skylake Prime Number Bug. B00ze <B00ze64@hotmail.com> - 2016-01-11 23:48 -0500
        Re: Intel's Skylake Prime Number Bug. "Skybuck Flying" <skybuck2000@hotmail.com> - 2016-01-12 16:35 +0100
    Re: Intel's Skylake Prime Number Bug. Keith Thompson <kst-u@mib.org> - 2016-01-11 23:46 -0800

Page 2 of 4 — ← Prev page 1 [2] 3 4  Next page →


#393851 — Re: t cluttered

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2016-01-14 10:50 +0000
SubjectRe: t cluttered
Message-ID<n77uh8$mqu$1@dont-email.me>
In reply to#393837
In article <l3oe9b9afmqcom4ur2aupecrpq1de08co3@4ax.com>,
Robert Wessel  <robertwessel2@yahoo.com> wrote:
>>> 
>>> Grrk.  That's a CATASTROPHIC solution!  I am not arguing about whether
>>> to be able to address in terms of simple, fixed object sizes - that's
>>> a separate issue and the one that actually resolves.  But, once you
>>> start thinking of array sizes and strides as fixed at compile-time,
>>> you end up with (original) Pascal/C/C++ - ghastly languages for array
>>> algorithms, all.
>>
>>Yup.  It is fascinating that the KDF9, delivered 52 years ago, had 
>>auto-increment addressing modes that updated the loop count by 1
>>and the address/offset by a dynamically-settable stride that could be
>>as large as the largest address, and either positive or negative.  
>
>S/360 BXH/BXLE did something similar - add a value to an index, then
>compare it to a limit before branching if the limit is not exceeded.

However, both of those are solutions for array operations where
strength reduction works - indeed, they ARE strength reduction,
implemented in hardware.  An addressing multiply is needed for the
cases where it cannot be used and yet multi-dimensional array
access is a critical operation.

There was and is a dogma among most computer scientists that it can
always be avoided, but they demonstrably do not have a clue.  And,
as with all religious fanatics, pointing them at the hard facts has
no effect whatsoever.  It's not too strong to say that this dogma
was one of the factors that caused the RISC revolution to fail.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#393710 — Re: t cluttered

FromIvan Godard <ivan@millcomputing.com>
Date2016-01-13 11:54 -0800
SubjectRe: t cluttered
Message-ID<n769th$n5o$1@dont-email.me>
In reply to#393624
On 1/13/2016 2:35 AM, Nick Maclaren wrote:
> In article <n744s9$lhb$1@dont-email.me>,
> Ivan Godard  <ivan@millcomputing.com> wrote:
>>
>>> It has been known for half a century that integer multiply is a
>>> critical addressing operation for a significant proportion of
>>> important codes, though 'computer scientists' often refuse to
>>> admit it.
>>
>> Nick - mul for scaling by stride, when you can't strength-reduce to an
>> add, or when there are more disjoint addresses than you have registers
>> to use for control variables.
>>
>> However, with modern high-reg-count architectures (or long belt-count)
>> and a general choice of natural alignment in arrays (leading to the mul
>> being a manifest power-of-two and hence implementable with a shift) it's
>> much less an issue. And where neither strength reduction nor shift work,
>> most compilers are fairly clever about doing immediate multiplies as
>> shift-and-add combinations.
>
> Not in my experience :-(  The sort of algorithms that critically need
> such code are not typically ones where you can control the sizes or
> strides.  I would be interested in which compilers, because I have
> observed the converse - i.e. that trick is less common than it used
> to be.  But see below: dynamic sizes and strides are the ones of
> interest.
>
>> We looked hard at this, and concluded that we needed to support stride
>> scaling in addressing for all scalar strides. Pending measurement we
>> have not yet settled on whether to extend that to 2*scalar stride,
>> primarily for complex. Actually the bits are there to encode strides up
>> to 128, although the utility of that is questionable :-)
>
> Grrk.  That's a CATASTROPHIC solution!  I am not arguing about whether
> to be able to address in terms of simple, fixed object sizes - that's
> a separate issue and the one that actually resolves.  But, once you
> start thinking of array sizes and strides as fixed at compile-time,
> you end up with (original) Pascal/C/C++ - ghastly languages for array
> algorithms, all.

You are clearly thinking Fortran, in which the second dimension often 
has a runtime stride, while I'm thinking C where there is no second 
dimension, just a first dimension done twice :-)

However, I really don't think that Fortran matrix code will be run on 
the lowest-end Mills, so lacking a multiplier shouldn't be much of an 
issue. They don't have floating point either.

>> However, an integer multiplier is not that much of a monster these days,
>> for any but the extreme low end of our range, and so at least one is
>> configured in to nearly all of the anticipated Mill family members.
>
> My point is that at least one needs to be part of the addressing
> pipeline, in designs which separate that from the floating-point one.
> It doesn't matter if it is fairly slow (e.g. 3x addition is fine,
> and 5x is OK) and restricted to 'addressing size' results, but the
> classic mistake is to allow it to force the addressing pipeline to
> be halted and restarted.  That's why PA-RISC ran like a drain on
> such codes.

Not applicable here. Mill is RISC-like in much of its addressing, and 
there is no multiplier in the addressing pipes; if you need a stride, 
you use an integer mul instruction and then compose your address from 
the result. Where we are less RISCy is that we optimize the common case 
of static *2/4/8/16 by muxing in the address adders, so those cases 
don't need a multiply. And the Mill is statically scheduled/exposed 
pipeline, so there's no issue of "stopping the pipeline" for any ops, 
addressing included.

> If I were doing it, and was inflicted with a two pipeline model, I
> would have 'addressing only' operations in the addressing pipeline,
> and a complete set of integer ones in the 'floating-point' one.
> It would be only the latter that would have single*single=>double
> and double/single=>(single,single), of course.

By and large that's the way it works, with the division between flow and 
exu sides, although all but the smallest Mill has several copies of each 
side. The flow-side address adders are *not* ALU's - they are 3-input 
mixed length summers that know about Mill pointers (which are *not* 
integers, despite the llvm assumptions that cause us so much 
trouble).There is no flow-side mul. The exu side has regular ALU amd MUL 
FUs (and FPUs if configured). And there's some doubt whether we will 
ever have hardware division.

[toc] | [prev] | [next] | [standalone]


#393722 — Re: t cluttered

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2016-01-13 20:41 +0000
SubjectRe: t cluttered
Message-ID<n76cpp$3ue$1@dont-email.me>
In reply to#393710
In article <n769th$n5o$1@dont-email.me>,
Ivan Godard  <ivan@millcomputing.com> wrote:
>>
>> Grrk.  That's a CATASTROPHIC solution!  I am not arguing about whether
>> to be able to address in terms of simple, fixed object sizes - that's
>> a separate issue and the one that actually resolves.  But, once you
>> start thinking of array sizes and strides as fixed at compile-time,
>> you end up with (original) Pascal/C/C++ - ghastly languages for array
>> algorithms, all.
>
>You are clearly thinking Fortran, in which the second dimension often 
>has a runtime stride, while I'm thinking C where there is no second 
>dimension, just a first dimension done twice :-)

Actually, it applies equally well to a multidimensional array class
in C++.  But you are right that C does not support multidimensional
arrays - that was precisely my point!  Damn the languages, I am 
talking about the algorithms and languages.

>However, I really don't think that Fortran matrix code will be run on 
>the lowest-end Mills, so lacking a multiplier shouldn't be much of an 
>issue. They don't have floating point either.

Don't bet on it.  There are lots of matrix algorithms used in graph
theory, often using Boolean arithmetic, and those are important in
even some embedded codes.

>Not applicable here. Mill is RISC-like in much of its addressing, and 
>there is no multiplier in the addressing pipes; if you need a stride, 
>you use an integer mul instruction and then compose your address from 
>the result. Where we are less RISCy is that we optimize the common case 
>of static *2/4/8/16 by muxing in the address adders, so those cases 
>don't need a multiply. And the Mill is statically scheduled/exposed 
>pipeline, so there's no issue of "stopping the pipeline" for any ops, 
>addressing included.

That's fine by me.  It doesn't matter HOW it is done, provided that
integer multiplication in the addressing pipeline is only a minor
performance problem.  It's only a few codes, but those often depend
on it very heavily.

>And there's some doubt whether we will ever have hardware division.

Again, provided that it performs acceptably, so what?


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#394360 — Re: t cluttered

Frommrs@kithrup.com (Mike Stump)
Date2016-01-18 13:37 +0000
SubjectRe: t cluttered
Message-ID<o15HuC.pJC@kithrup.com>
In reply to#393710
In article <n769th$n5o$1@dont-email.me>,
Ivan Godard  <ivan@millcomputing.com> wrote:
>Mill is RISC-like in much of its addressing, and 
>there is no multiplier in the addressing pipes

Hey, I was wondering, does anybody (or did anybody) have an integer
divider (or recip *) in the address pipe?

>And there's some doubt whether we will ever have hardware division.

Curious.  Not even a slow one?

[toc] | [prev] | [next] | [standalone]


#394368 — Re: t cluttered

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2016-01-19 00:06 +0800
SubjectRe: t cluttered
Message-ID<n7j2id$e8m$1@gioia.aioe.org>
In reply to#394360
Mike Stump wrote:
> In article <n769th$n5o$1@dont-email.me>,
> Ivan Godard  <ivan@millcomputing.com> wrote:
>> Mill is RISC-like in much of its addressing, and
>> there is no multiplier in the addressing pipes
>
> Hey, I was wondering, does anybody (or did anybody) have an integer
> divider (or recip *) in the address pipe?

There was a 17-way banked memory system once, does that count?

Terje
>
>> And there's some doubt whether we will ever have hardware division.
>
> Curious.  Not even a slow one?
>


-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#394443 — Re: t cluttered

FromIvan Godard <ivan@millcomputing.com>
Date2016-01-18 15:27 -0800
SubjectRe: t cluttered
Message-ID<n7js7n$qb$1@dont-email.me>
In reply to#394360
On 1/18/2016 5:37 AM, Mike Stump wrote:
> In article <n769th$n5o$1@dont-email.me>,
> Ivan Godard  <ivan@millcomputing.com> wrote:

>> And there's some doubt whether we will ever have hardware division.
>
> Curious.  Not even a slow one?
>

Nope. It is very hard to pipeline a division, and non-pipelined FUs 
really gum up a fast machine. There's a hardware recip approximation, 
but the subsequent NR stages are much better done as separate ops. 
Likewise for sqrt and the transcendentals.

[toc] | [prev] | [next] | [standalone]


#394487 — Re: t cluttered

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2016-01-19 09:43 +0000
SubjectRe: t cluttered
Message-ID<n7l0g3$743$1@dont-email.me>
In reply to#394443
In article <n7js7n$qb$1@dont-email.me>,
Ivan Godard  <ivan@millcomputing.com> wrote:
>On 1/18/2016 5:37 AM, Mike Stump wrote:
>
>>> And there's some doubt whether we will ever have hardware division.
>>
>> Curious.  Not even a slow one?
>
>Nope. It is very hard to pipeline a division, and non-pipelined FUs 
>really gum up a fast machine. There's a hardware recip approximation, 
>but the subsequent NR stages are much better done as separate ops. 
>Likewise for sqrt and the transcendentals.

And there is very little point in a slow hardware division, anyway.
As we have discussed before, Newton-Raphson can be pipelined to a
limited extent and, provided that those stages are integrated in
the numeric instruction stream, that's about as fast as hardware
division on almost all existing systems.  As you say, doing better
has been an intractable problem for six decades.

Another possibility is a (mainly integer) division by a smallish
constant.  That's almost common enough to be justifiable, and could
easily be implemented as a multiplication plus fiddling.  But, if you
have a good single*single=>double operation, the compiler can damn
well do that itself!  Converting float/15.0 to float*(1.0/15.0) has
been done from time immemorial.

I don't know why so few compilers do that for integers, though; it
has always struck me as being one of their many blind spots.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#394489 — Re: t cluttered

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2016-01-19 18:00 +0800
SubjectRe: t cluttered
Message-ID<n7l1gu$1fsq$1@gioia.aioe.org>
In reply to#394487
Nick Maclaren wrote:
> Another possibility is a (mainly integer) division by a smallish
> constant.  That's almost common enough to be justifiable, and could
> easily be implemented as a multiplication plus fiddling.  But, if you
> have a good single*single=>double operation, the compiler can damn
> well do that itself!  Converting float/15.0 to float*(1.0/15.0) has
> been done from time immemorial.
>
> I don't know why so few compilers do that for integers, though; it
> has always struck me as being one of their many blind spots.

Oh, but they do!

15-20 years ago I had the great pleasure of rediscovering how to do 
exact integer division using reciprocal muls, at that time almost no 
compilers did the same.

Now however I haven't seen a compiler which doesn't do this in a long time.

I.e. convert N / const into a reciprocal mul, possibly an adjustment if 
the reciprocal needs an extra bit to be accurate enough,and then a shift.

What I haven't seen any compiler do automatically is a dynamic 
conversion, i.e. where you have a loop dividing many numbers by the same 
integer value: As long as the loop count is 2-3 or higher it is faster 
to calculate the reciprocal and then use that inside the loop.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#394493 — Re: t cluttered

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2016-01-19 11:25 +0000
SubjectRe: t cluttered
Message-ID<n7l6ef$sqr$1@dont-email.me>
In reply to#394489
In article <n7l1gu$1fsq$1@gioia.aioe.org>,
Terje Mathisen  <terje.mathisen@tmsw.no> wrote:
>
>> Another possibility is a (mainly integer) division by a smallish
>> constant.  That's almost common enough to be justifiable, and could
>> easily be implemented as a multiplication plus fiddling.  But, if you
>> have a good single*single=>double operation, the compiler can damn
>> well do that itself!  Converting float/15.0 to float*(1.0/15.0) has
>> been done from time immemorial.
>>
>> I don't know why so few compilers do that for integers, though; it
>> has always struck me as being one of their many blind spots.
>
>Oh, but they do!
>
>15-20 years ago I had the great pleasure of rediscovering how to do 
>exact integer division using reciprocal muls, at that time almost no 
>compilers did the same.

Do you know when they started to?  I thought that I had checked fairly
recently, but 'recently' at my age can be quite a long time ago :-)
My episode of rediscovering that was a decade or two before yours,
and it was an old technique long before that.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#394495 — Re: t cluttered

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2016-01-19 19:48 +0700
SubjectRe: t cluttered
Message-ID<n7lbbg$2a0$1@gioia.aioe.org>
In reply to#394493
Nick Maclaren wrote:
> In article <n7l1gu$1fsq$1@gioia.aioe.org>,
> Terje Mathisen  <terje.mathisen@tmsw.no> wrote:
>>
>>> Another possibility is a (mainly integer) division by a smallish
>>> constant.  That's almost common enough to be justifiable, and could
>>> easily be implemented as a multiplication plus fiddling.  But, if you
>>> have a good single*single=>double operation, the compiler can damn
>>> well do that itself!  Converting float/15.0 to float*(1.0/15.0) has
>>> been done from time immemorial.
>>>
>>> I don't know why so few compilers do that for integers, though; it
>>> has always struck me as being one of their many blind spots.
>>
>> Oh, but they do!
>>
>> 15-20 years ago I had the great pleasure of rediscovering how to do
>> exact integer division using reciprocal muls, at that time almost no
>> compilers did the same.
>
> Do you know when they started to?  I thought that I had checked fairly
> recently, but 'recently' at my age can be quite a long time ago :-)
> My episode of rediscovering that was a decade or two before yours,
> and it was an old technique long before that.

I've just tried to figure out when I was contacted by Agner Fog, in 
order to determine a better timeline, but I could not find it.

Anyway, it is at least 10 years ago that I started to notice compilers 
always generating reciprocal muls.

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#394506 — Re: t cluttered

FromWalter Banks <walter@bytecraft.com>
Date2016-01-19 09:54 -0500
SubjectRe: t cluttered
Message-ID<n7limo$fnm$1@gioia.aioe.org>
In reply to#394495
On 19/01/2016 7:48 AM, Terje Mathisen wrote:
> Nick Maclaren wrote:
>> In article <n7l1gu$1fsq$1@gioia.aioe.org>, Terje Mathisen
>> <terje.mathisen@tmsw.no> wrote:
>>>
>>>> Another possibility is a (mainly integer) division by a
>>>> smallish constant.  That's almost common enough to be
>>>> justifiable, and could easily be implemented as a
>>>> multiplication plus fiddling.  But, if you have a good
>>>> single*single=>double operation, the compiler can damn well do
>>>> that itself!  Converting float/15.0 to float*(1.0/15.0) has
>>>> been done from time immemorial.
>>>>
>>>> I don't know why so few compilers do that for integers, though;
>>>> it has always struck me as being one of their many blind
>>>> spots.
>>>
>>> Oh, but they do!
>>>
>>> 15-20 years ago I had the great pleasure of rediscovering how to
>>> do exact integer division using reciprocal muls, at that time
>>> almost no compilers did the same.
>>
>> Do you know when they started to?  I thought that I had checked
>> fairly recently, but 'recently' at my age can be quite a long time
>> ago :-) My episode of rediscovering that was a decade or two before
>> yours, and it was an old technique long before that.
>
> I've just tried to figure out when I was contacted by Agner Fog, in
> order to determine a better timeline, but I could not find it.
>
> Anyway, it is at least 10 years ago that I started to notice
> compilers always generating reciprocal muls.
>

Time flies for all of us, especially when we are having fun. I just
checked our compiler sources. We started to use reciprocal mults in 1993
for some ISA's and we were far from the first to do so. I am sure both
Terje and Nick were well aware of reciprocal mults well before that time.

[toc] | [prev] | [next] | [standalone]


#394531 — Re: t cluttered

Fromnmm@wheeler.UUCP (Nick Maclaren)
Date2016-01-19 16:49 +0000
SubjectRe: t cluttered
Message-ID<n7lpeh$86c$1@dont-email.me>
In reply to#394506
In article <n7limo$fnm$1@gioia.aioe.org>,
Walter Banks  <walter@bytecraft.com> wrote:
>
>Time flies for all of us, especially when we are having fun. I just
>checked our compiler sources. We started to use reciprocal mults in 1993
>for some ISA's and we were far from the first to do so. I am sure both
>Terje and Nick were well aware of reciprocal mults well before that time.

And when we are getting old!  Thanks very much for the date.


Regards,
Nick Maclaren.

[toc] | [prev] | [next] | [standalone]


#393526 — Re: t cluttered

Fromkrw <krw@nowhere.com>
Date2016-01-12 20:53 -0500
SubjectRe: t cluttered
Message-ID<u5bb9bldoeesbbfik4pdbfo7a8rd56dlhp@4ax.com>
In reply to#393479
On Tue, 12 Jan 2016 22:05:06 +0100, David Brown
<david.brown@hesbynett.no> wrote:

>On 12/01/16 18:25, John Larkin wrote:
>> On Tue, 12 Jan 2016 11:06:45 +0100, David Brown
>> <david.brown@hesbynett.no> wrote:
>>
>>> On 11/01/16 20:12, John Larkin wrote:
>>>> On Mon, 11 Jan 2016 13:42:57 -0500, Jerry Stuckle
>>>
>>>>> Nowadays processors (from micro to mainframe) are run by microcode.
>>>>
>>>> Not all. Some RISC machines are pure logic. ARM, Coldfire, maybe MIPS?
>>>
>>> (When the microcode based 68K architecture was being redesigned into a
>>> RISC structure with little or no microcode for the Coldfire, the
>>> designers planned to keep the microcoded division instructions.  But
>>> then someone noticed that a pure software division routine ran faster
>>> than the microcoded division hardware, so support was dropped.)
>>
>> Some CPU, maybe the HPPA Risc or something, didn't even have a
>> multiply instruction. It cluttered the pipeline so they eliminated it.
>
>There are plenty of small cpus with no multiply, in order to keep the 
>design small and simple.  (I don't expect that die space was a major 
>factor when omitting a multiplier from the HPPA Risc, or whichever 
>processor you meant.)  The interesting thing with division on the 
>Coldfire was that the software-only solution turned out to be faster 
>than the hardware (at least with the old design).

THen there was the IBM 1800 (IIRC) that didn't have an add
instruction.  It was nicknamed CADET (can't add, didn't even try).
When hardware is expensive, lots of things don't get done.
>
>>
>>
>>>
>>> One of the driving forces of "RISC" compared to older "CISC" designs was
>>> to get rid of microcode.
>>>
>>> And since by far most modern cpus (both in terms of the numbers
>>> produced, and the number of designs) are microcontrollers, which almost
>>> never use microcode, it's fair to say that only a small proportion of
>>> currently active processors have microcode - even though those
>>> processors are rather important.
>>
>> I think the fundamental RISC concept is to design an instruction set
>> that's compiler friendly and not people friendly. CISC attempted to
>> make assembly programming look like a programming language; RISC
>> pretty much assumes that binaries are created by compilers.
>>
>
>That's true.  But a key point in a RISC design is that the instructions 
>should each be simple, and do one thing (so you have a "load" 
>instruction, and an "add" instruction, but not a "load then add" 
>instruction).  Then you make these instructions run as fast as possible 
>- and that means no microcoding to add delays.

As complexity of chips increased more of the CISCy instructions found
their way into RISCy processors.  They've more or less met in the
middle.
>
>>
>>
>>
>>>
>>>>
>>>> Intels are still microcode based.
>>>>
>>>
>>> Yes, both Intel and AMD's x86 processors have a lot of microcode.  But
>>> they are not really "microcode based".  Some parts, such as the FPU
>>> (especially multi-cycle functions) are microcoded - but many other parts
>>> are handled directly in hard logic.  The distinction between what is
>>> microcoded and what is hard logic is not easy to guess, and details are
>>> considered part of the design secrets.
>>
>> They are stuck with a CISC instruction set that was originally
>> microcoded. They have to work very hard to butcher that to make it
>> fast.
>
>Yes.  So what happens internally is that the CISC instructions are 
>decoded and turned into mostly RISC instructions of a design-specific 
>RISC cpu that is invisible to the programmer.  In most cases, one CISC 
>instruction turns into one or more RISC instructions to avoid 
>microcoding - but sometimes a few CISC instructions map to one RISC 
>instruction, and for some units microcoding is still used.
>
>>
>>
>>>
>>> Microcode lets Intel and AMD do some fixes by microcode patches, either
>>> using the BIOS (needed for Windows) or loaded by the Linux kernel at
>>> startup.
>>
>> Less bugs is another approach.
>>
>
>:-)
>
>

[toc] | [prev] | [next] | [standalone]


#393725 — Re: t cluttered

FromDennis <dennis@none.none>
Date2016-01-13 14:56 -0600
SubjectRe: t cluttered
Message-ID<n76dhl$6vm$1@dont-email.me>
In reply to#393526
On 01/12/2016 07:53 PM, krw wrote:

>
> THen there was the IBM 1800 (IIRC) that didn't have an add
> instruction.  It was nicknamed CADET (can't add, didn't even try).
> When hardware is expensive, lots of things don't get done.

It was the 1620. It used a table look up in memory for the add 
operations. If you modified the table you do other (sometimes useful) 
things with it - or so I was told by an x-ray crystallographer who did 
extensive programming on it. It used core memory that was heated to 
above room temperature to minimize thermal effect on the cores.

[toc] | [prev] | [next] | [standalone]


#393788 — Re: t cluttered

Fromkrw <krw@nowhere.com>
Date2016-01-13 21:43 -0500
SubjectRe: t cluttered
Message-ID<tm2e9b9ate6deppevdbeam4acqkb3lpop8@4ax.com>
In reply to#393725
On Wed, 13 Jan 2016 14:56:55 -0600, Dennis <dennis@none.none> wrote:

>On 01/12/2016 07:53 PM, krw wrote:
>
>>
>> THen there was the IBM 1800 (IIRC) that didn't have an add
>> instruction.  It was nicknamed CADET (can't add, didn't even try).
>> When hardware is expensive, lots of things don't get done.
>
>It was the 1620. 

You're right, of course.

>It used a table look up in memory for the add 
>operations. If you modified the table you do other (sometimes useful) 
>things with it - or so I was told by an x-ray crystallographer who did 
>extensive programming on it. It used core memory that was heated to 
>above room temperature to minimize thermal effect on the cores.

[toc] | [prev] | [next] | [standalone]


#393583 — Re: t cluttered

Fromupsidedown@downunder.com
Date2016-01-13 10:15 +0200
SubjectRe: t cluttered
Message-ID<1mvb9b9m61fagfk89aj55ekh98mhe7fgpr@4ax.com>
In reply to#393420
On Tue, 12 Jan 2016 09:25:25 -0800, John Larkin
<jjlarkin@highlandtechnology.com> wrote:

>
>>
>>One of the driving forces of "RISC" compared to older "CISC" designs was
>>to get rid of microcode.
>>
>>And since by far most modern cpus (both in terms of the numbers
>>produced, and the number of designs) are microcontrollers, which almost
>>never use microcode, it's fair to say that only a small proportion of
>>currently active processors have microcode - even though those
>>processors are rather important.
>
>I think the fundamental RISC concept is to design an instruction set
>that's compiler friendly and not people friendly. CISC attempted to
>make assembly programming look like a programming language; RISC
>pretty much assumes that binaries are created by compilers.

The original reason of going to microcoding and CISC was the huge cost
of memory. From CPU hardware design point of view it would be nice if
the ALU function (ADD/SUB/AND/OR) and each data path (data selector)
could be directly controlled by a bit in the instruction word.
Unfortunately, for most instructions, there are a lot of "Don't care"
bits, wasting a lot of expensive core memory bits.

One way to avoid this is to use some compact instruction set in core
memory and then use a complex instruction set decoder built from
random logic to generate all the control point signals needed by the
actual CPU hardware. At some point this became too complex and memory
chips were used to convert the compacted instruction set to generate
the individual data path control signals.

In addition, some sequences were common, so it made sense to generate
multiple long instruction word sequences using this compact to
expanded microcode store. Core main memory was slow (about 1 us) so if
the fast semiconductor microcode control store could generate multiple
hardware sequences during that, this was definitively a win. This also
further reduced the number of instruction needed to be stored in the
main program memory.

With the drop of memory prices and when caches become popular, it
became realistic to use long memory words to (more or less) directly
control each data path in the CPU and skip the microcode control
store.  

Regarding CISC/RISC development, one might study the instruction set
of the 16 bit Data General Nova from the 1970's. Some instruction set
bits controlled directly the 74181 ALU chip function bits, some the
Carry_In to that chip and some bits were used to control the data
selectors.

[toc] | [prev] | [next] | [standalone]


#393318

FromJJ <jj4public@vfemail.net>
Date2016-01-12 13:11 +0700
Message-ID<ic60xlf0ylws.1gqxay5mkxd5f$.dlg@40tude.net>
In reply to#393237
On Mon, 11 Jan 2016 13:42:57 -0500, Jerry Stuckle wrote:
> 
> Nowadays processors (from micro to mainframe) are run by microcode.  A
> problem like this can be in the circuitry (as was with the FPU problem
> in the early-mid 90's) or it can be in the microcode.  IOW, it can be a
> hardware bug or a software bug :)
> 
> Obviously if it's a microcode bug, an update should be able to fix it.
> Even if it's a hardware bug, there might be a way around the bug in the
> microcode.
> 
> Being as this is a hang, my guess would be it's a microcode bug.  But
> obviously I don't know.

Were there any information whether the CPU froze due to infinite loop or
stop executing, internally? e.g. if it's due to an internal infinite loop,
the CPU temperature won't decrease several minutes after it frozes.

And if the CPU stops executing, could its state be an untrappable exception
(i.e. hardware crash), deadlock, or a component which isn't either 0/false
or 1/true (i.e. undetermined state; a kind of deadlock when the component is
checked)?

[toc] | [prev] | [next] | [standalone]


#393326

From"Tom Del Rosso" <fizzbintuesday@that-google-mail-domain.com>
Date2016-01-12 02:45 -0500
Message-ID<n72aok$fst$1@dont-email.me>
In reply to#393237
Jerry Stuckle wrote:
>
> Obviously if it's a microcode bug, an update should be able to fix it.
> Even if it's a hardware bug, there might be a way around the bug in
> the microcode.

That's not so obvious unless the microcode is in flash.  Isn't it a mask 
ROM?

-- 

[toc] | [prev] | [next] | [standalone]


#393356

FromPaul <nospam@needed.com>
Date2016-01-12 04:38 -0500
Message-ID<n72hcv$4so$1@dont-email.me>
In reply to#393326
Tom Del Rosso wrote:
> Jerry Stuckle wrote:
>> Obviously if it's a microcode bug, an update should be able to fix it.
>> Even if it's a hardware bug, there might be a way around the bug in
>> the microcode.
> 
> That's not so obvious unless the microcode is in flash.  Isn't it a mask 
> ROM?
> 

Try page 431 here, section 9.11.1 "Microcode Update".
Microcode updates are a part of the BIOS flash image, and a
file in the BIOS file system contains a set of updates.
A typical file in the past, might have contained
eight patches. I used to dissect these, so I could
tell people whether there was a patch for their
non-standard processor or not. (Maybe someone stuffs
a Xeon into a regular desktop socket.)

https://web.archive.org/web/20110516145322/http://www.intel.com/Assets/PDF/manual/253668.pdf

Intel don't generally give information about the "encrypted
data" within a patch.

Some processors, the patch area is only 2KB in size.
Later processors, the patching format was made variable
length, in multiples of 2KB. I've taken apart a BIOS
module before, and found some of the slightly longer
patches (at least 4KB long, maybe slightly longer).

Some processors have as many as 1000 instructions, and
it's not clear that the patch actually contains an entire
microcode. But without a document describing the encrypted
section, we'll never know. It's encrypted presumably to
prevent some sort of hacking (bypassing security features
such as they are).

Intel provides a file suitable for usage by Linux, and
this is a text file for inclusion in compiled code.
Unpack the tar file, get the .dat out, change the
file extension to text and have a look. You can then
compare the samples in here, to the header format
in the above architecture book.

https://downloadmirror.intel.com/18148/eng/microcode-20090927.tgz

/*  Sun Sep 27 10:52:54 CST 2009  */
/*  727-MU168313.inc  */
0x00000001,	0x00000013,	0x02062001,	0x00000683,
0x2f0da1b0,	0x00000001,	0x00000001,	0x00000000,
0x00000000,	0x00000000,	0x00000000,	0x00000000,
0xbf5ad468,	0xc79f5237,	0xbd53889e,	0x896bfd13,
0x7adc0c8f,	0x44e9e0bc,	0x1a331fc9,	0x00b0f479,
0x53e9ceb3,	0xb14131a4,	0x39fc8310,	0x6993ee0d,
0xdb0c59b4,	0x67f24fd0,	0x63e83516,	0x0a4d411d,
0xb86a4294,	0x72c2edc5,	0xc543c5df,	0x7f3dd290,
...

The only vaguely interesting part, is the bit at the beginning,
as the encrypted body, we can't look at that. I'm sure someone
has figured out by now, how that is encrypted, and it's even
possible that is a variant design as well (encryption became
stronger with time). Whatever encryption they used in the P6
era, probably isn't strong enough any more.

Both the BIOS and the OS have a patcher. Patches are only
accepted, if the version number of the patch is higher than
the current version number loaded. And you can check whether
a patch has "taken" later, by using Intel PIU or similar.
So if I checked the BIOS and the version was 07 for your
processor, Intel PIU should report at least 07, and if the
OS loaded 11, then Intel PIU would report 11 instead of 07.
The BIOS must be able to patch out egregious bugs well enough
to allow OS booting to finish. The OS may have a later
version than the crusty old BIOS file content you were
given.

If Asus provides say, eight different versions of BIOS images
for your downloading pleasure, perhaps four of those contain
no substantive changes, and they have the latest versions of
Intel microcode content. So when it says "supports new processors",
sometimes that includes new microcode with a higher version
number. Part of the BIOS support is "recognition" code,
and some is "new microcode patches". Without recognition
code, the BIOS may declare "you have a P6", when you actually
have a Core2, that sort of thing. I have at least one computer
here, where the recognition is wrong, and the thing still works.
That's because I patched the microcode by hand, so the microcode
is actually up to date, but the recognition section, I didn't
have a way to modify that.

The BIOS also used to include a "microcode cache" function.
At least the BIOS for Award, there is a way to load the
microcode yourself, it is stored in flash in the BIOS.
It's non-volatile until you pull the CPU out of the
socket, and plug in another CPU. Doing so would purge the
cache, and you'd have to do the manual loading operation
again if you put the original processor back. The machine I
manually patched, I haven't pulled the processor out of it
since that. I probably wouldn't remember how to repeat
the procedure now. I was putting a Tualatin in a motherboard
that wasn't intended for Tualatin.

HTH,
    Paul

[toc] | [prev] | [next] | [standalone]


#393427

Fromkrw <krw@nowhere.com>
Date2016-01-12 12:35 -0500
Message-ID<k5ea9b9ndl17a3hb2a6e77c541rpaam2da@4ax.com>
In reply to#393326
On Tue, 12 Jan 2016 02:45:15 -0500, "Tom Del Rosso"
<fizzbintuesday@that-google-mail-domain.com> wrote:

>Jerry Stuckle wrote:
>>
>> Obviously if it's a microcode bug, an update should be able to fix it.
>> Even if it's a hardware bug, there might be a way around the bug in
>> the microcode.
>
>That's not so obvious unless the microcode is in flash.  Isn't it a mask 
>ROM?

Microcode patches are often done in RAM.  BIOS loads the patches every
reset.

[toc] | [prev] | [next] | [standalone]


Page 2 of 4 — ← Prev page 1 [2] 3 4  Next page →

Back to top | Article view | sci.electronics.design


csiph-web