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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:07:59+00:00 2026-06-03T16:07:59+00:00

How to multiply four 32-bit integers by another 4 integers? I didn’t find any

  • 0

How to multiply four 32-bit integers by another 4 integers?
I didn’t find any instruction which can do it.

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

    If you need signed 32×32 bit integer multiplication then the following example at software.intel.com looks like it should do what you want:

    static inline __m128i muly(const __m128i &a, const __m128i &b)
    {
        __m128i tmp1 = _mm_mul_epu32(a,b); /* mul 2,0*/
        __m128i tmp2 = _mm_mul_epu32( _mm_srli_si128(a,4), _mm_srli_si128(b,4)); /* mul 3,1 */
        return _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE (0,0,2,0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE (0,0,2,0))); /* shuffle results to [63..0] and pack */
    }
    

    You might want to have two builds – one for old CPUs and one for recent CPUs, in which case you could do the following:

    static inline __m128i muly(const __m128i &a, const __m128i &b)
    {
    #ifdef __SSE4_1__  // modern CPU - use SSE 4.1
        return _mm_mullo_epi32(a, b);
    #else               // old CPU - use SSE 2
        __m128i tmp1 = _mm_mul_epu32(a,b); /* mul 2,0*/
        __m128i tmp2 = _mm_mul_epu32( _mm_srli_si128(a,4), _mm_srli_si128(b,4)); /* mul 3,1 */
        return _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE (0,0,2,0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE (0,0,2,0))); /* shuffle results to [63..0] and pack */
    #endif
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to multiply several 1000s digits long integers as efficiently as possible in
I have grid in my page which have four columns with multiple rows Userid
MySQL/PHP: For a query with multiple statements, which deletes rows in four different tables,
I'm trying to multiply two arrays without using numpy. But, I receive an error
I'm trying to multiply the same double (square it) but the number comes out
How to print multiply flowdocumets in a batch? Following code should print different documents
I am trying to multiply a double value by -1 to get the negative
Is it possible to multiply a char by an int? For example, I am
I have a multiply nested namespace: namespace first {namespace second {namespace third { //
I'm trying to multiply two matrices using vecLibs' cblas: #include <stdlib.h> #include <string.h> #include

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.