diff options
-rw-r--r-- | gcc/config/riscv/bitmanip.md | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index 7b55528..1544ef4 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -454,7 +454,16 @@ (define_expand "bswapsi2" [(set (match_operand:SI 0 "register_operand") (bswap:SI (match_operand:SI 1 "register_operand")))] - "(!TARGET_64BIT && (TARGET_ZBB || TARGET_ZBKB)) || TARGET_XTHEADBB") + "TARGET_ZBB || TARGET_ZBKB || TARGET_XTHEADBB" +{ + /* Expose bswapsi2 on TARGET_64BIT so that the gimple store + merging pass will create suitable bswap insns. We can actually + just FAIL that case when generating RTL and let the generic code + handle it. */ + if (TARGET_64BIT && !TARGET_XTHEADBB) + FAIL; +}) + (define_insn "*bswap<mode>2" [(set (match_operand:X 0 "register_operand" "=r") |