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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:43:46+00:00 2026-05-14T19:43:46+00:00

Is there any difference between logical SSE intrinsics for different types? For example if

  • 0

Is there any difference between logical SSE intrinsics for different types? For example if we take OR operation, there are three intrinsics: _mm_or_ps, _mm_or_pd and _mm_or_si128 all of which do the same thing: compute bitwise OR of their operands. My questions:

  1. Is there any difference between using one or another intrinsic (with appropriate type casting). Won’t there be any hidden costs like longer execution in some specific situation?

  2. These intrinsics maps to three different x86 instructions (por, orps, orpd). Does anyone have any ideas why Intel is wasting precious opcode space for several instructions which do the same thing?

  • 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-14T19:43:46+00:00Added an answer on May 14, 2026 at 7:43 pm

    I think all three are effectively the same, i.e. 128 bit bitwise operations. The reason different forms exist is probably historical, but I’m not certain. I guess it’s possible that there may be some additional behaviour in the floating point versions, e.g. when there are NaNs, but this is pure guesswork. For normal inputs the instructions seem to be interchangeable, e.g.

    #include <stdio.h>
    #include <emmintrin.h>
    #include <pmmintrin.h>
    #include <xmmintrin.h>
    
    int main(void)
    {
        __m128i a = _mm_set1_epi32(1);
        __m128i b = _mm_set1_epi32(2);
        __m128i c = _mm_or_si128(a, b);
    
        __m128 x = _mm_set1_ps(1.25f);
        __m128 y = _mm_set1_ps(1.5f);
        __m128 z = _mm_or_ps(x, y);
            
        printf("a = %vld, b = %vld, c = %vld\n", a, b, c);
        printf("x = %vf, y = %vf, z = %vf\n", x, y, z);
    
        c = (__m128i)_mm_or_ps((__m128)a, (__m128)b);
        z = (__m128)_mm_or_si128((__m128i)x, (__m128i)y);
    
        printf("a = %vld, b = %vld, c = %vld\n", a, b, c);
        printf("x = %vf, y = %vf, z = %vf\n", x, y, z);
        
        return 0;
    }
    

    Terminal:

    $ gcc -Wall -msse3 por.c -o por
    $ ./por
    
    a = 1 1 1 1, b = 2 2 2 2, c = 3 3 3 3
    x = 1.250000 1.250000 1.250000 1.250000, y = 1.500000 1.500000 1.500000 1.500000, z = 1.750000 1.750000 1.750000 1.750000
    a = 1 1 1 1, b = 2 2 2 2, c = 3 3 3 3
    x = 1.250000 1.250000 1.250000 1.250000, y = 1.500000 1.500000 1.500000 1.500000, z = 1.750000 1.750000 1.750000 1.750000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any difference between DECIMAL and NUMERIC data types in SQL Server? When
Is there any difference between these three methods to remove an element from a
Is there any difference between ReferencePath with condition '%(CopyLocal)'=='true' and ReferenceCopyLocalPaths ? The question
Is there any difference between: public ActionResult logOff() { FormsAuth.SignOut(); return RedirectToAction(index, Home); }
Is there any difference between '{' and '[' when formatting a JSON object?
Is there any difference between the below 2 CREATE TABLE statements in SQL Server
Is there any difference between doing this: $(.topHorzNavLink).click(function() { var theHoverContainer = $(#hoverContainer); var
Is there any difference between the following two examples and should one be preferred
Is there any difference between starting a program file with any of those? #!/usr/bin/env
Is there any difference between these tow pieces of code & which approach is

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.