From patchwork Fri Feb 19 05:28:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 25777 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 0E08944A97A for ; Fri, 19 Feb 2021 07:29:02 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E69E368A0FC; Fri, 19 Feb 2021 07:29:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D6A75689FD9 for ; Fri, 19 Feb 2021 07:28:54 +0200 (EET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F03E45C0117; Fri, 19 Feb 2021 00:28:53 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 19 Feb 2021 00:28:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=QyuvEWTr+DoxJ rbFVoHRpgPJ6fmIWsQnLNwLE2V4p4I=; b=SqB5FaOPA+5xPYEYFV2jdCSwG1g6g j6h6N7lVvx0khEbFg5fK425GmUsPhrLyJFCQ4mxzEkXwkUWeGNWq6saAeZ/v7Zyz Mc+Iate99GPZVOPsQAzTm6sWtc0IqMGEySTGvW8OTYyyFpzsD0qxhJmbbqTqqRWd o1gJlT91X4UcFKUIq5hrC1o1y72CKul8IafjJaJqhIC18gEvLYgzrZyCQz3F1onJ 67RQqRAQ9/66qsFaucfayMoH1L0BQIq/G/ja5Vkb99FkPzEDULCR48zTxJbxWmgc XIGuQMYxyGduZolBA135DR2lqH816SbG0tI3tYtPKwIhnqiyfBs213NbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=QyuvEWTr+DoxJrbFVoHRpgPJ6fmIWsQnLNwLE2V4p4I=; b=suAq4RoH q60+HuIntKrlvxgnyrADtoJg01twfWlI922zMFnalRr4Dn6LSe0C1H1SFYvwJ3D3 jITA+iqy6XhpUgBWhTXxDEB0WKUH3U61V+LRsIIQATMporStiPrygMHcvhw3wX+6 CFOjX0sjL3qlSituuT4Iw42wwijLRm/9YZPR8rCsIksMt4a1LVg0Tt65vVFo7U5I L6xRgmIGmXqUvIEzhX9hTopiifsQRtA0x0JouGQnOXFcFn2IxvnFhTrIYdeSEFYa REibZhPSmi6fXA6heMREzvmrhJwi+CreeiseOn+82Q0mFt8bmCobvgF9r8EcRthy ebGJj2f5FCODnQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeehgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghnghes fhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepjeeihffgteelkeelffduke dtheevudejvdegkeekjeefhffhhfetudetgfdtffeunecukfhppedukeefrdduheejrdef ledrudeiudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Received: from strike.202.net.flygoat.com (unknown [183.157.39.161]) by mail.messagingengine.com (Postfix) with ESMTPA id 66CCC108005B; Fri, 19 Feb 2021 00:28:51 -0500 (EST) From: Jiaxun Yang To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Feb 2021 13:28:31 +0800 Message-Id: <20210219052834.533558-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210219052834.533558-1-jiaxun.yang@flygoat.com> References: <20210219052834.533558-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avutil/mips: Use MMI_{L, S}QC1 macro in {SAVE, RECOVER}_REG X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: yinshiyou-hf@loongson.cn, guxiwei-hf@loongson.cn, Jiaxun Yang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" {SAVE,RECOVER}_REG will be avilable for Loongson2 again, also comment about the magic. Signed-off-by: Jiaxun Yang --- libavutil/mips/mmiutils.h | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/libavutil/mips/mmiutils.h b/libavutil/mips/mmiutils.h index 8f692e86c5..fb85a4dd1b 100644 --- a/libavutil/mips/mmiutils.h +++ b/libavutil/mips/mmiutils.h @@ -202,25 +202,27 @@ #endif /* HAVE_LOONGSON2 */ /** - * backup register + * Backup saved registers + * We're not using compiler's clobber list as it's not smart enough + * to take advantage of quad word load/store. */ #define BACKUP_REG \ LOCAL_ALIGNED_16(double, temp_backup_reg, [8]); \ if (_MIPS_SIM == _ABI64) \ __asm__ volatile ( \ - "gssqc1 $f25, $f24, 0x00(%[temp]) \n\t" \ - "gssqc1 $f27, $f26, 0x10(%[temp]) \n\t" \ - "gssqc1 $f29, $f28, 0x20(%[temp]) \n\t" \ - "gssqc1 $f31, $f30, 0x30(%[temp]) \n\t" \ + MMI_SQC1($f25, $f24, %[temp], 0x00) \ + MMI_SQC1($f27, $f26, %[temp], 0x10) \ + MMI_SQC1($f29, $f28, %[temp], 0x20) \ + MMI_SQC1($f31, $f30, %[temp], 0x30) \ : \ : [temp]"r"(temp_backup_reg) \ : "memory" \ ); \ else \ __asm__ volatile ( \ - "gssqc1 $f22, $f20, 0x00(%[temp]) \n\t" \ - "gssqc1 $f26, $f24, 0x10(%[temp]) \n\t" \ - "gssqc1 $f30, $f28, 0x20(%[temp]) \n\t" \ + MMI_SQC1($f22, $f20, %[temp], 0x10) \ + MMI_SQC1($f26, $f24, %[temp], 0x10) \ + MMI_SQC1($f30, $f28, %[temp], 0x20) \ : \ : [temp]"r"(temp_backup_reg) \ : "memory" \ @@ -232,19 +234,19 @@ #define RECOVER_REG \ if (_MIPS_SIM == _ABI64) \ __asm__ volatile ( \ - "gslqc1 $f25, $f24, 0x00(%[temp]) \n\t" \ - "gslqc1 $f27, $f26, 0x10(%[temp]) \n\t" \ - "gslqc1 $f29, $f28, 0x20(%[temp]) \n\t" \ - "gslqc1 $f31, $f30, 0x30(%[temp]) \n\t" \ + MMI_LQC1($f25, $f24, %[temp], 0x00) \ + MMI_LQC1($f27, $f26, %[temp], 0x10) \ + MMI_LQC1($f29, $f28, %[temp], 0x20) \ + MMI_LQC1($f31, $f30, %[temp], 0x30) \ : \ : [temp]"r"(temp_backup_reg) \ : "memory" \ ); \ else \ __asm__ volatile ( \ - "gslqc1 $f22, $f20, 0x00(%[temp]) \n\t" \ - "gslqc1 $f26, $f24, 0x10(%[temp]) \n\t" \ - "gslqc1 $f30, $f28, 0x20(%[temp]) \n\t" \ + MMI_LQC1($f22, $f20, %[temp], 0x10) \ + MMI_LQC1($f26, $f24, %[temp], 0x10) \ + MMI_LQC1($f30, $f28, %[temp], 0x20) \ : \ : [temp]"r"(temp_backup_reg) \ : "memory" \