From patchwork Fri Apr 28 06:12:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Santos X-Patchwork-Id: 756232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wDjzD2b4zz9s8c for ; Fri, 28 Apr 2017 16:07:51 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="EMCBsR0+"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=PotQQ8Q/oSvC9roKwBXSzTGaQVTlpk2NXixrGecshMNQU110o2LEB TaB8wl90wHNc+VZEQ+wfSEkU10Tblwr2U+kVZbKy77FsXJaG7z5njB1z4AFtkxyu mlYzrmMFIvyEZ5olN8OeUqZAalek98epB1sNDLHGuHRjLTVBuMhY54= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=XYP5V6Gu+zeYmi2jwCF00HipRWo=; b=EMCBsR0+rVhJyCYy4EN/ BGE0oMIPJ8i/t5thC0HDXCU54RYMrxXcjMTgwmr+HXhiZQl2rZT6dfUGBpUfRa+e sx0GX+Bne68TEb0VzOKu2bH83W3uTLO0tRkR5YHZSQXWEwp9yCWOOMxq7ZByhWbS 319AfInKaYvUcZbLcFkuopA= Received: (qmail 105187 invoked by alias); 28 Apr 2017 06:07:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 105156 invoked by uid 89); 28 Apr 2017 06:07:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=fingers X-HELO: sasl.smtp.pobox.com Received: from pb-smtp1.pobox.com (HELO sasl.smtp.pobox.com) (64.147.108.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Apr 2017 06:07:39 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 16CE38EEB7; Fri, 28 Apr 2017 02:07:37 -0400 (EDT) Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 0C1988EEB6; Fri, 28 Apr 2017 02:07:37 -0400 (EDT) Received: from localhost.localdomain (unknown [76.215.41.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 29CCC8EEB5; Fri, 28 Apr 2017 02:07:36 -0400 (EDT) From: Daniel Santos To: gcc-patches Cc: Sandra Loosemore , Uros Bizjak , Jan Hubicka Subject: Re: [PATCH 05/12 rev 1] [i386] Add option -mcall-ms2sysv-xlogues Date: Fri, 28 Apr 2017 01:12:16 -0500 Message-Id: <20170428061216.17586-1-daniel.santos@pobox.com> In-Reply-To: <5902768F.2010704@codesourcery.com> References: <5902768F.2010704@codesourcery.com> X-Pobox-Relay-ID: F9F1FB08-2BD8-11E7-9B5D-E680B56B9B0B-06139138!pb-smtp1.pobox.com X-IsSubscribed: yes Oops. I blame my fingers. :) Daniel --- gcc/config/i386/i386.c | 6 +++++- gcc/config/i386/i386.opt | 4 ++++ gcc/doc/invoke.texi | 13 ++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 113f83742c2..521116195cb 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4508,7 +4508,8 @@ ix86_target_string (HOST_WIDE_INT isa, HOST_WIDE_INT isa2, { "-mstv", MASK_STV }, { "-mavx256-split-unaligned-load", MASK_AVX256_SPLIT_UNALIGNED_LOAD }, { "-mavx256-split-unaligned-store", MASK_AVX256_SPLIT_UNALIGNED_STORE }, - { "-mprefer-avx128", MASK_PREFER_AVX128 } + { "-mprefer-avx128", MASK_PREFER_AVX128 }, + { "-mcall-ms2sysv-xlogues", MASK_CALL_MS2SYSV_XLOGUES } }; /* Additional flag options. */ @@ -6319,6 +6320,9 @@ ix86_option_override_internal (bool main_args_p, #endif } + if (TARGET_SEH && TARGET_CALL_MS2SYSV_XLOGUES) + sorry ("-mcall-ms2sysv-xlogues isn%'t currently supported with SEH"); + if (!(opts_set->x_target_flags & MASK_VZEROUPPER)) opts->x_target_flags |= MASK_VZEROUPPER; if (!(opts_set->x_target_flags & MASK_STV)) diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt index 9384e29b1de..65b228544a5 100644 --- a/gcc/config/i386/i386.opt +++ b/gcc/config/i386/i386.opt @@ -538,6 +538,10 @@ Enum(calling_abi) String(sysv) Value(SYSV_ABI) EnumValue Enum(calling_abi) String(ms) Value(MS_ABI) +mcall-ms2sysv-xlogues +Target Report Mask(CALL_MS2SYSV_XLOGUES) Save +Use libgcc stubs to save and restore registers clobbered by 64-bit Microsoft to System V ABI calls. + mveclibabi= Target RejectNegative Joined Var(ix86_veclibabi_type) Enum(ix86_veclibabi) Init(ix86_veclibabi_type_none) Vector library ABI to use. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 0eeea7b3b87..d9894f37ee5 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1209,7 +1209,7 @@ See RS/6000 and PowerPC Options. -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol -malign-data=@var{type} -mstack-protector-guard=@var{guard} @gol --mmitigate-rop -mgeneral-regs-only} +-mmitigate-rop -mgeneral-regs-only -mcall-ms2sysv-xlogues} @emph{x86 Windows Options} @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol @@ -25308,6 +25308,17 @@ You can control this behavior for specific functions by using the function attributes @code{ms_abi} and @code{sysv_abi}. @xref{Function Attributes}. +@item -mcall-ms2sysv-xlogues +@opindex mcall-ms2sysv-xlogues +@opindex mno-call-ms2sysv-xlogues +Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a +System V ABI function must consider RSI, RDI and XMM6-15 as clobbered. By +default, the code for saving and restoring these registers is emitted inline, +resulting in fairly lengthy prologues and epilogues. Using +@option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that +use stubs in the static portion of libgcc to perform these saves and restores, +thus reducing function size at the cost of a few extra instructions. + @item -mtls-dialect=@var{type} @opindex mtls-dialect Generate code to access thread-local storage using the @samp{gnu} or