[02/46] libitm: Support _ITM_TYPE_M64 with SSE2 in 64-bit mode

Message ID 20190201211809.963-3-hjl.tools@gmail.com
State New
Headers show
Series
  • Implement MMX intrinsics with SSE
Related show

Commit Message

H.J. Lu Feb. 1, 2019, 9:17 p.m.
In 64-bit mode when MMX is disabled, we can use SSE2 emulate MMX
intrinsics.

	PR target/89021
	* libitm.h (_ITM_TYPE_M64): Also enabled with SSE2 in 64-bit mode.
---
 libitm/libitm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.1

Comments

Uros Bizjak Feb. 4, 2019, 12:04 p.m. | #1
On Fri, Feb 1, 2019 at 10:18 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>

> In 64-bit mode when MMX is disabled, we can use SSE2 emulate MMX

> intrinsics.

>

>         PR target/89021

>         * libitm.h (_ITM_TYPE_M64): Also enabled with SSE2 in 64-bit mode.

> ---

>  libitm/libitm.h | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/libitm/libitm.h b/libitm/libitm.h

> index c892608cef7..7b471d4ad4b 100644

> --- a/libitm/libitm.h

> +++ b/libitm/libitm.h

> @@ -217,7 +217,7 @@ ITM_LOG(CD)

>  ITM_LOG(CE)

>

>  #if defined(__i386__) || defined(__x86_64__)

> -# ifdef __MMX__

> +# if defined(__MMX__) || (defined(__x86_64__) && defined(__SSE2__))


I think this will not be needed with my proposed approach, which
doesn't kill __MMX__.

Uros.

>    typedef int _ITM_TYPE_M64 __attribute__((vector_size(8), may_alias));

>    ITM_BARRIERS(M64)

>    ITM_LOG(M64)

> --

> 2.20.1

>

Patch

diff --git a/libitm/libitm.h b/libitm/libitm.h
index c892608cef7..7b471d4ad4b 100644
--- a/libitm/libitm.h
+++ b/libitm/libitm.h
@@ -217,7 +217,7 @@  ITM_LOG(CD)
 ITM_LOG(CE)
 
 #if defined(__i386__) || defined(__x86_64__)
-# ifdef __MMX__
+# if defined(__MMX__) || (defined(__x86_64__) && defined(__SSE2__))
   typedef int _ITM_TYPE_M64 __attribute__((vector_size(8), may_alias));
   ITM_BARRIERS(M64)
   ITM_LOG(M64)