This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [i386, patch, RFC] HLE support in GCC


On Wed, Apr 11, 2012 at 07:52:59PM +0400, Kirill Yukhin wrote:
> Yet another iteration :)
> 
> >> > Do you really imply ACQUIRE/RELEASE with HLE_ACQUIRE/RELEASE now? I don't
> Sorry, Andi. Added. So, at the moment you can do smth like
>   __atomic_compare_exchange_n (p, &oldv, newv, 0,
> __ATOMIC_HLE_ACQUIRE, __ATOMIC_ACQUIRE);
> And will get __ATOMIC_ACQUIRE model as well for success model.
> 
> I've also reoved few defines (like __HLE__), made HLE defines
> uncondtinioanl, extended autoconf to check if assembler can generate
> HLE, added hook to make HLE acquire/release imply standard.
> I am also made bits upper 16-th of memmodel enum to be target dependant.

+static unsigned HOST_WIDE_INT
+ix86_extend_hle_macro (unsigned HOST_WIDE_INT memmodel)
+{
+  unsigned HOST_WIDE_INT result = memmodel;
+
+  if (memmodel & IX86_HLE_ACQUIRE)
+    result |= MEMMODEL_ACQUIRE;
+
+  if (memmodel & IX86_HLE_RELEASE)
+    result |= MEMMODEL_RELEASE;
+           
+  return result;
+}

This needs to check whether no existing model is already set
Multiple MEMMODEL_* do not or together.

Also I would not call the target hook "hle", it could be used
for other things too.

+mhle
+Target Report Mask(ISA_HLE) Var(ix86_isa_flags) Save
+Support Hardware Lock Elision prefixies

Typo

Also the new flags (plus the implied barrier semantics) 
need to be described in the manual too.

+  static char buf[128], hle[16];

The hle buffer does not need to be static.
BTW I'm surprised there is no better way to do this in machine descriptions
than to use static buffers.

Other than that it looks good to me. Thanks.

-Andi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]