From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.22]) by sourceware.org (Postfix) with ESMTPS id 15B673858D39 for ; Mon, 19 Sep 2022 08:57:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 15B673858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gjlay.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=gjlay.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1663577824; s=strato-dkim-0002; d=gjlay.de; h=In-Reply-To:From:References:Cc:To:Subject:Date:Message-ID:Cc:Date: From:Subject:Sender; bh=ZfIGqNNAU0hMxHyLR1vK/F2rDYygBjDV0kQNiQK9kDA=; b=TJarAb1cXISqmi0hV1PUYvSwjo6041hLfgRUhg6yVeSXA6CKsn/e/9PnBLBd1qyCL1 YjCK/GW3kFyE/9XAcpRB705N+5h1lVr7W0O4s/ov7QqicGVA7QdwGHqOxoM689CpYrBr DDNYtyxwnZtog1auGNxr7jisYaUSCMVU15p74Xii2/EC/1jMiu+CDKA+P1fQ3fIHuUC0 gM77V2M6sAL74C1rxM3HD1S2e/8uNJDmldLpOic/AuljfIEqnCFxhW30SOGoWNh8Yj+G EP0MpzvChn0EreVoosOAAuqr0Hk6mn16C7wREgHHhC1pT/hCH76wGZCX8UYe3dy9ZdPv UT3A== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":LXoWVUeid/7A29J/hMvvT3koxZnKT7Qq0xotTetVnKkbjtK7qmy9Jvpc5Ezo" X-RZG-CLASS-ID: mo00 Received: from [192.168.2.102] by smtp.strato.de (RZmta 48.1.0 DYNA|AUTH) with ESMTPSA id 6f8f00y8J8v3ZKP (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 19 Sep 2022 10:57:03 +0200 (CEST) Message-ID: <8f612783-6bfb-30a8-b755-447664a5272d@gjlay.de> Date: Mon, 19 Sep 2022 10:57:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [patch, avr] Fix PR target/99184: Wrong cast from double to 16-bit and 32-bit ints. Content-Language: en-US To: Richard Biener Cc: gcc-patches@gcc.gnu.org References: From: Georg Johann Lay In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Am 19.09.22 um 09:51 schrieb Richard Biener: > On Sun, Sep 18, 2022 at 7:40 PM Georg Johann Lay wrote: >> >> Hello, >> >> this patch fixed PR target/99184 which incorrectly rounded during 64-bit >> (long) double to 16-bit and 32-bit integers. >> >> The patch just removes the respective roundings from >> libf7-asm.sx::to_integer and ::to_unsigned. Luckily, LibF7 does nowhere >> use respective functions internally, the only user is in libf7.c::f7_exp >> >> which reads >> >> f7_round (qq, qq); >> int16_t q = f7_get_s16 (qq); >> >> so that f7_get_s16() operates on an already rounded value, and therefore >> this code works unaltered with or without rounding in to_integer. >> >> The patch applies to directory >> >> ./libgcc/config/avr/libf7/ >> >> and is the same for all GCC versions v10+. >> >> Please someone with write permissions commit it to trunk and backport to >> v12, v11, and v10 as it is a wrong-code issue. >> >> The patch will fit without problems (except for ChangeLog) because there >> is no traffic on that folder. > > Thanks, I've pushed the change. Please in future try to send patches > that can be applied with git am, thus use git format-patch > > Richard. Thanks you so much. The patch I generated with "git diff > file.diff", so that is not correct? The only change is that I defined extra hunks for asm so that one can see the function like in @@ -601,9 +601,6 @@ DEFUN to_integer So git is not prepared to such hunks? Would you point me to some documentation on how to do it properly? Thanks, Johann