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 8463223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:24:07+00:00 2026-06-10T14:24:07+00:00

I am converting SIMD code into equivalent c code. I am stuck at one

  • 0

I am converting SIMD code into equivalent c code. I am stuck at one of SSE instructions

__m128i _mm_packus_epi16 (__m128i a, __m128i b)

it returns

r0 := UnsignedSaturate(a0)
r1 := UnsignedSaturate(a1)

...
r7 := UnsignedSaturate(a7)
r8 := UnsignedSaturate(b0)
r9 := UnsignedSaturate(b1)
...
r15 := UnsignedSaturate(b7)

What does UnsignedSaturate mean?

  • 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-10T14:24:08+00:00Added an answer on June 10, 2026 at 2:24 pm

    Basically, “saturation” means that values beyond some “max” value get set to “max”, and values below a “min” value get set to “min”. Usually, “min” and “max” are the values appropiate for some data type.

    Thus, for example, if you take arithmetic on unsigned bytes, “128+128” would have to be “256” (which is hex 0x100), which doesn’t fit into a byte. Normal integer arithmetic would create an overflow and discard the part that doesn’t fit, which means “128+128 -> 0”. With saturated arithmetic, “256 > 255” so the result is 255.

    Another option would be scaling, which basically “compresses” the values to a smaller range. Saturation just cuts them off.

    You can also use this to put larger types into smaller ones, like putting 16 bit values into 8 bit values. Your example most likely does exactly that, although you’ll probably know better than I do what kind of types you are dealing with there.

    “UnsignedSaturation” most likely has a min of “0” and a “max” of whatever the max of the result type is. Thus, negative inputs get turned into “0”.

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

Sidebar

Related Questions

i got an assignment of converting an SIMD SSE instruction to equivalent C code...
Just converting some shell scripts into batch files and there is one thing I
I am converting some Objective-C++ code into plain Objective-C and I am having some
Im converting code from VBA into c# and it is all about creating looong
For converting a integer into an enum (out of a json file), I declared
I am converting absolute file-system path to relative path using following code. public static
Currently working with converting SQLException error messages into messages that are more useful for
When converting PSD's into HTML or even HTML5 and CSS, how much more difficult
When converting PDF Pages into UIImages I receive memory warnings all the time. It
Converting another app from Rails 2 to Rails 3 - in one of my

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.