Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-18 Thread Xi Ruoyao
On Thu, 2024-07-18 at 20:41 +0800, Xi Ruoyao wrote: > On Thu, 2024-07-18 at 19:54 +0800, Xi Ruoyao wrote: > > On Tue, 2024-07-09 at 22:29 -0600, Jeff Law wrote: > > > > > > > > > On 7/9/24 8:35 PM, Xi Ruoyao wrote: > > > > On Mon, 2024-07-08 at 15:03 -0600, Jeff Law wrote: > > > > > So I would us

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-18 Thread Xi Ruoyao
On Thu, 2024-07-18 at 19:54 +0800, Xi Ruoyao wrote: > On Tue, 2024-07-09 at 22:29 -0600, Jeff Law wrote: > > > > > > On 7/9/24 8:35 PM, Xi Ruoyao wrote: > > > On Mon, 2024-07-08 at 15:03 -0600, Jeff Law wrote: > > > > So I would use tmp (or another word_mode pseudo register) for the > > > > desti

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-18 Thread Xi Ruoyao
On Tue, 2024-07-09 at 22:29 -0600, Jeff Law wrote: > > > On 7/9/24 8:35 PM, Xi Ruoyao wrote: > > On Mon, 2024-07-08 at 15:03 -0600, Jeff Law wrote: > > > So I would use tmp (or another word_mode pseudo register) for the > > > destination of that emit_insn.   Then something like: > > > > > >

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Xi Ruoyao
On Tue, 2024-07-09 at 20:21 -0600, Jeff Law wrote: > > > On 7/9/24 8:14 PM, Xi Ruoyao wrote: > > On Tue, 2024-07-09 at 16:10 -0700, Vineet Gupta wrote: > > > On 7/3/24 21:35, Xi Ruoyao wrote: > > > > On Sun, 2024-06-30 at 17:47 -0700, Vineet Gupta wrote: > > > > >    - Don't hardcode SI in patter

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Jeff Law
On 7/9/24 8:35 PM, Xi Ruoyao wrote: On Mon, 2024-07-08 at 15:03 -0600, Jeff Law wrote: So I would use tmp (or another word_mode pseudo register) for the destination of that emit_insn.   Then something like:    t = gen_lowpart (SImode, tmp);    SUBREG_PROMOTED_VAR_P (tmp) = 1;

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Xi Ruoyao
On Mon, 2024-07-08 at 15:03 -0600, Jeff Law wrote: > So I would use tmp (or another word_mode pseudo register) for the > destination of that emit_insn.   Then something like: > >    t = gen_lowpart (SImode, tmp); >    SUBREG_PROMOTED_VAR_P (tmp) = 1; >    SUBREG_PROMOTED_SET (tmp, SRP

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Jeff Law
On 7/9/24 8:14 PM, Xi Ruoyao wrote: On Tue, 2024-07-09 at 16:10 -0700, Vineet Gupta wrote: On 7/3/24 21:35, Xi Ruoyao wrote: On Sun, 2024-06-30 at 17:47 -0700, Vineet Gupta wrote:   - Don't hardcode SI in patterns, try to keep X to avoid potential     sign extension pitfalls. Implementati

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Xi Ruoyao
On Tue, 2024-07-09 at 16:10 -0700, Vineet Gupta wrote: > On 7/3/24 21:35, Xi Ruoyao wrote: > > On Sun, 2024-06-30 at 17:47 -0700, Vineet Gupta wrote: > > >   - Don't hardcode SI in patterns, try to keep X to avoid potential > > >     sign extension pitfalls. Implementation wise requires skipping >

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread HAO CHEN GUI
Hi, 在 2024/7/10 8:04, Vineet Gupta 写道: > So it seems initial versions of the patch didn't specify anything about > output mode. Richi asked for it in review and in v4 Hao added it. > But I don't see anyone asking specifically for SImode. > I guess that can be relaxed. Hao do you have any inputs he

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Vineet Gupta
+CC Hao Chen Gui On 7/9/24 16:21, Jeff Law wrote:   - Don't hardcode SI in patterns, try to keep X to avoid potential     sign extension pitfalls. Implementation wise requires skipping     :MODE specifier in match_operand which is flagged as missing mode     warning. >>> I'

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Jeff Law
On 7/9/24 5:10 PM, Vineet Gupta wrote: On 7/3/24 21:35, Xi Ruoyao wrote: On Sun, 2024-06-30 at 17:47 -0700, Vineet Gupta wrote:   - Don't hardcode SI in patterns, try to keep X to avoid potential     sign extension pitfalls. Implementation wise requires skipping     :MODE specifier in mat

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Vineet Gupta
On 7/3/24 21:35, Xi Ruoyao wrote: > On Sun, 2024-06-30 at 17:47 -0700, Vineet Gupta wrote: >>   - Don't hardcode SI in patterns, try to keep X to avoid potential >>     sign extension pitfalls. Implementation wise requires skipping >>     :MODE specifier in match_operand which is flagged as missing

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-09 Thread Vineet Gupta
On 7/8/24 14:03, Jeff Law wrote: > > On 6/30/24 6:47 PM, Vineet Gupta wrote: >> Changes since v1: >>- Removed UNSPEC_{INFINITE,ISNORMAL} >>- Don't hardcode SI in patterns, try to keep X to avoid potential >> sign extension pitfalls. Implementation wise requires skipping >> :MODE s

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-08 Thread Jeff Law
On 6/30/24 6:47 PM, Vineet Gupta wrote: Changes since v1: - Removed UNSPEC_{INFINITE,ISNORMAL} - Don't hardcode SI in patterns, try to keep X to avoid potential sign extension pitfalls. Implementation wise requires skipping :MODE specifier in match_operand which is flagged as m

Re: [PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-07-03 Thread Xi Ruoyao
On Sun, 2024-06-30 at 17:47 -0700, Vineet Gupta wrote: >   - Don't hardcode SI in patterns, try to keep X to avoid potential >     sign extension pitfalls. Implementation wise requires skipping >     :MODE specifier in match_operand which is flagged as missing mode >     warning. I'm unsure about

[PATCH v2] RISC-V: use fclass insns to implement isfinite and isnormal builtins

2024-06-30 Thread Vineet Gupta
Changes since v1: - Removed UNSPEC_{INFINITE,ISNORMAL} - Don't hardcode SI in patterns, try to keep X to avoid potential sign extension pitfalls. Implementation wise requires skipping :MODE specifier in match_operand which is flagged as missing mode warning. --- Currently isfinite