===================================================================
@@ -7410,6 +7410,18 @@
when the relevant string is @code{NULL}.
@end deftypefn
+@deftypefn {Target Hook} bool TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA (FILE *@var{file}, rtx @var{x})
+A target hook to recognize @var{rtx} patterns that @code{output_addr_const}
+can't deal with, and output assembly code to @var{file} corresponding to
+the pattern @var{x}. This may be used to allow machine-dependent
+@code{UNSPEC}s to appear within constants.
+
+If target hook fails to recognize a pattern, it must return @code{false},
+so that a standard error message is printed. If it prints an error message
+itself, by calling, for example, @code{output_operand_lossage}, it may just
+return @code{true}.
+@end deftypefn
+
@defmac OUTPUT_ADDR_CONST_EXTRA (@var{stream}, @var{x}, @var{fail})
A C statement to recognize @var{rtx} patterns that
@code{output_addr_const} can't deal with, and output assembly code to
===================================================================
@@ -7401,6 +7401,18 @@
when the relevant string is @code{NULL}.
@end deftypefn
+@hook TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
+A target hook to recognize @var{rtx} patterns that @code{output_addr_const}
+can't deal with, and output assembly code to @var{file} corresponding to
+the pattern @var{x}. This may be used to allow machine-dependent
+@code{UNSPEC}s to appear within constants.
+
+If target hook fails to recognize a pattern, it must return @code{false},
+so that a standard error message is printed. If it prints an error message
+itself, by calling, for example, @code{output_operand_lossage}, it may just
+return @code{true}.
+@end deftypefn
+
@defmac OUTPUT_ADDR_CONST_EXTRA (@var{stream}, @var{x}, @var{fail})
A C statement to recognize @var{rtx} patterns that
@code{output_addr_const} can't deal with, and output assembly code to
===================================================================
@@ -356,6 +356,21 @@
#endif
}
+/* The default implementation of TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. */
+
+bool
+default_asm_output_addr_const_extra (FILE *file ATTRIBUTE_UNUSED,
+ rtx x ATTRIBUTE_UNUSED)
+{
+#ifdef OUTPUT_ADDR_CONST_EXTRA
+ OUTPUT_ADDR_CONST_EXTRA (file, x, fail);
+ return true;
+
+fail:
+#endif
+ return false;
+}
+
/* True if MODE is valid for the target. By "valid", we mean able to
be manipulated in non-trivial ways. In particular, this means all
the arithmetic is supported.
===================================================================
@@ -65,6 +65,7 @@
extern void default_print_operand (FILE *, rtx, int);
extern void default_print_operand_address (FILE *, rtx);
extern bool default_print_operand_punct_valid_p (unsigned char);
+extern bool default_asm_output_addr_const_extra (FILE *, rtx);
extern bool default_scalar_mode_supported_p (enum machine_mode);
extern bool default_decimal_float_supported_p (void);
===================================================================
@@ -415,6 +415,12 @@
void ,(FILE *file, const char *name),
default_asm_output_source_filename)
+DEFHOOK
+(output_addr_const_extra,
+ "",
+ bool, (FILE *file, rtx x),
+ default_asm_output_addr_const_extra)
+
/* ??? The TARGET_PRINT_OPERAND* hooks are part of the asm_out struct,
even though that is not reflected in the macro name to override their
initializers. */
===================================================================
@@ -3620,12 +3620,9 @@
break;
default:
-#ifdef OUTPUT_ADDR_CONST_EXTRA
- OUTPUT_ADDR_CONST_EXTRA (file, x, fail);
- break;
+ if (targetm.asm_out.output_addr_const_extra (file, x))
+ break;
- fail:
-#endif
output_operand_lossage ("invalid expression as operand");
}
}
===================================================================
@@ -2117,12 +2117,6 @@
"call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \
TEXT_SECTION_ASM_OP);
-#define OUTPUT_ADDR_CONST_EXTRA(FILE, X, FAIL) \
-do { \
- if (! output_addr_const_extra (FILE, (X))) \
- goto FAIL; \
-} while (0);
-
/* Which processor to schedule for. The cpu attribute defines a list that
mirrors this list, so changes to i386.md must be made at the same time. */
===================================================================
@@ -62,7 +62,6 @@
extern void print_reg (rtx, int, FILE*);
extern void ix86_print_operand (FILE *, rtx, int);
-extern bool output_addr_const_extra (FILE*, rtx);
extern void split_di (rtx[], int, rtx[], rtx[]);
extern void split_ti (rtx[], int, rtx[], rtx[]);
===================================================================
@@ -13124,8 +13124,10 @@
}
}
-bool
-output_addr_const_extra (FILE *file, rtx x)
+/* Implementation of TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA. */
+
+static bool
+i386_asm_output_addr_const_extra (FILE *file, rtx x)
{
rtx op;
@@ -31539,6 +31541,8 @@
#define TARGET_PRINT_OPERAND_ADDRESS ix86_print_operand_address
#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P
#define TARGET_PRINT_OPERAND_PUNCT_VALID_P ix86_print_operand_punct_valid_p
+#undef TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA
+#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA i386_asm_output_addr_const_extra
#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST ix86_adjust_cost