Thanks a lot for inputs and suggestions!
Here is updated version of patch.

ChangeLog entry:
2012-04-11  Kirill Yukhin  <>

        * builtins.c (get_memmodel): Remove check of upper bound.
        (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-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.h (PTION_ISA_HLE): Ditto.
        (IX86_HLE_ACQUIRE): Ditto.
        (IX86_HLE_RELEASE): Ditto.
        * config/i386/i386.opt (mhle): Ditto.
        * config/i386/<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.

testsuite/ChangeLog entry:
2012-04-11  Kirill Yukhin  <>

        * New.
        * Ditto.

Tests passing, bootstrap in progress.

If it is ok, I'll proceed with implementation of rest builtins in the same way

Thanks, K

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

Reply via email to