Jump to content

  • Log In with Google      Sign In   
  • Create Account

I Wish Intel CPU's Had A Linear Interpolate Instruction


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Toothpix   Crossbones+   -  Reputation: 810

Posted 28 October 2012 - 01:20 PM

Don't you?

C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.


Sponsor:

#2 Servant of the Lord   Crossbones+   -  Reputation: 19665

Posted 28 October 2012 - 02:36 PM

Software isn't good enough?
Why linear only, why not all the other interpolation functions?
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#3 Sirisian   Crossbones+   -  Reputation: 1756

Posted 28 October 2012 - 06:58 PM

A linear interpolate operation is just (max - min)*p + min which can be computed with 2 instructions using a fused-multiply add. That is max - min is one instruction and then the multiply and add is another. This is planned for future processors.

That said there are more important instructions we need in the future like those predicate instructions to remove branch pipeline flushes.

Edited by Sirisian, 28 October 2012 - 06:58 PM.


#4 frob   Moderators   -  Reputation: 21475

Posted 28 October 2012 - 07:05 PM

Agreed. Linear interpolation is not even a blip on the performance radar.

Branch misprediction is a big one. Frequent operations like matrix multiply are another big one.
Check out my personal indie blog at bryanwagstaff.com.

#5 Washu   Senior Moderators   -  Reputation: 5244

Posted 28 October 2012 - 09:48 PM

Agreed. Linear interpolation is not even a blip on the performance radar.

Branch misprediction is a big one. Frequent operations like matrix multiply are another big one.

DPPS in SSE4 handles the matrix multiplication case perfectly fine. You're not likely to ever see a single matrix multiply instruction on the x64 platform. MADD is about as good as it'll get (i.e. DPPS)

The branch misprediction one is perhaps the largest one I can thank of that stands out as far as performance critical code goes.

Edited by Washu, 28 October 2012 - 09:54 PM.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.
ScapeCode - Blog | SlimDX


#6 Hodgman   Moderators   -  Reputation: 30424

Posted 28 October 2012 - 09:58 PM

Does x86 support branch-hints? I've gotten some modest gains on PPC from adding likely/unlikely hints to branches inside tight loops, but then again, PPC's branch predictor is a lot more primitive than your typical x86 one...

While we're at it, does x86 have fsel (or conditional-move for all register types)?

Edited by Hodgman, 28 October 2012 - 10:00 PM.


#7 Nypyren   Crossbones+   -  Reputation: 4346

Posted 28 October 2012 - 11:03 PM

There are prefix bytes for branch taken and branch-not-taken hints for Jcc instructions (3E and 2E respectively). No idea how to use them in assembly language, though (I mainly work on disassembly, not assembly, and I just ignore the hint prefixes since I'm not attempting to round-trip). I've never actually seen them in the wild though.

x86 has quite a lot of conditional-move opcodes, but I don't remember if all register types are supported or not. I believe that GPR and FPU registers are supported, but not sure about MMX/XMM/YMM.

Edited by Nypyren, 28 October 2012 - 11:08 PM.


#8 Bacterius   Crossbones+   -  Reputation: 8945

Posted 29 October 2012 - 07:31 AM

Didn't SSE2 introduce a couple branch hint opcodes?

[...] Additionally, Branch Hints were introduced. These hint prefixes are used to help the processor perform better branch prediction.
hwnt - Hint Weakly Not Taken.
hst - Hint Strongly Taken.



@http://softpixel.com...g/simd/sse2.php

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS