@@ -436,6 +436,26 @@ pub unsafe fn _mm_setr_pi8(
436
436
mem:: transmute ( i8x8:: new ( e0, e1, e2, e3, e4, e5, e6, e7) )
437
437
}
438
438
439
+ /// Empty the MMX state, which marks the x87 FPU registers as available for use
440
+ /// by x87 instructions. This instruction must be used at the end of all MMX
441
+ /// technology procedures.
442
+ #[ inline]
443
+ #[ target_feature( enable = "mmx" ) ]
444
+ #[ cfg_attr( test, assert_instr( emms) ) ]
445
+ pub unsafe fn _mm_empty ( ) {
446
+ emms ( )
447
+ }
448
+
449
+ /// Empty the MMX state, which marks the x87 FPU registers as available for use
450
+ /// by x87 instructions. This instruction must be used at the end of all MMX
451
+ /// technology procedures.
452
+ #[ inline]
453
+ #[ target_feature( enable = "mmx" ) ]
454
+ #[ cfg_attr( test, assert_instr( emms) ) ]
455
+ pub unsafe fn _m_empty ( ) {
456
+ emms ( )
457
+ }
458
+
439
459
#[ allow( improper_ctypes) ]
440
460
extern "C" {
441
461
#[ link_name = "llvm.x86.mmx.padd.b" ]
@@ -488,6 +508,8 @@ extern "C" {
488
508
fn punpckhdq ( a : __m64 , b : __m64 ) -> __m64 ;
489
509
#[ link_name = "llvm.x86.mmx.punpckldq" ]
490
510
fn punpckldq ( a : __m64 , b : __m64 ) -> __m64 ;
511
+ #[ link_name = "llvm.x86.mmx.emms" ]
512
+ fn emms ( ) ;
491
513
}
492
514
493
515
#[ cfg( test) ]
@@ -729,4 +751,14 @@ mod tests {
729
751
730
752
assert_eq_m64 ( r, _mm_unpacklo_pi32 ( a, b) ) ;
731
753
}
754
+
755
+ #[ simd_test( enable = "mmx" ) ]
756
+ unsafe fn test_mm_empty ( ) {
757
+ _mm_empty ( ) ;
758
+ }
759
+
760
+ #[ simd_test( enable = "mmx" ) ]
761
+ unsafe fn test_m_empty ( ) {
762
+ _m_empty ( ) ;
763
+ }
732
764
}
0 commit comments