Re: [EXT] Re: [RFC] RISC-V: Change the default branch cost.

2025-06-18 Thread Peter Bergner
On 6/17/25 5:58 PM, Jeff Law wrote: > You could make the argument that instead of defaulting to rocket that we > should use a default generic tuning model. That would make much more > sense than deliberately choosing the wrong values for the rocket uarch > because it happens to be used as the d

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Yangyu Chen
On 18/6/2025 09:07, Kito Cheng wrote: Maybe it's a good time to create a -mtune=generic and copy-and-modify from rocket? Indeed, it appears to be the most suitable solution. Thanks, Yangyu Chen On Wed, Jun 18, 2025 at 6:59 AM Jeff Law wrote: On 6/17/25 10:51 AM, Yangyu Chen wrote:

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Kito Cheng
Maybe it's a good time to create a -mtune=generic and copy-and-modify from rocket? On Wed, Jun 18, 2025 at 6:59 AM Jeff Law wrote: > > > > On 6/17/25 10:51 AM, Yangyu Chen wrote: > > > > > > On 17/6/2025 20:42, Jeff Law wrote: > >> > >> > >> On 6/16/25 10:08 PM, Dongyan Chen wrote: > >>> Hi, I've

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Jeff Law
On 6/17/25 10:51 AM, Yangyu Chen wrote: On 17/6/2025 20:42, Jeff Law wrote: On 6/16/25 10:08 PM, Dongyan Chen wrote: Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Jeff Law
On 6/17/25 3:24 PM, Andrew Waterman wrote: I designed Rocket, so I can confirm Yangyu's comment that the branch misprediction penalty is usually 3 cycles. (It's actually 4 if the address of the correct-path instruction is a 4-byte-long instruction that isn't naturally aligned, but that shou

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Andrew Waterman
On Tue, Jun 17, 2025 at 5:43 AM Jeff Law wrote: > > > > On 6/16/25 10:08 PM, Dongyan Chen wrote: > > Hi, I've come across a question regarding the branch cost of gcc. In the > > link > > https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization > > branch judgment, while llvm d

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Yangyu Chen
On 17/6/2025 20:42, Jeff Law wrote: On 6/16/25 10:08 PM, Dongyan Chen wrote: Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment, while llvm does. I eventually discovered

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Jeff Law
On 6/16/25 10:08 PM, Dongyan Chen wrote: Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment, while llvm does. I eventually discovered that the value of the branch cost was t

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Jeff Law
On 6/16/25 10:08 PM, Dongyan Chen wrote: Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment, while llvm does. I eventually discovered that the value of the branch cost was t

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Yangyu Chen
On 17/6/2025 12:08, Dongyan Chen wrote: Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment, while llvm does. I eventually discovered that the value of the branch cost was to

Re: [RFC] RISC-V: Change the default branch cost.

2025-06-17 Thread Dongyan Chen
Thanks very much! Dongyan Chen 在 2025/6/17 15:34, Yangyu Chen 写道: On 17/6/2025 12:08, Dongyan Chen wrote: Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment, while llvm d

[RFC] RISC-V: Change the default branch cost.

2025-06-16 Thread Dongyan Chen
Hi, I've come across a question regarding the branch cost of gcc. In the link https://gcc.godbolt.org/z/hnddevd5h, gcc fails to recognize the optimization branch judgment, while llvm does. I eventually discovered that the value of the branch cost was too small. Moreover, in that link, if I add "-m