From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4C71B3858D1E for ; Tue, 14 Feb 2023 08:24:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C71B3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676363044; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=xHB3eSggJwd42Ae8lgZKdQujkVacXkFmgFq83Pn48cs=; b=V9xAWCTXl2Fvaq/iq8J0WiTqu4mMksgLjj0rhK/biSCiJyl8qAdghC1G2SrdTE8nqlFsfM rhnE4ibvmHvVpG5aR9FM2+aYtj2SFlHK4kEGe079vpu1PZEF3KP9FpeXnsJG4fj9fBQxSA EGzCvdliYK2ukFUy5dWYaZpetz4fb+E= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-A45bWgudP-CU6VZlmiivrg-1; Tue, 14 Feb 2023 03:24:00 -0500 X-MC-Unique: A45bWgudP-CU6VZlmiivrg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6DBCF3801F57; Tue, 14 Feb 2023 08:24:00 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24D51492B03; Tue, 14 Feb 2023 08:24:00 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 31E8NuQf553187 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 14 Feb 2023 09:23:57 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 31E8NtCf553186; Tue, 14 Feb 2023 09:23:55 +0100 Date: Tue, 14 Feb 2023 09:23:55 +0100 From: Jakub Jelinek To: Simon Richter , Segher Boessenkool , David Edelsohn Cc: gcc@gcc.gnu.org Subject: Re: POWER __builtin_add_overflow/__builtin_mul_overflow with u64 Message-ID: Reply-To: Jakub Jelinek References: <567bf141-3d8b-201f-933b-087db28fc38b@hogyros.de> MIME-Version: 1.0 In-Reply-To: <567bf141-3d8b-201f-933b-087db28fc38b@hogyros.de> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: Hi! CCing Segher and David on this. rs6000 indeed doesn't implement {,u}{add,sub,mul}v4_optab for any mode and thus leaves it to the generic code. On Tue, Feb 14, 2023 at 04:48:42AM +0100, Simon Richter wrote: > I'm looking at the generated code for these builtins on POWER: > > add 4,3,4 > subfc 3,3,4 > subfe 3,3,3 > std 4,0(5) > rldicl 3,3,0,63 > blr > > and > > mulld 10,3,4 > mulhdu 3,3,4 > addic 9,3,-1 > std 10,0(5) > subfe 3,9,3 > blr > > The POWER architecture has variants of these instructions with builtin > overflow checks (addo/mulldo), but these aren't listed in the .md files, and > the builtins don't generate them either. > > Is this intentional (I've found a few comments that mulldo is microcoded on > CellBE and should be avoided there)? Jakub