]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Refactor the or pattern to switch cases
authorPan Li <pan2.li@intel.com>
Sun, 14 May 2023 08:15:11 +0000 (16:15 +0800)
committerPan Li <pan2.li@intel.com>
Sun, 14 May 2023 09:03:25 +0000 (17:03 +0800)
commit1871740c7803c2aea20f651f57b413bc425a051c
treec4f8a0f3b6dc48ca16adf37df2bec86711f7b482
parentc34cede1f2ade4081b5aa72e01ba74d88d1e617f
RISC-V: Refactor the or pattern to switch cases

This patch refactor the pattern A or B or C or D, to the switch case for
easy add/remove new types, as well as human reading friendly.

Before this patch:
return A || B || C || D;

After this patch:
switch (type)
  {
    case A:
    case B:
    case C:
    case D:
      return true;
    default:
      return false;
  }

Signed-off-by: Pan Li <pan2.li@intel.com>
gcc/ChangeLog:

* config/riscv/riscv-vector-builtins.cc (required_extensions_p):
Refactor the or pattern to switch cases.
gcc/config/riscv/riscv-vector-builtins.cc
This page took 0.058421 seconds and 5 git commands to generate.