public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] riscv: thead: Fix mode attribute for extension patterns
@ 2023-09-08  6:16 Christoph Muellner
  2023-09-08  8:13 ` Kito Cheng
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Muellner @ 2023-09-08  6:16 UTC (permalink / raw)
  To: gcc-patches, Kito Cheng, Jim Wilson, Palmer Dabbelt,
	Andrew Waterman, Philipp Tomsich, Jeff Law
  Cc: Christoph Müllner

From: Christoph Müllner <christoph.muellner@vrull.eu>

The mode attribute of an extension pattern is usually set to the target type.
Let's follow this convention consistently for xtheadbb.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>

gcc/ChangeLog:

	* config/riscv/thead.md: Use more appropriate mode attributes
	for extensions.
---
 gcc/config/riscv/thead.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/riscv/thead.md b/gcc/config/riscv/thead.md
index 05d1b32bd94..2287b752ea1 100644
--- a/gcc/config/riscv/thead.md
+++ b/gcc/config/riscv/thead.md
@@ -101,7 +101,7 @@ (define_insn "*zero_extendsidi2_th_extu"
    th.extu\t%0,%1,31,0
    lwu\t%0,%1"
   [(set_attr "type" "bitmanip,load")
-   (set_attr "mode" "SI")])
+   (set_attr "mode" "DI")])
 
 (define_insn "*zero_extendhi<GPR:mode>2_th_extu"
   [(set (match_operand:GPR 0 "register_operand" "=r,r")
@@ -111,7 +111,7 @@ (define_insn "*zero_extendhi<GPR:mode>2_th_extu"
    th.extu\t%0,%1,15,0
    lhu\t%0,%1"
   [(set_attr "type" "bitmanip,load")
-   (set_attr "mode" "HI")])
+   (set_attr "mode" "<GPR:MODE>")])
 
 (define_insn "*th_clz<mode>2"
   [(set (match_operand:X 0 "register_operand" "=r")
-- 
2.41.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] riscv: thead: Fix mode attribute for extension patterns
  2023-09-08  6:16 [PATCH] riscv: thead: Fix mode attribute for extension patterns Christoph Muellner
@ 2023-09-08  8:13 ` Kito Cheng
  2023-09-08 11:29   ` Philipp Tomsich
  0 siblings, 1 reply; 3+ messages in thread
From: Kito Cheng @ 2023-09-08  8:13 UTC (permalink / raw)
  To: Christoph Muellner
  Cc: GCC Patches, Kito Cheng, Jim Wilson, Palmer Dabbelt,
	Andrew Waterman, Philipp Tomsich, Jeff Law

[-- Attachment #1: Type: text/plain, Size: 1460 bytes --]

LGTM

Christoph Muellner <christoph.muellner@vrull.eu> 於 2023年9月8日 週五 14:16 寫道:

> From: Christoph Müllner <christoph.muellner@vrull.eu>
>
> The mode attribute of an extension pattern is usually set to the target
> type.
> Let's follow this convention consistently for xtheadbb.
>
> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
>
> gcc/ChangeLog:
>
>         * config/riscv/thead.md: Use more appropriate mode attributes
>         for extensions.
> ---
>  gcc/config/riscv/thead.md | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/riscv/thead.md b/gcc/config/riscv/thead.md
> index 05d1b32bd94..2287b752ea1 100644
> --- a/gcc/config/riscv/thead.md
> +++ b/gcc/config/riscv/thead.md
> @@ -101,7 +101,7 @@ (define_insn "*zero_extendsidi2_th_extu"
>     th.extu\t%0,%1,31,0
>     lwu\t%0,%1"
>    [(set_attr "type" "bitmanip,load")
> -   (set_attr "mode" "SI")])
> +   (set_attr "mode" "DI")])
>
>  (define_insn "*zero_extendhi<GPR:mode>2_th_extu"
>    [(set (match_operand:GPR 0 "register_operand" "=r,r")
> @@ -111,7 +111,7 @@ (define_insn "*zero_extendhi<GPR:mode>2_th_extu"
>     th.extu\t%0,%1,15,0
>     lhu\t%0,%1"
>    [(set_attr "type" "bitmanip,load")
> -   (set_attr "mode" "HI")])
> +   (set_attr "mode" "<GPR:MODE>")])
>
>  (define_insn "*th_clz<mode>2"
>    [(set (match_operand:X 0 "register_operand" "=r")
> --
> 2.41.0
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] riscv: thead: Fix mode attribute for extension patterns
  2023-09-08  8:13 ` Kito Cheng
@ 2023-09-08 11:29   ` Philipp Tomsich
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Tomsich @ 2023-09-08 11:29 UTC (permalink / raw)
  To: Kito Cheng
  Cc: Christoph Muellner, GCC Patches, Kito Cheng, Jim Wilson,
	Palmer Dabbelt, Andrew Waterman, Jeff Law

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

Applied to master. Thanks!
Philipp.

On Fri, 8 Sept 2023 at 10:13, Kito Cheng <kito.cheng@gmail.com> wrote:

> LGTM
>
> Christoph Muellner <christoph.muellner@vrull.eu> 於 2023年9月8日 週五 14:16 寫道:
>
>> From: Christoph Müllner <christoph.muellner@vrull.eu>
>>
>> The mode attribute of an extension pattern is usually set to the target
>> type.
>> Let's follow this convention consistently for xtheadbb.
>>
>> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
>>
>> gcc/ChangeLog:
>>
>>         * config/riscv/thead.md: Use more appropriate mode attributes
>>         for extensions.
>> ---
>>  gcc/config/riscv/thead.md | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/gcc/config/riscv/thead.md b/gcc/config/riscv/thead.md
>> index 05d1b32bd94..2287b752ea1 100644
>> --- a/gcc/config/riscv/thead.md
>> +++ b/gcc/config/riscv/thead.md
>> @@ -101,7 +101,7 @@ (define_insn "*zero_extendsidi2_th_extu"
>>     th.extu\t%0,%1,31,0
>>     lwu\t%0,%1"
>>    [(set_attr "type" "bitmanip,load")
>> -   (set_attr "mode" "SI")])
>> +   (set_attr "mode" "DI")])
>>
>>  (define_insn "*zero_extendhi<GPR:mode>2_th_extu"
>>    [(set (match_operand:GPR 0 "register_operand" "=r,r")
>> @@ -111,7 +111,7 @@ (define_insn "*zero_extendhi<GPR:mode>2_th_extu"
>>     th.extu\t%0,%1,15,0
>>     lhu\t%0,%1"
>>    [(set_attr "type" "bitmanip,load")
>> -   (set_attr "mode" "HI")])
>> +   (set_attr "mode" "<GPR:MODE>")])
>>
>>  (define_insn "*th_clz<mode>2"
>>    [(set (match_operand:X 0 "register_operand" "=r")
>> --
>> 2.41.0
>>
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-08 11:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08  6:16 [PATCH] riscv: thead: Fix mode attribute for extension patterns Christoph Muellner
2023-09-08  8:13 ` Kito Cheng
2023-09-08 11:29   ` Philipp Tomsich

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).