public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: "Li, Pan2" <pan2.li@intel.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: "juzhe.zhong@rivai.ai" <juzhe.zhong@rivai.ai>,
	"Wang, Yanzhang" <yanzhang.wang@intel.com>,
	"kito.cheng@gmail.com" <kito.cheng@gmail.com>
Subject: Re: [PATCH v1] Mode-Switching: Add optional EMIT_AFTER hook
Date: Wed, 23 Aug 2023 17:26:54 -0600	[thread overview]
Message-ID: <deec46b1-9fd0-c4a5-ea26-a4b59c98c7e5@gmail.com> (raw)
In-Reply-To: <MW5PR11MB590885BA8F5022602D19EE00A91CA@MW5PR11MB5908.namprd11.prod.outlook.com>



On 8/23/23 08:54, Li, Pan2 wrote:
> Thanks Jeff for comments.
> 
>> Understood.  So the natural question is why does x86/sh not need this
>> for its mode switching?   Don't all the same issues exist on those
>> targets as well?
> 
> AFAIK, it comes from the different design principle between the risc-v and x86/arm intrinsic API.
> The risc-v rvv FP rounding mode intrinsic API has one abstract level above the insn itself, while
> the x86/arm only indicates the semantics of the insn.
> 
> For example, if one vector instruction VFADD doesn't have static rounding mode (aka encoding rm in insn),
> there is no such a intrinsic API contains rounding mode argument in x86/arm. While the risc-v fp
> vector intrinsic will always have static rounding mode API if the frm is honored.
> 
> In short, the risc-v intrinsic API is closer to the end-user, while the x86/arm instrinsic API is closer to insn itself.
OK, but I'm still strugging to see how the distinction is important 
here.  Ultimately there's a state at a call site.  We need to make sure 
that state from the current function doesn't impact the callee and we 
need to make sure that the callee doesn't impact the state in the caller.

That implies a save/restore pair around the call (possibly optimized so 
that we minimize the number of save/restores).  I would have expected 
x86 to already be doing this.  But maybe there's some ABI thing around 
mmx vs x86 state that allows it to be avoided....

> 
> For the rest part, will have a try based on your suggestion soon as I am in the middle of something.
No problem.  Get to it when you can.  I think it affects you more than 
me :-)

jeff

  reply	other threads:[~2023-08-23 23:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21  7:26 pan2.li
2023-08-21 14:24 ` Jeff Law
2023-08-23  6:03   ` Li, Pan2
2023-08-23 14:25     ` Jeff Law
2023-08-23 14:54       ` Li, Pan2
2023-08-23 23:26         ` Jeff Law [this message]
2023-08-24  4:53           ` Li, Pan2
2023-08-25 12:44             ` Li, Pan2
2023-09-11  8:36               ` Li, Pan2
2023-09-28  1:07                 ` Li, Pan2
2023-09-29 20:29               ` Jeff Law
2023-09-29 20:49             ` Jeff Law
2023-10-02  8:26               ` Robin Dapp
2023-10-05 11:51                 ` Li, Pan2
2023-08-26 13:36 ` [PATCH v2] " pan2.li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=deec46b1-9fd0-c4a5-ea26-a4b59c98c7e5@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=kito.cheng@gmail.com \
    --cc=pan2.li@intel.com \
    --cc=yanzhang.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).