[Mono-list] Mono on Xeon Phi

Yury Serdyuk Yury at serdyuk.botik.ru
Wed Feb 6 12:25:59 UTC 2013


Rodrigo Kumpera wrote:

> Mono is not usually build with icc, so it might be the case that it 
> doesn't support some gcc flags. Just hack your way by removing them 
> from configure.in <http://configure.in> for now.

I've tried to compile the problematic module without any flags at all.
The result is the following:

> 2 utils]# icc -I. -I../..  -I../.. -I../../mono -I../../libgc/include 
> -I../../eglib/src -I../../eglib/src -mmic -o hazard-pointer.lo 
> hazard-pointer.c
> /tmp/icciSatYwas_.s: Assembler messages:
> /tmp/icciSatYwas_.s:139: Error: `sfence' is not supported on `k1om'
> /tmp/icciSatYwas_.s:517: Error: `sfence' is not supported on `k1om'

The assembler output points out the problematic place inside 
hazard-pointer.c:

> ..B1.23:                        # Preds ..B1.22 Latency 1
>         movl      %ebx, highest_small_id(%rip)                  
> #hazard-pointer.c:113.3 c1
> # Begin ASM
>         sfence
> # End ASM                                                       
> #hazard-pointer.c:114.3

The corresponding line 114 in hazard-pointer.c is

>  112          if (id > highest_small_id) {
>    113                  highest_small_id = id;
>    114                  mono_memory_write_barrier ();
>    115          }

Finally we have

> $ cat mono-membar.h
> /*
>  * mono-membar.h: Memory barrier inline functions
>  *
>  * Author:
>  *      Mark Probst (mark.probst at gmail.com)
>  *
>  * (C) 2007 Novell, Inc
>  */
>
> #ifndef _MONO_UTILS_MONO_MEMBAR_H_
> #define _MONO_UTILS_MONO_MEMBAR_H_
>
>                              .   .    .
>
> static inline void mono_memory_write_barrier (void)
> {
>         __asm__ __volatile__ ("sfence" : : : "memory");
> }

Yury

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130206/e74cc37a/attachment.html>


More information about the Mono-list mailing list