Stefano Tommesani

  • Increase font size
  • Default font size
  • Decrease font size
Home SIMD MMX Intrinsics

MMX Intrinsics

General Support Intrinsics

Intrinsic name Operation Signed Saturation Assembly instruction
_mm_empty Empties MM state Not applicable Not applicable EMMS
_mm_cvtsi32_si64 Converts from int Not applicable Not applicable MOVD
_mm_cvtsi64_si32 Converts from int Not applicable Not applicable MOVD
_mm_packs_pi16 Packs Yes Yes PACKSSWB
_mm_packs_pi32 Packs Yes Yes PACKSSDW
_mm_packs_pu16 Packs No Yes PACKUSWB
_mm_unpackhi_pi8 Interleaves Not applicable Not applicable PUNPCKHBW
_mm_unpackhi_pi16 Interleaves Not applicable Not applicable PUNPCKHWD
_mm_unpackhi_pi32 Interleaves Not applicable Not applicable PUNPCKHDQ
_mm_unpacklo_pi8 Interleaves Not applicable Not applicable PUNPCKLBW
_mm_unpacklo_pi16 Interleaves Not applicable Not applicable PUNPCKLWD
_mm_unpacklo_pi32 Interleaves Not applicable Not applicable PUNPCKLDQ

 

Packed Arithmetic Intrinsics

Intrinsic name Operation Signed Argument and result values/bits Corresponding instruction
_mm_add_pi8 Adds Not applicable 8/8, 8/8 PADDB
_mm_add_pi16 Adds Not applicable 4/16, 4/16 PADDW
_mm_add_pi32 Adds Not applicable 2/32, 2/32 PADDD
_mm_adds_pi8 Adds Yes 8/8, 8/8 PADDSB
_mm_adds_pi16 Adds Yes 4/16, 4/16 PADDSW
_mm_adds_pu8 Adds No 8/8, 8/8 PADDUSB
_mm_adds_pu16 Adds No 4/16, 4/16 PADDUSW
_mm_sub_pi8 Subtracts Not applicable 8/8, 8/8 PSUBB
_mm_sub_pi16 Subtracts Not applicable 4/16, 4/16 PSUBW
_mm_sub_pi32 Subtracts Not applicable 2/32, 2/32 PSUBD
_mm_subs_pi8 Subtracts Yes 8/8, 8/8 PSUBSB
_mm_subs_pi16 Subtracts Yes 4/16, 4/16 PSUBSW
_mm_subs_pu8 Subtracts No 8/8, 8/8 PSUBUSB
_mm_subs_pu16 Subtracts No 4/16, 4/16 PSUBUSW
_mm_madd_pi16 Multiplies Not applicable 4/16, 2/32 PMADDWD
_mm_mulhi_pi16 Multiplies Yes 4/16, 4/16 (high) PMULHW
_mm_mullo_pi16 Multiplies Not applicable 4/16, 4/16 (low) PMULLW

 

Logical Intrinsics

Intrinsic name Operation Corresponding instruction
_mm_and_si64 Bitwise AND PAND
_mm_andnot_si64 Logical NOT PANDN
_mm_or_si64 Bitwise OR POR
_mm_xor_si64 Bitwise exclusive OR PXOR

 

Compare Intrinsics

Intrinsic name Comparison Number of elements Element bit size Corresponding instruction
_mm_cmpeq_pi8 Equals 8 8 PCMPEQB
_mm_cmpeq_pi16 Equals 4 16 PCMPEQW
_mm_cmpeq_pi32 Equals 2 32 PCMPEQD
_mm_cmpgt_pi8 Greater than 8 8 PCMPGTB
_mm_cmpgt_pi16 Greater than 4 16 PCMPGTW
_mm_cmpgt_pi32 Greater than 2 32 PCMPGTD

 

Set Intrinsics

Intrinsic name Operation Number of elements Element bit size Signed Reverse order
_mm_setzero_si64 Sets to zero 1 64 No No
_mm_set_pi32 Sets integer values 2 32 No No
_mm_set_pi16 Sets integer values 4 16 No No
_mm_set_pi8 Sets integer values 8 8 No No
_mm_set1_pi32 Sets integer values 2 32 Yes No
_mm_set1_pi16 Sets integer values 4 16 Yes No
_mm_set1_pi8 Sets integer values 8 8 Yes No
_mm_setr_pi32 Sets integer values 2 32 No Yes
_mm_setr_pi16 Sets integer values 4 16 No Yes
_mm_setr_pi8 Sets integer values 8 8 No Yes

 

 

 

 

 

 

 

 

 

 

Quote this article on your site

To create link towards this article on your website,
copy and paste the text below in your page.




Preview :

MMX Intrinsics
Thursday, 27 May 2010

Powered by QuoteThis © 2008
Last Updated on Monday, 27 May 2013 15:09  
View Stefano Tommesani's profile on LinkedIn

Latest Articles

Fixing Git pull errors in SourceTree 10 April 2017, 01.44 Software
Fixing Git pull errors in SourceTree
If you encounter the following error when pulling a repository in SourceTree: VirtualAlloc pointer is null, Win32 error 487 it is due to to the Cygwin system failing to allocate a 5 MB large chunk of memory for its heap at
Castle on the hill of crappy audio quality 19 March 2017, 01.53 Audio
Castle on the hill of crappy audio quality
As the yearly dynamic range day is close (March 31st), let's have a look at one of the biggest audio massacres of the year, Ed Sheeran's "Castle on the hill". First time I heard the song, I thought my headphones just got
Necessary evil: testing private methods 29 January 2017, 21.41 Testing
Necessary evil: testing private methods
Some might say that testing private methods should be avoided because it means not testing the contract, that is the interface implemented by the class, but the internal implementation of the class itself. Still, not all
I am right and you are wrong 28 December 2016, 14.23 Web
I am right and you are wrong
Have you ever convinced anyone that disagreed with you about a deeply held belief? Better yet, have you changed your mind lately on an important topic after discussing with someone else that did not share your point of
How Commercial Insight changes R&D 06 November 2016, 01.21 Web
How Commercial Insight changes R&D
The CEB's Commercial Insight is based on three pillars: Be credible/relevant – Demonstrate an understanding of the customer’s world, substantiating claims with real-world evidence. Be frame-breaking – Disrupt the

Translate