]> gcc.gnu.org Git - gcc.git/commit
middle-end: Add new tbranch optab to add support for bit-test-and-branch operations
authorTamar Christina <tamar.christina@arm.com>
Mon, 12 Dec 2022 15:16:50 +0000 (15:16 +0000)
committerTamar Christina <tamar.christina@arm.com>
Mon, 12 Dec 2022 15:17:24 +0000 (15:17 +0000)
commitdc582d2ef32e2d3723c68d111f4e49607631f34d
tree47d533c626f633e61a78cdc46a2a4dbc59c42951
parent2cba118e538ba0b7582af7f9fb5ba2dfbb772f8e
middle-end: Add new tbranch optab to add support for bit-test-and-branch operations

This adds a new test-and-branch optab that can be used to do a conditional test
of a bit and branch.   This is similar to the cbranch optab but instead can
test any arbitrary bit inside the register.

This patch recognizes boolean comparisons and single bit mask tests.

gcc/ChangeLog:

* dojump.cc (do_jump): Pass along value.
(do_jump_by_parts_greater_rtx): Likewise.
(do_jump_by_parts_zero_rtx): Likewise.
(do_jump_by_parts_equality_rtx): Likewise.
(do_compare_rtx_and_jump): Likewise.
(do_compare_and_jump): Likewise.
* dojump.h (do_compare_rtx_and_jump): New.
* optabs.cc (emit_cmp_and_jump_insn_1): Refactor to take optab to check.
(validate_test_and_branch): New.
(emit_cmp_and_jump_insns): Optiobally take a value, and when value is
supplied then check if it's suitable for tbranch.
* optabs.def (tbranch_eq$a4, tbranch_ne$a4): New.
* doc/md.texi (tbranch_@var{op}@var{mode}4): Document it.
* optabs.h (emit_cmp_and_jump_insns): New.
* tree.h (tree_zero_one_valued_p): New.
gcc/doc/md.texi
gcc/dojump.cc
gcc/dojump.h
gcc/optabs.cc
gcc/optabs.def
gcc/optabs.h
gcc/tree.h
This page took 0.058555 seconds and 5 git commands to generate.