aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-05-19 09:16:29 +0200
committerJan Beulich <jbeulich@suse.com>2023-05-19 09:16:29 +0200
commit6f5ee7a3e9239cf82142d7abd4b2ad687076cfc1 (patch)
treebf706ecf5efd7dbbfc0907fce21f4cdc45aa6932 /gas/doc
parent762acf217c4013bed5a4cc679e4bac78d13ce23a (diff)
downloadbinutils-6f5ee7a3e9239cf82142d7abd4b2ad687076cfc1.zip
binutils-6f5ee7a3e9239cf82142d7abd4b2ad687076cfc1.tar.gz
binutils-6f5ee7a3e9239cf82142d7abd4b2ad687076cfc1.tar.bz2
gas: invoke md_optimize_expr() also for unary expressions
Give backends a chance to see these, just as they can see binary ones. Most of those which use this hook already cope with NULL being passed for the left operand (typically because of checking the operator first). Adjust the two which don't. Take the opportunity and also document the hook.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/internals.texi8
1 files changed, 8 insertions, 0 deletions
diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi
index 56f10fd..3eea25b 100644
--- a/gas/doc/internals.texi
+++ b/gas/doc/internals.texi
@@ -1047,6 +1047,14 @@ pointer, for any expression that can not be recognized. When the function
is called, @code{input_line_pointer} will point to the start of the
expression.
+@item md_optimize_expr
+@cindex md_optimize_expr
+GAS will call this function before trying to carry out certain operations,
+like the adding of two constants. The function is passed the left-hand
+operand, an @code{expressionS} pointer, the operator, an @code{operatorT}
+value, and the right-hand operand, again an @code{expressionS} pointer. For
+unary expressions NULL is passed as first argument.
+
@item md_register_arithmetic
@cindex md_register_arithmetic
If this macro is defined and evaluates to zero then GAS will not fold