From patchwork Thu Jan 21 15:09:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 8082521 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AEBB59F6FA for ; Thu, 21 Jan 2016 15:22:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29319204FF for ; Thu, 21 Jan 2016 15:22:29 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E405204A7 for ; Thu, 21 Jan 2016 15:22:28 +0000 (UTC) Received: from localhost ([::1]:48328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMH47-0000Cg-Sx for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Jan 2016 10:22:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMGsQ-0004BI-9g for qemu-devel@nongnu.org; Thu, 21 Jan 2016 10:10:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMGsP-0006sh-Bf for qemu-devel@nongnu.org; Thu, 21 Jan 2016 10:10:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMGsP-0006sa-5T for qemu-devel@nongnu.org; Thu, 21 Jan 2016 10:10:21 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id DB72BC0ED414; Thu, 21 Jan 2016 15:10:20 +0000 (UTC) Received: from localhost (ovpn-113-39.phx2.redhat.com [10.3.113.39]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0LFAJK5032300; Thu, 21 Jan 2016 10:10:20 -0500 From: Eduardo Habkost To: Peter Maydell Date: Thu, 21 Jan 2016 13:09:36 -0200 Message-Id: <1453388981-24807-8-git-send-email-ehabkost@redhat.com> In-Reply-To: <1453388981-24807-1-git-send-email-ehabkost@redhat.com> References: <1453388981-24807-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PULL 07/12] target-i386: Define MMREG_UNION macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will simplify the definitions of ZMMReg and MMXReg. Reviewed-by: Richard Henderson Signed-off-by: Eduardo Habkost --- target-i386/cpu.h | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/target-i386/cpu.h b/target-i386/cpu.h index b41ce82..70cf66d 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -725,23 +725,18 @@ typedef struct SegmentCache { uint32_t flags; } SegmentCache; -typedef union { - uint8_t _b[64]; - uint16_t _w[32]; - uint32_t _l[16]; - uint64_t _q[8]; - float32 _s[16]; - float64 _d[8]; -} ZMMReg; +#define MMREG_UNION(bits) \ + union { \ + uint8_t _b[(bits)/8]; \ + uint16_t _w[(bits)/16]; \ + uint32_t _l[(bits)/32]; \ + uint64_t _q[(bits)/64]; \ + float32 _s[(bits)/32]; \ + float64 _d[(bits)/64]; \ + } -typedef union { - uint8_t _b[8]; - uint16_t _w[4]; - uint32_t _l[2]; - uint64_t _q[1]; - float32 _s[2]; - float64 _d[1]; -} MMXReg; +typedef MMREG_UNION(512) ZMMReg; +typedef MMREG_UNION(64) MMXReg; typedef struct BNDReg { uint64_t lb;