Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7946707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:13:41+00:00 2026-06-04T01:13:41+00:00

I have a big pixel processing function which I am currently trying to optimize

  • 0

I have a big pixel processing function which I am currently trying to optimize using intrinsic functions.

Being an SSE novice, I am not sure how to tackle the part of the code which involves lookup tables.

Basically, I am trying to vectorize the following vanilla C++ code:

 //outside loop
const float LUT_RATIO = 1000.0F;

//in loop
float v = ... //input value
v = myLookupTable[static_cast<int>(v * LUT_RATIO)];

What I’m trying:

//outside loop
const __m128 LUT_RATIO = _mm_set1_ps(1000.0F);

//in loop
__m128 v = _mm_set_ps(v1, v2, v3, v4); //input values
__m128i vI = _mm_cvtps_epi32(_mm_mul_ps(v, LUT_RATIO)); //multiply and convert to integers
v = ??? // how to get vI indices of myLookupTable?

edit: ildjarn makes a point that demands clarification on my part. I am not trying to achieve speedup for the lookup table code, I am simply trying to avoid having to store the registers back to floats specifically for doing the lookup, as this part is sandwiched between 2 other parts which could theoretically benefit from SSE.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T01:13:43+00:00Added an answer on June 4, 2026 at 1:13 am

    If you can wait until next year then Intel’s Haswell CPUs will have AVX2 which includes instructions for gathered loads. This enables you to do e.g. 8 parallel LUT lookups in one instruction (see e.g. VGATHERDPS). Other than that, you’re out of luck, unless your LUTs are quite small (e.g. 16 elements), in which case you can use PSHUFB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have big URL list, which I have to download in parallel and check
I have big problem when I am trying to deploy my app over clickonce.
I have big records to copy values from table B to table A. Currently
I have to render a very big image (>50.000² pixel) with cairo. To do
I have a big texture, 256*256 there is 64*64 pixel textures on it. How
i have big problem with explanation code under, meanwhile i made two loops function
Possible Duplicate: Big Satellite Image Processing I'm trying to run Mort Canty's Python iMAD
I have big system that make my system crash hard. When I boot up,
I have big trouble with file uploads with php. My own tests are successful
I have big element at the top of the webpage that sides down with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.