This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use predicates for RTL objects


Here's the patches split up. The ones that say autogenerated were
generated from the script below.

I haven't included that as a patch yet since not sure about the
copyright/licensing boilerplate to insert in it.

contrib/rtl-pred.sh:

#!/bin/sh

# codes="CONST_INT|CONST_WIDE_INT|CONST_FIXED|CONST_DOUBLE|CONST_VECTOR|CONST_STRING|REG|SUBREG|MEM|LABEL_REF|SYMBOL_REF|DEBUG_INSN"

if test $# != 1 -a $# != 2; then
	echo "Usage: $0 <RTX_CODE> [<RTX_PREDICATE>]" >&2
	exit 1
fi

rtx_code="$1"
rtx_pred="$2"

if [ "x${rtx_pred}" == "x" ]; then
	rtx_pred=${rtx_code}
fi

find . -path ./testsuite -prune -o -type f -regex '.*\.\(c\|cc\|h\|md\)' \! -path ./rtl.h -print | xargs \
	perl -pi -e 's/\bGET_CODE[ ]?(\((?:(?>[^()]+)|(?1))*\)) (?|(!)=|==) ('${rtx_code}')\b/$2'${rtx_pred}'_P $1/g'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]