Next: Right Zero Element Promotion, Previous: Right Identity Element Kill, Up: Optimizing Infix Binary Operators [Index]
The identity (or neutral) element is the element that with respect to a binary operation leaves other elements unchanged when combined with them.
The optimization removes the identity element combining operations, for which the identity element is the left operand.
The struct x1f4_1stscope_type
operator definition extension is to
include the
X1f4_E4_LEFT_SKIP
bit in its bits1
bits list field. The
remaining optimization parameters, including the description (value) of the
identity element, are to be introduced via the struct x1f4_operator_type
first extension, in a struct x1f4_sdbl_type
definition. That is, the
extension1
field of the struct x1f4_operator_type
operator
description must point a struct x1f4_1stscope_type
record, whose
sdbl_data
field must point a struct x1f4_sdbl_type
record, in
turn describing the optimization parameters.
See struct x1f4_1stscope_type.
See struct x1f4_operator_type.
See Operator First Extension Scope Flags.
The identity element must be of one of the intrinsic scalar types (integer, real or cardinal).
See Intrinsic Types.
It applies for such operators as the C binary ‘+’, ‘*’.
The optimization transforms expressions like:
0 + e 1 * e ~0 & e
into:
e e e