From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112a.google.com (mail-yw1-x112a.google.com [IPv6:2607:f8b0:4864:20::112a]) by sourceware.org (Postfix) with ESMTPS id 0D9033858D39 for ; Sat, 4 May 2024 15:23:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D9033858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0D9033858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::112a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714836205; cv=none; b=X1PZ1+3l6c/lQQ/tFuMRSu5omM3L/v+DAxMbB9WMiv7tG6/NBAkZ3pwYtTfgVcd72bQbvC0TlikX8s1+8r9V106cXatxRU1P/ku+4++ggd1POU1BCH/SIno00TMLj5LVwstmjwvUr+SCMCNgxC+2hOKpyNAVodQn7xqgr0xhKlY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714836205; c=relaxed/simple; bh=IBx9L2wIpQfBMRqkwV6ukGCDCUId1Zx9N3yFy7G5bAk=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Iko7Qi4CtwvqFyZsFAtfqr9OfOr8yR0dt7QHimQu9npjssHNSRazvFBTNtD3ePGpgNMgkkcfVmPbaF15SqOboWh1x+FMiyxPbKCLDGtRxDCkaPhbyqOZeZV/Yu54Ne/PZQUQ/nkrHiZ4/i17F2kWIokrCVIFCdDZ1SVWurifGew= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-61b62005f38so5983927b3.2 for ; Sat, 04 May 2024 08:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714836203; x=1715441003; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5x2TesKUpknc68iZg74/o6NhlR3fI8fCeV080C5m4n8=; b=eOPR8Bu6ClUm378bEwmtEC/z+XzhlP6EdzWRACJatia+URV3FPSrLmPd+jFk3ldUKJ ezRMsh0bA7Eegzi9hOLJqY7Ym/mof0JI2gGGlLJV8NPJaEk0zA7i/mo/i9ncrsOJ+MGE 0+0ZvEVVXFtzDJCstDBzz0DsC2Ke7e2kFOTmLJwL+StG03nXFJoqK8aOGqeEqRfBlfYf Gh2nSe0KjeOCuBeR+rw3lJp4ymVh+jhECptOXJYI5XcVFmkfgKdK4df3yiwD7pGpjs6e XLCEKV90V0FEu584SWz+pq9s9v5GhqEdt6qFn4fZm4mIdXoTwPtWiZWL+bKwPyFSSs+w czCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714836203; x=1715441003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5x2TesKUpknc68iZg74/o6NhlR3fI8fCeV080C5m4n8=; b=BW6pjSDJ3oUNAAkUWcDdSq5750tjuAPDvgzePi3ElsE0PYoWwkZu0qrpDrgq7rGsxb wXIr4x4Q0TIJlkTKwUVlFE71XIUh/c93NQawKdPFievd9S3w871WJK6TrrIYEEJ6cwwY 0RNPFXag67qGC5DDiggLVbj9aaS17JperzKDrfA6qtvCO4gze3VFmgQ6m1u62xX9Oo7d ZSpl/x5DfzhDvmW+m3DXlQW3VUNPGzios8ww80ZN7GWsjw4U55jQ58wsqXiVZAsJrARt OkD3+15/1DO/olVS01nZJFSnJ1J/2BhEg1hP2JRyhRAOqezWdhvFMTxJyDb7i6R/Qq8C 6DNQ== X-Forwarded-Encrypted: i=1; AJvYcCWAuEqRNfF6dTNAhsEO78o6rQl9xJSAtpgUugyKAPBwmXdJHZXWrW80PuGBuJ8GL6u4nprvrlWKPS5xJy0wkF6n7W9ILL9Scw== X-Gm-Message-State: AOJu0Yx2897CLtOd7mr4wor3Y2IMLCCLc1quLuvGy66ZAdnuW80maAFA VL1Ya5vjBE57cJQi5u3PNrhKd6OxJN9cQ++rirs8Fx7v2t8yL3xb X-Google-Smtp-Source: AGHT+IFszvE76qpueWHv6AtmbrfAnt7rjDe4xlBnosStttfDoS2syWtJUj2gYtxkXenqpDGdLC1glg== X-Received: by 2002:a0d:ead6:0:b0:61e:a26:c1b2 with SMTP id t205-20020a0dead6000000b0061e0a26c1b2mr5560429ywe.17.1714836203277; Sat, 04 May 2024 08:23:23 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id h124-20020a816c82000000b0061448978753sm1156638ywc.41.2024.05.04.08.23.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 May 2024 08:23:22 -0700 (PDT) Message-ID: <3043f164-13a3-4599-bc2c-0b953d11182b@gmail.com> Date: Sat, 4 May 2024 09:23:21 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH v2 1/1] [RISC-V] Add support for _Bfloat16 Content-Language: en-US To: Xiao Zeng , gcc-patches@gcc.gnu.org Cc: research_trasio@irq.a4lg.com, kito.cheng@gmail.com, zhengyu@eswincomputing.com, jinma@linux.alibaba.com References: <20240402092210.80779-1-zengxiao@eswincomputing.com> <20240402092210.80779-2-zengxiao@eswincomputing.com> From: Jeff Law In-Reply-To: <20240402092210.80779-2-zengxiao@eswincomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/2/24 3:22 AM, Xiao Zeng wrote: > 1 At point , > BF16 has already been completed "post public review". > > 2 LLVM has also added support for RISCV BF16 in > and > . > > 3 According to the discussion , > this use __bf16 and use DF16b in riscv_mangle_type like x86. > > Below test are passed for this patch > * The riscv fully regression test. > > gcc/ChangeLog: > > * config/riscv/iterators.md: New mode iterator HFBF. > * config/riscv/riscv-builtins.cc (riscv_init_builtin_types): > Initialize data type _Bfloat16. > * config/riscv/riscv-modes.def (FLOAT_MODE): New. > (ADJUST_FLOAT_FORMAT): New. > * config/riscv/riscv.cc (riscv_mangle_type): Support for BFmode. > (riscv_scalar_mode_supported_p): Ditto. > (riscv_libgcc_floating_mode_supported_p): Ditto. > (riscv_init_libfuncs): Set the conversion method for BFmode and > HFmode. > (riscv_block_arith_comp_libfuncs_for_mode): Set the arithmetic > and comparison libfuncs for the mode. > * config/riscv/riscv.md (mode" ): Add BF. > (movhf): Support for BFmode. > (mov): Ditto. > (*movhf_softfloat): Ditto. > (*mov_softfloat): Ditto. > > libgcc/ChangeLog: > > * config/riscv/sfp-machine.h (_FP_NANFRAC_B): New. > (_FP_NANSIGN_B): Ditto. > * config/riscv/t-softfp32: Add support for BF16 libfuncs. > * config/riscv/t-softfp64: Ditto. > * soft-fp/floatsibf.c: For si -> bf16. > * soft-fp/floatunsibf.c: For unsi -> bf16. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/bf16_arithmetic.c: New test. > * gcc.target/riscv/bf16_call.c: New test. > * gcc.target/riscv/bf16_comparison.c: New test. > * gcc.target/riscv/bf16_float_libcall_convert.c: New test. > * gcc.target/riscv/bf16_integer_libcall_convert.c: New test. Just some nits. In t-softfp32 and t-softfp64 the code you've added should be using tabs, not 8 spaces, as noted by the CI "Lint Status": https://github.com/ewlu/gcc-precommit-ci/issues/1412#issuecomment-2031568644 With that fixed, this is fine for the trunk. No need to repost, go ahead and commit. Thanks for your patience, Jeff