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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:20:06+00:00 2026-06-04T16:20:06+00:00

I need some help on how to use the SSE logical instructions on Visual

  • 0

I need some help on how to use the SSE logical instructions on Visual Studio. Based on the MSDN website,

__m128 _mm_and_ps(__m128 a , __m128 b );
ANDPS

can be used to perform logical AND on the operands a and b. But I couldn’t figure out the exact steps needed to get the results back (memory load and initialization, set, store, etc).

Specifically, I’d like to know how to:

  1. perform the operation,
  2. get the result back, and
  3. obtain the size of the result (number of significant bits).

Could someone please show me in an example how this can be done?

Thanks!

  • 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-04T16:20:08+00:00Added an answer on June 4, 2026 at 4:20 pm

    Here’s an example – inverting the sign of all the elements in a float vector using XOR:

    __m128 v1 = _mm_set_ps(0.0f, 1.0f, -1.0f, -2.0f);
                                           //   v1 =  0.0f,  1.0f, -1.0f, -2.0f
    __m128 sign = _mm_set1_ps(-0.0f);      // sign = -0.0f, -0.0f, -0.0f, -0.0f
    __m128 v2 = _mm_xor_ps(v1, sign);      //   v2 = -0.0f, -1.0f,  1.0f,  2.0f
    

    So, supposing you wanted to negate all the values in an array, you could do it 4 elements at a time, like this:

    const int N = 1024;
    float a[N];
    const __m128 sign = _mm_set1_ps(-0.0f);// sign = -0.0f, -0.0f, -0.0f, -0.0f
    for (int i = 0; i < N; i += 4)
    {
        v = _mm_loadu_ps(&a[i]);           // load 4 elements (unaligned) from a[]
        v = _mm_xor_ps(v1, sign);          // invert sign bit (i.e. negate)
        _mm_storeu_ps(&a[i], v);           // store 4 elements (unaligned) back to a[]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help in understanding when and why to use Remote Service instead
I need some help with vocabulary, I don't use Oracle that often but I
I need some help understanding the use of the contentStretch property on a UIView.
I need some help - I am trying to use a custom validation attribute
I need some help finding information (or an example) of how to use texture
I currently need some help learning how to use bzlib.h header. I was wondering
I haven't use PHP for some time, and I need some help to create
Okay, I need some help here. This is the same old "can't use an
I could really use some help with files (images) download/save application process. I need
im new with JavaME and need some help. I wanna use a List-object and

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.