Jump to content


packed float to int rounding SSE


4 replies to this topic

#1 thebigT

    New Member

  • Members
  • PipPip
  • 18 posts

Posted 24 May 2010 - 05:28 AM

I am implementing texturing in SSE and am coming up against a lack of packed float to int conversion instructions. The only remotely useful one I can find ( _mm_cvtss_si32 ) just converts the lowest float in the vector and writes the result out. However I want to convert all four elements and retain them in the xmm register to continue operating on them. Any suggestions would be appreciated. I am quite new to SSE programming and can't help feeling I am missing something obvious.

#2 thebigT

    New Member

  • Members
  • PipPip
  • 18 posts

Posted 24 May 2010 - 06:09 AM

The embarrassment of premature posting. I have found the instruction I was after, just wasn't in the section of the intrinsic reference guide I expected it to be in.

#3 .oisyn

    DevMaster Staff

  • Moderators
  • 1842 posts

Posted 25 May 2010 - 09:10 AM

So, for future reference, what was the instruction? ;)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#4 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1227 posts
  • LocationOttawa, Ontario, Canada

Posted 25 May 2010 - 09:27 AM

cvtps2dq, if my memory serves me right.

#5 .oisyn

    DevMaster Staff

  • Moderators
  • 1842 posts

Posted 25 May 2010 - 10:42 AM

Alas, it was cvtps2pi ;)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users