From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id AFB7B3858D29 for ; Mon, 17 Jun 2024 02:52:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AFB7B3858D29 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 AFB7B3858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::f33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718592774; cv=none; b=fLCkBSmyd/jBBbtYnN23Rr6SOHEzWz5DPCRitfid5fS3N1UdrN+pAXkL/DVm9FO57BPAYuK8i7wMtSEU9tR6zOtInVRVg85dkNB4T6CRlulZw4oHyjgSNB2VyKUOvQwN45zg8ItyOUUOpe54jOzELGt0w7fL7j0lJLsWtni1kqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718592774; c=relaxed/simple; bh=F290eQ6GdZvw51ppwZUWq0uLom/4UNW9TgZhkOQy164=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=x+XFbG/D6+HT3p5O3LE+i6TGtuN3yzulz6UHliuzw8vuqHjeA4zGW/HDAPrrv48usB7SaGkWgY+yYDIBLKiVADlu4t69k/Hq98xMcllMAfb3zOSPOyQaOZFl6yiRRlMSMe/KLsuVE3lKu+1G2DJvTt4e5FsGceTmGGQMSmTAJjc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6b0645351ebso17990336d6.2 for ; Sun, 16 Jun 2024 19:52:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718592772; x=1719197572; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1vmaCUFaXTm0caB09Ycz5Wuqr6GA1d49mtiIyflwSLg=; b=cHU8TukfChZVFRI3BuVjoP9AwGbd06anMy+KGdrIru2UL2vyL08VQS/4KH5h4BFc4+ 8fi7+8mr3/WiNx1Z552shf76D1CAw1UdklEvKDZbRI2AW/FQL53ps/xozY2EAhjGW6HF 4Kfm6VRV9wT9U+s+E/O9eGnRT4QfFqCcXxxDzW24kiHrziDUZV7fiSvBx5VOjKC7u8Rk Jr/pTqWETkxw862EYiJCHP2MmzJi3B5z8LpKwMfOi0Zo8RtmEi6i6/Zs1J9mdr1BwnH1 v+0MZ4wi8MByvp+WelLfbXpgCDEf7b559+v1ixJeY+304iYE/+FeS12LA2nzqv0fshyH iFiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718592772; x=1719197572; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1vmaCUFaXTm0caB09Ycz5Wuqr6GA1d49mtiIyflwSLg=; b=aeVVb4bU8wO2r8oQrVi4dSBoOjNGj0Iz8irCwMqhtafg7DjEPAyTm9yEPntRuKGp07 dosUm17WrxI/qh50m10wb5jdsqsAy8hYdKH2R8ihRbQqgNjAi2Ko5JeHdrXvDdYqlzeS KuhVBBzgCJIdrU9bsE0DuRWmbGb14d0tZGJTsOenJskffW4qkF+QfNpGjy/melKrsfjE dRVt6+Y638KWjKsbe8ydO18Ch14ILdq5/SO/SIcqYJw4GOuqYRJK2vbbl6LsiPSsSKp1 z05uekc269+Ipswm46Z87v0KhCl0b+Tz6Mz6lIT9LopFk0DVU3xjVKiQJq4Uiw5/FVVB jKbA== X-Forwarded-Encrypted: i=1; AJvYcCWrukmNeqAeiKz6dvSFBPapmJt4tYjjNK+YHD6chquzymMTRwq6fooOOsOFMYmGuxAXTPPDsJ3vDGE5XcSPKmP7mnAFpKpL6w== X-Gm-Message-State: AOJu0YzUjcYTteDc9Jdidl2FQU3a8JXm5xSiRgnNq9Y+dyTmC4UkMrbI p7c/zRFF2WaEUCYg4kdoPSdU4no03AuUcOXeq8UCNdLvyAhpcbsDr6yFhRNvW1zU14Uprwb44Fe BokSFYALNzb8Y/ggkckM06SHA/Z4= X-Google-Smtp-Source: AGHT+IHtN6LI54vCP1TZi/29G06pkzDaRLv/s4hE2PN+X8DfvaC9CqbIw5jxTQ/PlSG8KMq7V5ZDGzfVvKITO1EqR/U= X-Received: by 2002:ad4:4591:0:b0:6b0:76b5:d750 with SMTP id 6a1803df08f44-6b2afc7633bmr94810576d6.3.1718592771824; Sun, 16 Jun 2024 19:52:51 -0700 (PDT) MIME-Version: 1.0 References: <20240614025749.743388-1-lingling.kong@intel.com> <1d06e4aa-6e76-4e8a-b9bb-3ec6af05c779@gmail.com> In-Reply-To: <1d06e4aa-6e76-4e8a-b9bb-3ec6af05c779@gmail.com> From: Hongtao Liu Date: Mon, 17 Jun 2024 11:04:32 +0800 Message-ID: Subject: Re: [PATCH 0/3] [APX CFCMOV] Support APX CFCMOV To: Jeff Law Cc: Alexander Monakov , "Kong, Lingling" , "gcc-patches@gcc.gnu.org" , "Liu, Hongtao" , Uros Bizjak Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Sat, Jun 15, 2024 at 1:22=E2=80=AFAM Jeff Law wr= ote: > > > > On 6/14/24 11:10 AM, Alexander Monakov wrote: > > > > On Fri, 14 Jun 2024, Kong, Lingling wrote: > > > >> APX CFCMOV[1] feature implements conditionally faulting which means th= at all memory faults are suppressed > >> when the condition code evaluates to false and load or store a memory = operand. Now we could load or store a > >> memory operand may trap or fault for conditional move. > >> > >> In middle-end, now we don't support a conditional move if we knew that= a load > >> from A or B could trap or fault. > > > > Predicated loads&stores on Itanium don't trap either. They are modeled = via > > COND_EXEC on RTL. The late if-conversion pass (the instance that runs a= fter > > reload) is capable of introducing them. > > > >> To enable CFCMOV, we add a target HOOK TARGET_HAVE_CONDITIONAL_MOVE_ME= M_NOTRAP > >> in if-conversion pass to allow convert to cmov. > > > > Considering the above, is the new hook really necessary? Can you model = the new > > instructions via (cond_exec () (set ...)) instead of (set (if_then_else= ...)) ? > Note that turning on cond_exec will turn off some of the cmove support. Yes, cfcmov looks more like a cmov than a cond_exec. > > But the general suggesting of trying to avoid a hook for this is a good > one. In fact, my first reaction to this thread was "do we really need a > hook for this". Maybe a new optab, .i.e cfmovmodecc, and it differs from movcc for Conditional Fault? > > jeff --=20 BR, Hongtao