* [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS]
@ 2024-01-07 0:36 Juzhe-Zhong
2024-01-07 19:11 ` Jeff Law
0 siblings, 1 reply; 4+ messages in thread
From: Juzhe-Zhong @ 2024-01-07 0:36 UTC (permalink / raw)
To: gcc-patches; +Cc: Juzhe-Zhong
Obvious fix, Committed.
gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc: replace std::max by MAX.
---
gcc/config/riscv/riscv-vsetvl.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc
index 7d748edc0ef..df7ed149388 100644
--- a/gcc/config/riscv/riscv-vsetvl.cc
+++ b/gcc/config/riscv/riscv-vsetvl.cc
@@ -1668,7 +1668,7 @@ private:
}
inline void use_max_sew (vsetvl_info &prev, const vsetvl_info &next)
{
- auto max_sew = std::max (prev.get_sew (), next.get_sew ());
+ int max_sew = MAX (prev.get_sew (), next.get_sew ());
prev.set_sew (max_sew);
use_min_of_max_sew (prev, next);
}
@@ -1702,7 +1702,7 @@ private:
inline void use_max_sew_and_lmul_with_prev_ratio (vsetvl_info &prev,
const vsetvl_info &next)
{
- auto max_sew = std::max (prev.get_sew (), next.get_sew ());
+ int max_sew = MAX (prev.get_sew (), next.get_sew ());
prev.set_vlmul (calculate_vlmul (max_sew, prev.get_ratio ()));
prev.set_sew (max_sew);
}
--
2.36.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS]
2024-01-07 0:36 [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS] Juzhe-Zhong
@ 2024-01-07 19:11 ` Jeff Law
2024-01-07 23:07 ` 钟居哲
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Law @ 2024-01-07 19:11 UTC (permalink / raw)
To: Juzhe-Zhong, gcc-patches
On 1/6/24 17:36, Juzhe-Zhong wrote:
> Obvious fix, Committed.
>
> gcc/ChangeLog:
>
> * config/riscv/riscv-vsetvl.cc: replace std::max by MAX.
Curious why you made this change -- in general we're moving to
std::{min,max,swap} and away from macro-ized min/max/swap.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Re: [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS]
2024-01-07 19:11 ` Jeff Law
@ 2024-01-07 23:07 ` 钟居哲
2024-01-09 14:38 ` Jeff Law
0 siblings, 1 reply; 4+ messages in thread
From: 钟居哲 @ 2024-01-07 23:07 UTC (permalink / raw)
To: Jeff Law, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 851 bytes --]
Since in the previous review from Robin, he have ever asked me change std::max into MAX,
I thought the policy is preferring MAX instead of std::max.
I change the codes to make them consistent but it seems I am wrong.
So is it reasonable that I change all RVV-related codes back to use std::max/min ?
If yes, I can send a patch to adapt all of them in RVV related codes.
juzhe.zhong@rivai.ai
From: Jeff Law
Date: 2024-01-08 03:11
To: Juzhe-Zhong; gcc-patches
Subject: Re: [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS]
On 1/6/24 17:36, Juzhe-Zhong wrote:
> Obvious fix, Committed.
>
> gcc/ChangeLog:
>
> * config/riscv/riscv-vsetvl.cc: replace std::max by MAX.
Curious why you made this change -- in general we're moving to
std::{min,max,swap} and away from macro-ized min/max/swap.
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS]
2024-01-07 23:07 ` 钟居哲
@ 2024-01-09 14:38 ` Jeff Law
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Law @ 2024-01-09 14:38 UTC (permalink / raw)
To: 钟居哲, gcc-patches
On 1/7/24 16:07, 钟居哲 wrote:
> Since in the previous review from Robin, he have ever asked me change
> std::max into MAX,
> I thought the policy is preferring MAX instead of std::max.
>
> I change the codes to make them consistent but it seems I am wrong.
>
> So is it reasonable that I change all RVV-related codes back to use
> std::max/min ?
>
> If yes, I can send a patch to adapt all of them in RVV related codes.
If Robin asked for MAX, let's leave it as-is. It's not a hard
requirement, just a general direction towards std:: when we can. It may
be the case that with other codes using MAX nearby that keeping
consistency is better.
jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-09 14:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-07 0:36 [Committed] RISC-V: Use MAX instead of std::max [VSETVL PASS] Juzhe-Zhong
2024-01-07 19:11 ` Jeff Law
2024-01-07 23:07 ` 钟居哲
2024-01-09 14:38 ` Jeff Law
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).