Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp839369pxb; Thu, 21 Jan 2021 23:55:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxt6ReXzlaObhxqZUIMzAtzh9UY3qV6733Dk4w5AnfVsEASJ8V+JdteV7ygECIlMogc9Tn X-Received: by 2002:a17:906:b0d2:: with SMTP id bk18mr2032974ejb.508.1611302137796; Thu, 21 Jan 2021 23:55:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611302137; cv=none; d=google.com; s=arc-20160816; b=CFAIbSOl9RTUc3O8rG1xza2J78QUiF2sv3PCckCakc/CiBjKL/1aGEMBXzmvq+svYz zdxeSYcfioZMAdgrARwU5VoV9jRWHlpWuN8iwaXh92O3hdVhzsDggD4+mv5N8jbKQRYQ j1P0wIB+8xlHUG0+0NukMO/szZs0VXYquvMZyJB7b+8UZTDffIeaHLK4RrfJyK+74UAw rCwC1AQZDBxd/tbRyJGVtUqdG29xrz9v8/mdC6x4Gx8VrwqPYIeO9qkdHeJg1YPJLS/+ Re96oTAmaL43RhoFmY+TSP1HW94UYJnqQ3yN8CbuIFRMIDsbWCNe4RgjhWdTqKUSF8tS vNDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=f2rce2WD83ZXZBX2Q78+mzsx8y64Pxx1ZFsewFTmPq4=; b=Te/0USHRrSVE1WTIS7unll5vSpxRXFsVAo/0rI9sj9zFeWiPMVc6HwLVXUGk/QIJ5g YLYdmBIzqvPc/SHlKpvIBSO/YXFIhakedlw82uSxrvHl5HAwZZSVZkWczfuuPv88qMgO q7ufE1shsmmay8Uvj9dp1ntLkZ0UwIfyIw/ra/TDOiftx6lIQdVc0cRyyLeWyruYIKml C+NfKl31VUHkw7LMGPdOjjIw6eZDHiPm/IdTC7+fzc2BUwuK00Nut+Jg4JtIKK667I5A GlCjPi1ZOxGbHVk64qhfT53vdjvVAdPKAh23+1SBYLubxVdzBHBlPebcP+aiBvA6yt8J XYvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si3207648edf.22.2021.01.21.23.55.14; Thu, 21 Jan 2021 23:55:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbhAVHyn (ORCPT + 99 others); Fri, 22 Jan 2021 02:54:43 -0500 Received: from mail.loongson.cn ([114.242.206.163]:33800 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726573AbhAVHyl (ORCPT ); Fri, 22 Jan 2021 02:54:41 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxKL5vhApghTcJAA--.14162S2; Fri, 22 Jan 2021 15:53:19 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , Ming Wang Subject: [PATCH] MIPS: Make definitions of MIPSInst_FMA_{FUNC,FMTM} consistent with MIPS64 manual Date: Fri, 22 Jan 2021 15:53:18 +0800 Message-Id: <1611301998-25676-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9DxKL5vhApghTcJAA--.14162S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KFWxXw1fAr15Jr4xuF17Jrb_yoW8JFWkpa nxA3WkKr4kG34IkwnYyrWDWF13tr4kCrZYqFWUurnFga98Xwn8XFnayr1rt3s3XF4rKF10 qw4SgF1jgFy8Cw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26r xl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVAFwVW8 CwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr 0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1l IxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjVc_3UUUU U== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The kernel definitions of MIPSInst_FMA_FUNC and MIPSInst_FMA_FFMT are not consistent with MADD.fmt, NMADD.fmt and NMSUB.fmt in the MIPS64 manual [1], the field func is bit 5..3 and fmt is bit 2..0, fix them. Otherwise there exists error when add new instruction simulation. [1] https://www.mips.com/?do-download=the-mips64-instruction-set-v6-06 Reported-by: Ming Wang Signed-off-by: Tiezhu Yang --- arch/mips/include/asm/inst.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h index 22912f7..2f98ced 100644 --- a/arch/mips/include/asm/inst.h +++ b/arch/mips/include/asm/inst.h @@ -65,11 +65,11 @@ #define I_FR_SFT 21 #define MIPSInst_FR(x) ((MIPSInst(x) & 0x03e00000) >> I_FR_SFT) -#define I_FMA_FUNC_SFT 2 -#define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x0000003c) >> I_FMA_FUNC_SFT) +#define I_FMA_FUNC_SFT 3 +#define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x00000038) >> I_FMA_FUNC_SFT) #define I_FMA_FFMT_SFT 0 -#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000003) +#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000007) typedef unsigned int mips_instruction; -- 2.1.0