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


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.

ChangeLog entry:
2012-04-11  Kirill Yukhin  <kirill.yukhin@intel.com>

        * builtins.c (get_memmodel): Remove check of upper bound,
        imply HLE to use standard ACQUIRE/RELEASE.
        (expand_builtin_atomic_compare_exchange): Mask memmodel values.
        * config/i386/cpuid.h (bit_HLE): New.
        * config/i386/driver-i386.c (host_detect_local_cpu): Detect
        HLE support.
        * config/i386/i386-protos.h (ix86_generate_hle_prefix): New.
        * config/i386/i386-c.c (ix86_target_macros_internal): Set
        HLE defines.
        (ix86_target_string)<-mhle>: New.
        (ix86_option_override_internal)<PTA_HLE>: Ditto.
        (ix86_valid_target_attribute_inner_p)<OPT_mhle>: Ditto.
        * config/i386/i386.c (ix86_target_string)<OPTION_MASK_ISA_HLE>:
        New.
        (ix86_valid_target_attribute_inner_p)<OPT_mhle>: Ditto.
        (ix86_generate_hle_prefix): Ditto.
        (ix86_extend_hle_macro): Ditto.
        (TARGET_EXTEND_HLE_MACRO): Ditto.
        * config/i386/i386.h (OPTION_ISA_HLE): Ditto.
        (IX86_HLE_ACQUIRE): Ditto.
        (IX86_HLE_RELEASE): Ditto.
        * config/i386/i386.h (ix86_generate_hle_prefix): Ditto.
        * config/i386/i386.opt (mhle): Ditto.
        * config/i386/sync.md(atomic_compare_and_swap<mode>): Pass
        success model to instruction emitter.
        (atomic_compare_and_swap_single<mode>): Define and use argument
        for success model.
        (atomic_compare_and_swap_double<mode>): Ditto.
        * doc/tm.texi.in (TARGET_EXTEND_HLE_MACRO): Describe.
        * hooks.h (hook_uhwi_uhwi_unchange): Declare.
        * hooks.c (hook_uhwi_uhwi_unchange): ... and define.
        * target.def (extend_hle_macro): New hook.
        * configure.ac: Check if assembler support HLE prefixies.
        * configure: Regenerate.
        * config.in: Ditto.

Patch attached.

Thanks, K

Attachment: hle-rfc-4.gcc.patch
Description: Binary data


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