[avr] Use (symbol_ref { code }) in insn length computation.
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
This patch uses the new gensupport feature (review pending) that
allows to provide a block of C++ code in a symbol_ref sub-expression
instead of just a C++ expression:
https://gcc.gnu.org/pipermail/gcc-patches/2024-September/664093.html
Ok for trunk (provided the gensupport part is upstream) ?
Johann
--
AVR: Use (symbol_ref { code }) in attribute "length" computation.
The symbol_ref sub-expression of an insn attribute may host the
body of a C++ function provided (symbol_ref { code }) is used.
gcc/
* config/avr/avr-protos.h (avr_len_op8_set_ZN): Remove.
* config/avr/avr.cc (avr_len_op8_set_ZN): Remove.
* config/avr/avr.md (*op8.for.cczn.<code>): Compute attribute
"length" with the help of a symbol_ref that hosts the body
of a C++ function.
@@ -64,7 +64,6 @@ extern const char *avr_out_extr_not (rtx_insn *, rtx*, int*);
extern const char *avr_out_plus_set_ZN (rtx*, int*);
extern const char *avr_out_plus_set_N (rtx*, int*);
extern const char *avr_out_op8_set_ZN (rtx_code, rtx*, int*);
-extern int avr_len_op8_set_ZN (rtx_code, rtx*);
extern bool avr_op8_ZN_operator (rtx);
extern const char *avr_out_cmp_ext (rtx*, rtx_code, int*);
@@ -8958,18 +8958,6 @@ avr_out_op8_set_ZN (rtx_code code, rtx *xop, int *plen)
}
-/* Used in the "length" attribute of insn "*op8.for.cczn.<code>". */
-
-int
-avr_len_op8_set_ZN (rtx_code code, rtx *xop)
-{
- int len;
- (void) avr_out_op8_set_ZN (code, xop, &len);
-
- return len;
-}
-
-
/* Output bit operation (IOR, AND, XOR) with register XOP[0] and compile
time constant XOP[2]:
@@ -7337,7 +7337,12 @@ (define_insn "*op8.for.cczn.<code>"
return avr_out_op8_set_ZN (<CODE>, operands, nullptr);
}
[(set (attr "length")
- (symbol_ref "avr_len_op8_set_ZN (<CODE>, operands)"))])
+ (symbol_ref
+ {
+ int len;
+ avr_out_op8_set_ZN (<CODE>, operands, &len);
+ return len;
+ }))])
;; Test a single bit in a QI/HI/SImode register.