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

  • SEARCH
  • Home
  • 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 8765333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:15:14+00:00 2026-06-13T16:15:14+00:00

I have a __m128i register (Vector A) with 16 bit values with the content:

  • 0

I have a __m128i register (Vector A) with 16 bit values with the content:

{100,26,26,26,26,26,26,100} // A Vector

Now I subtract the vector

{82,82,82,82,82,82,82,82}

With the instruction

_mm_sub_epi16(a_vec,_mm_set1_epi16(82)) 

The expected result should be the following vector

{18,-56,-56,-56,-56,-56,-56,18}

But I get

{18,65480,65480,65480,65480,65480,65480,18}

How can I solve that the vector is treated as signed?

The A Vector was created by this instruction:

__m128i a_vec = _mm_srli_epi16(_mm_unpacklo_epi8(score_vec_8bit, score_vec_8bit), 8)
  • 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-13T16:15:15+00:00Added an answer on June 13, 2026 at 4:15 pm

    65480 is the same value as -56 (they are both 0xffc8 at the register level) – you’re just displaying it as if it were an unsigned short.

    Note that for non-saturating addition and subtraction of binary values without carry/borrow flags it really is irrelevant whether the values are signed or unsigned – hence the same instruction can be used for adding both signed and unsigned shorts – the only difference is how you subsequently interpret (or display) the result.

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

Sidebar

Related Questions

Have done quite a bit of searching for a guide (of any substance) for
have 2 questions : A computer with 32-bit address uses 2-level page table (9
Suppose I have this line of code, which loads 16 x 8-bit unsigned integer
I'm working on converting a bit of code to SSE, and while I have
The Intel Advanced Vector Extensions (AVX) offers no dot product in the 256-bit version
Have a numeric nvarchar values with some extra-symbols For example 1/2, 9/6, 14A They
I am new to SSE2 instructions. I have found an instruction _mm_add_epi8 which can
If I have a class like this: typedef union { __m128 quad; float numbers[4];
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=

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.