This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Intrinsics for fxsave[,64], xsave[,64], xsaveopt[,64]
On Thu, Oct 18, 2012 at 5:45 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Thu, Oct 18, 2012 at 11:16 AM, Alexander Ivchenko <aivchenk@gmail.com> wrote:
>> Hi,
>>
>> this patch adds new intrinsics for fxsave, fxsave64, xsave, xsave64,
>> xsaveopt and xsaveopt64 instructions
>>
>> Bootstrapped on x86-64
>>
>> Is it ok for trunk?
>>
>> Changelog entry:
>> 2012-10-16 Alexander Ivchenko <alexander.ivchenko@intel.com>
>>
>> * gcc/common/config/i386/i386-common.c
>> (OPTION_MASK_ISA_FXSAVE_SET): New.
>> (OPTION_MASK_ISA_XSAVE_SET): Likewise.
>> (ix86_handle_option): Handle mfxsave and mxsave options.
>> * gcc/config.gcc (i[34567]86-*-*): Add fxsaveintrin.h and xsaveintrin.h.
>> (x86_64-*-*): Likewise.
>> * config/i386/xsaveintrin.h: New header.
>> * config/i386/fxsaveintrin.h: Likewise.
>> * gcc/config/i386/driver-i386.c (host_detect_local_cpu): Detect
>> FXSAVE/XSAVE support.
>> * gcc/config/i386/i386-builtin-types.def
>> (VOID_FTYPE_PVOID_INT64): New function type.
>> * gcc/config/i386/i386-c.c: Define __FXSAVE__ and __XSAVE__ if needed.
>> * gcc/config/i386/i386.c (ix86_target_string): Define -mfxsave
>> and -mxsave options.
>> (PTA_FXSAVE): New.
>> (PTA_XSAVE): Likewise.
>> (ix86_option_override_internal): Handle new option.
>> (ix86_valid_target_attribute_inner_p): Add OPT_mfxsave, OPT_mxsave.
>> (ix86_builtins): Add IX86_BUILTIN_FXSAVE32, IX86_BUILTIN_FXSAVE64,
>> IX86_BUILTIN_XSAVE32, IX86_BUILTIN_XSAVE64,
>> IX86_BUILTIN_XSAVEOPT32, IX86_BUILTIN_XSAVEOPT64.
>> (ix86_expand_builtin): Handle these built-ins.
>> * gcc/config/i386/i386.h (TARGET_FXSAVE): New.
>> (TARGET_XSAVE): Likewise.
>> * gcc/config/i386/i386.md (fxsave32): New.
>> (fxsave64): Likewise.
>> (xsave32): Likewise.
>> (xsave64): Likewise.
>> (xsaveopt32): Likewise.
>> (xsaveopt64): Likewise.
>> * gcc/config/i386/i386.opt (mfxsave): New.
>> (mxsave): Likewise.
>> * gcc/config/i386/x86intrin.h: Include
>> xsaveintrin.h, fxsaveintrin.h.
>>
>> testsuite/Changelog entry:
>> 2012-10-16 Alexander Ivchenko <alexander.ivchenko@intel.com>
>>
>> * gcc.target/i386/fxsave-1.c: New.
>> * gcc.target/i386/fxsave64-1.c: Ditto.
>> * gcc.target/i386/xsave-1.c: Ditto.
>> * gcc.target/i386/xsave64-1.c: Ditto.
>> * gcc.target/i386/xsaveopt-1.c: Ditto.
>> * gcc.target/i386/xsaveopt64-1.c: Ditto.
+ if (GET_MODE (op0) != Pmode)
+ op0 = convert_to_mode (Pmode, op0, 1);
+ op0 = gen_rtx_MEM (Pmode, force_reg (Pmode, op0));
+
+ op1 = force_reg (DImode, op1);
+
+ rtx op1_lo;
+ rtx op1_hi;
+
+ if (TARGET_64BIT)
BTW: The convention was to not use declarations in the middle of the
code, but since we are c++ now this may be different.
Anyway, please remove these declarations and use i.e. op3, op4.
Uros.
- References:
- [PATCH] Intrinsics for fxsave[,64], xsave[,64], xsaveopt[,64]
- Re: [PATCH] Intrinsics for fxsave[,64], xsave[,64], xsaveopt[,64]