[2/7] riscv: bitmanip/zbb: Add prefix/postfix and enable visiblity

Message ID 20221113230521.712693-3-christoph.muellner@vrull.eu
State Unresolved
Headers
Series riscv: Improve builtins expansion |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Christoph Müllner Nov. 13, 2022, 11:05 p.m. UTC
  From: Christoph Müllner <christoph.muellner@vrull.eu>

INSNs are usually postfixed by a number representing the argument count.
Given the instructions will be used in a later commit, let's make them
visible, but add a "riscv_" prefix to avoid conflicts with standard
INSNs.

gcc/ChangeLog:

	* config/riscv/bitmanip.md (*<optab>_not<mode>): Rename INSN.
	(riscv_<optab>_not<mode>3): Rename INSN.
	(*xor_not<mode>): Rename INSN.
	(xor_not<mode>3): Rename INSN.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
 gcc/config/riscv/bitmanip.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jeff Law Nov. 14, 2022, 4:55 p.m. UTC | #1
On 11/13/22 16:05, Christoph Muellner wrote:
> From: Christoph Müllner <christoph.muellner@vrull.eu>
>
> INSNs are usually postfixed by a number representing the argument count.
> Given the instructions will be used in a later commit, let's make them
> visible, but add a "riscv_" prefix to avoid conflicts with standard
> INSNs.
>
> gcc/ChangeLog:
>
> 	* config/riscv/bitmanip.md (*<optab>_not<mode>): Rename INSN.
> 	(riscv_<optab>_not<mode>3): Rename INSN.
> 	(*xor_not<mode>): Rename INSN.
> 	(xor_not<mode>3): Rename INSN.

Not strictly necessary, but given how often I've seen ports expose an 
insn with a standard name, but ever so slightly different semantics and 
the ensuing code correctness issues, I like the idea of prefixing.


OK

jeff
  

Patch

diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index 3dbe6002974..d6d94e5cdf8 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -119,7 +119,7 @@  (define_insn "*slliuw"
 
 ;; ZBB extension.
 
-(define_insn "*<optab>_not<mode>"
+(define_insn "riscv_<optab>_not<mode>3"
   [(set (match_operand:X 0 "register_operand" "=r")
         (bitmanip_bitwise:X (not:X (match_operand:X 1 "register_operand" "r"))
                             (match_operand:X 2 "register_operand" "r")))]
@@ -128,7 +128,7 @@  (define_insn "*<optab>_not<mode>"
   [(set_attr "type" "bitmanip")
    (set_attr "mode" "<X:MODE>")])
 
-(define_insn "*xor_not<mode>"
+(define_insn "riscv_xor_not<mode>3"
   [(set (match_operand:X 0 "register_operand" "=r")
         (not:X (xor:X (match_operand:X 1 "register_operand" "r")
                       (match_operand:X 2 "register_operand" "r"))))]