From patchwork Fri Jul 23 05:53:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 29028 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a5d:965a:0:0:0:0:0 with SMTP id d26csp1118883ios; Thu, 22 Jul 2021 22:54:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI2Xh28uf7UMAx8I/DSwdKzELN+GgHXmZtTxgc80MXbWw4cSP7bh7sW7q7Lqg882B1LsS9 X-Received: by 2002:a17:906:bc8b:: with SMTP id lv11mr3131293ejb.331.1627019685869; Thu, 22 Jul 2021 22:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627019685; cv=none; d=google.com; s=arc-20160816; b=XGg2rCoAemRR0se6UYi2CB5fWzWJMUDoM71rgtjCwTBWD4dIPn2GaQ6jgf5OHoMYkH FKRuSsw8wxLvN30lo+g7G7X8o0Nw2ErfylPiLBL55VQknCF6XEg19Pp6Yc9N0ZWSnucc wwjV0SGnWkYEUt5WH9WOOfkJo9jpRIly9hJlUY0ukquFq+4qhd8cb/ttbVDBi6j4iFn0 cqM/nZL0pdNV2OxZTCZrbmz1ikH82lEbo9YHO/yDP+CMMWITPNWW/zsPesmXyDpCQ5Bj G05hOlX0SDDWeou0HTH3UuWinqKBIZZ8eWeXA46h7hMYCQEGjaZM3/ak6OpVmdepujkH CR4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:dkim-signature:delivered-to; bh=q2B42h/HSiiI4jm86WGil28NAxaSi2J6YVqmSc56mog=; b=aEgAHJCgcmroOIfxw+zpRmcCIWAeRfrTm7bPf9WsWbEc6F8M9TcKaVjqVqbD0JH2lj plP4EKl7TusNdAIbwJxwMUHpnal0tY/tUuGCWjOcr6Do7dXS0vs1FVfGHQuGCA3RCDBY nq5tCalmmoYCHP0tu+38xkiT0s6L4yIRMDdkNhc3RnM7nw1pBO+o9/2HOAnk0tXgY61Y HMGsBFIGQIc0VUDWTiSzzFsZOSxws1aCnNvWK6eDvmHYYUlQcjKkFn59jg0rPUecDxQs cfmFuuCPc8yOPCaFtsoCCF2UG5HnCmRJvWQXBtdWzOcxbOsXfUG5XW+bZRy8k6ghDaxk Rw7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@flygoat.com header.s=fm2 header.b=sPTn0foS; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm3 header.b=nRaOP3kN; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 5si36126965ejq.621.2021.07.22.22.54.45; Thu, 22 Jul 2021 22:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@flygoat.com header.s=fm2 header.b=sPTn0foS; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm3 header.b=nRaOP3kN; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3A60F68AB1D; Fri, 23 Jul 2021 08:54:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BA4F368A789 for ; Fri, 23 Jul 2021 08:54:28 +0300 (EEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D3BFF5C00F2; Fri, 23 Jul 2021 01:54:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 23 Jul 2021 01:54:27 -0400 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=fm2; bh=zu/9CU005Wylv 2Gzwa5rOGeizAjRGiy8/MaO0WfpN1g=; b=sPTn0foS+zOqWIUmKtFlXUnhMs01N gSxzeQOD9KjPUj5DicYKPyGLCMQnjdINhGavyE3IW8JkPbYH3nKDRmqheTpNv046 dGWYeeTT4n4dRt2Kkt/52W5aCB2r2cINPB5De6qQLxDLcJN1RL6a+D3aK7zqSviv nJah1i8a6GilRyqzjH1vnTpebimhHgZm/c19M3LUA4GUfUfy5VeHm8mQPRmwo5Sc b0bSnWriNEVtoulVkJzdeUftbxmyy8yVnR5UT5wiS+1OLn0jVE1jALXJfjhFQiUj 26GAKa/ECoJ0lKqWo7AwaahEZTbYiMpGSmGYzIOB1wAjveb4MMsZP9Vkg== 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= fm3; bh=zu/9CU005Wylv2Gzwa5rOGeizAjRGiy8/MaO0WfpN1g=; b=nRaOP3kN 09Qf37lamLNNxI+HyV+9Vh0NWOzYjhAOY4Mt5IkQ2bQ9thIoW+eZUW25+pgubtFy mXe+UYitQY60Vx5kAP85NWFPdVRZzdZxYZjY5fps346J06Z01k4DvOMi99qF5j7f sSX/6udm/eHEKvu9YjL2y0OL445vLEeGL7ayxIGJsXm0Vt9Wg8gdXKGTGGLbCFaZ F6PgJglxasoZ5AR5NOqdLHGuhT90tc37L58oBatv4aSanXhAAyKPVnpgO0VHxcol mOlYf1wFZQvS4fJ/O67H+K0m6yus5R12zcGqKjaSk+rsR1R2A2id6WdXRP4NTnle cGArOvanFa7FrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeejgdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghnghes fhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepjeeihffgteelkeelffduke dtheevudejvdegkeekjeefhffhhfetudetgfdtffeunecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgoh grthdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 23 Jul 2021 01:54:25 -0400 (EDT) From: Jiaxun Yang To: ffmpeg-devel@ffmpeg.org Date: Fri, 23 Jul 2021 13:53:41 +0800 Message-Id: <20210723055344.21961-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210723055344.21961-1-jiaxun.yang@flygoat.com> References: <20210723055344.21961-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 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.29 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, Jiaxun Yang Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JmlkEylMNBaM {SAVE,RECOVER}_REG will be available for Loongson2 again, also comment about the magic. Signed-off-by: Jiaxun Yang Reviewed-by: Shiyou Yin --- 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 6a82caa908..41715c6490 100644 --- a/libavutil/mips/mmiutils.h +++ b/libavutil/mips/mmiutils.h @@ -204,25 +204,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" \ @@ -234,19 +236,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" \