From patchwork Fri Jun 9 07:53:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 105328 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp779550vqr; Fri, 9 Jun 2023 00:53:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/cWo25CxzLZJujpSGesSMwT/jn3uWSN/wNNp3eUpGdctFDI2xv8yzmgXpp5Sq+4rlxJWv X-Received: by 2002:a17:907:a40d:b0:94f:1c90:cb71 with SMTP id sg13-20020a170907a40d00b0094f1c90cb71mr942762ejc.65.1686297232049; Fri, 09 Jun 2023 00:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686297232; cv=none; d=google.com; s=arc-20160816; b=YmTvKBVYBf2ZxG0ir8OttWedQHCL7e1dwz6R7Wiu8ea2HO5356skSA6Y9drv5imczD dq5MnX7XAjcj1zdefGDJ5e5VQtbuceQQp45YyNbwjDuD6LGn2dzOxn7aVZwvamjtx7zB EtGwGpwiEJEZhJycYZKDBw8B6c+uiTlD7hCEIqKehKsGiuaAi3ZOkjyl3YPruWhaDiYk KExa0wHnXKC9xExBjx/tDWNZUOFxyXa5Rv6Znnvsg2Uw/w58FC1m27AAW+PQbIv+scs+ wqWgvsWfls6z8tX34nVv94r95Q6kMKY18aUL2kZfmV+XSXxqrF5nFafHid6jClJ9hpj+ MKPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=iSrWj+hFs13nBxDhfe5KxC5c2iOG3VScVuAC/9k0ujA=; b=D4OJpmlFzVcEkjD4WAtPp3nQ0xafqSi1HQwH/Ma/bd6PweI0riz3t/qC399YSMz+qT huroEJ99MamOgcqCx62yVjEiXFYQ+4hq7gt1V3/Q7Oqzw32DHpdKdF6ychObERwvi3dL 4JxoCM7zR/a+Dhmmm9aErQd5PK5RoVeLPEonFVfi75eqEcjCSpJ88gb84rsTTvwEI0o+ KAFNGmq2LZyXVIqwYfzpMR+RAjif2E4xpK+fI+EUV5PlHPBjbhOIrHfBYpHsqJ/KVWc5 RgRurBWutHoBtt2EV0EPl54LAR+qrpdkgyngg9iKLD/Bf3TrRjsxTlFzxcY07S2MfW+V GdqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hW7ZFi1m; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id sb27-20020a170906eddb00b00978acea364csi936887ejb.650.2023.06.09.00.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 00:53:52 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=hW7ZFi1m; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABD56385703C for ; Fri, 9 Jun 2023 07:53:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABD56385703C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686297230; bh=iSrWj+hFs13nBxDhfe5KxC5c2iOG3VScVuAC/9k0ujA=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=hW7ZFi1min10ZiqnSn70z6PYAi37+UW/qBblPfREKeOfQioIRPJZGr8Bs2VNRD35t yK0HPEs1Hy6APJQvIMVRnn5cgrtTYOkZDqZ/u1c4xyHLxx9SZZOrzOv7G3ZEwD2EjO UgLSyXlwhPhQ/RY2JNfsL6ozEZtVQpP0SQ1nlzzE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by sourceware.org (Postfix) with ESMTPS id 4982D3858C20 for ; Fri, 9 Jun 2023 07:53:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4982D3858C20 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="357546283" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="357546283" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 00:53:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="800134154" X-IronPort-AV: E=Sophos;i="6.00,228,1681196400"; d="scan'208";a="800134154" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jun 2023 00:53:04 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id 8B175100726C; Fri, 9 Jun 2023 15:53:03 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, rdapp.gcc@gmail.com, jeffreyalaw@gmail.com, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v1] RISC-V: Fix one warning of frm enum. Date: Fri, 9 Jun 2023 15:53:01 +0800 Message-Id: <20230609075301.2214833-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Pan Li via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: pan2.li@intel.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768210806244533661?= X-GMAIL-MSGID: =?utf-8?q?1768210806244533661?= From: Pan Li This patch would like to fix one warning similar as below, and add the link for where the values comes from. ./gcc/config/riscv/riscv-protos.h:260:13: warning: binary constants are a C++14 feature or GCC extension FRM_RNE = 0b000, ^~~~~ Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-protos.h (enum frm_field_enum): Adjust literal to int. Signed-off-by: Pan Li Signed-off-by: Pan Li > --- gcc/config/riscv/riscv-protos.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index 38e4125424b..66c1f535d60 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -254,15 +254,18 @@ enum vxrm_field_enum VXRM_RDN, VXRM_ROD }; -/* Rounding mode bitfield for floating point FRM. */ +/* Rounding mode bitfield for floating point FRM. The value of enum comes + from the below link. + https://github.com/riscv/riscv-isa-manual/blob/main/src/f-st-ext.adoc#floating-point-control-and-status-register + */ enum frm_field_enum { - FRM_RNE = 0b000, - FRM_RTZ = 0b001, - FRM_RDN = 0b010, - FRM_RUP = 0b011, - FRM_RMM = 0b100, - FRM_DYN = 0b111 + FRM_RNE = 0, /* Aka 0b000. */ + FRM_RTZ = 1, /* Aka 0b001. */ + FRM_RDN = 2, /* Aka 0b010. */ + FRM_RUP = 3, /* Aka 0b011. */ + FRM_RMM = 4, /* Aka 0b100. */ + FRM_DYN = 7, /* Aka 0b111. */ }; opt_machine_mode vectorize_related_mode (machine_mode, scalar_mode,