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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:49:15+00:00 2026-05-22T02:49:15+00:00

__m128 a; __m128 b; How to code a != b ? what to use:

  • 0
__m128 a;
__m128 b;

How to code a != b ?

what to use: _mm_cmpneq_ps or _mm_cmpneq_ss ?

How to process the result ?

Can’t find adequate docs.

  • 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-05-22T02:49:16+00:00Added an answer on May 22, 2026 at 2:49 am

    You should probably use _mm_cmpneq_ps. However the interpretation of comparisons is a little different with SIMD code than with scalar code. Do you want to test for any corresponding element not being equal ? Or all corresponding elements not being equal ?

    To test the results of the 4 comparisons from _mm_cmpneq_ps you can use _mm_movemask_epi8.

    Note that comparing floating point values for equality or inequality is usually a bad idea, except in very specific cases.

    __m128i vcmp = (__m128i)_mm_cmpneq_ps(a, b); // compare a, b for inequality
    uint16_t test = _mm_movemask_epi8(vcmp); // extract results of comparison
    if (test == 0xffff)
        // *all* elements not equal
    else if (test != 0)
        // *some* elements not equal
    else
        // no elements not equal, i.e. all elements equal
    

    For documentation you want these two volumes from Intel:

    Intel® 64 and IA-32 Architectures Software Developer’s Manual
    Volume 2A: Instruction Set Reference, A-M

    Intel® 64 and IA-32 Architectures Software Developer’s Manual
    Volume 2B: Instruction Set Reference, N-Z

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

Sidebar

Related Questions

Im just wondering how good the MSVC++ Compiler can optimize code(with Code examples) or
I have the code: float *mu_x_ptr; __m128 *tmp; __m128 *mm_mu_x; mu_x_ptr = _aligned_malloc(4*sizeof(float), 16);
I'm working on converting a bit of code to SSE, and while I have
If I have a class like this: typedef union { __m128 quad; float numbers[4];
I try to build an application which uses pthreads and __m128 SSE type. According
What are these data types for? __m64, __m128, __m256 ?
I'm trying to write some computationally intensive code for Windows x64 target, with SSE
I am trying to optimize a small piece of code with SSE intrinsics (I
I've been trying my hand at optimising some code I have using microsoft's sse
I'm just getting started experimenting adding OpenMP to some SSE code. My first test

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.