From patchwork Wed Aug 11 18:44:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 61501 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]) by ozlabs.org (Postfix) with SMTP id 1B9D8B70D4 for ; Thu, 12 Aug 2010 04:45:21 +1000 (EST) Received: (qmail 22467 invoked by alias); 11 Aug 2010 18:45:19 -0000 Received: (qmail 22459 invoked by uid 22791); 11 Aug 2010 18:45:19 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Aug 2010 18:45:00 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o7BIiwAB011623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Aug 2010 14:44:58 -0400 Received: from anchor.twiddle.home ([10.3.113.6]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o7BIiwas003572; Wed, 11 Aug 2010 14:44:58 -0400 Message-ID: <4C62EFAA.6080306@redhat.com> Date: Wed, 11 Aug 2010 11:44:58 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100720 Fedora/3.1.1-1.fc13 Thunderbird/3.1.1 MIME-Version: 1.0 To: GCC Patches CC: ktietz70@googlemail.com Subject: Fix win64 abi wrt AVX registers X-IsSubscribed: yes 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 As detailed in the comment, verified by ktietz via contacts at Microsoft. Sanity checked on x86_64-linux and committed. r~ * config/i386/i386.h (HARD_REGNO_CALL_PART_CLOBBERED): New. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index a2acc71..7fd874b 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1104,6 +1104,12 @@ enum target_cpu_default : (MODE) == QImode && (REGNO) > BX_REG && !TARGET_64BIT ? SImode \ : (MODE)) +/* The only ABI that saves SSE registers across calls is Win64 (thus no + need to check the current ABI here), and with AVX enabled Win64 only + guarantees that the low 16 bytes are saved. */ +#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \ + (SSE_REGNO_P (REGNO) && GET_MODE_SIZE (MODE) > 16) + /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */