nickdesaulniers created this revision. Herald added a project: All. nickdesaulniers requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Also move the line about __has_extension(gnu_asm_goto_with_outputs) so that it is more generally about asm goto, not the paragraph on symbolic references. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D143205 Files: clang/docs/LanguageExtensions.rst clang/include/clang/Basic/Features.def clang/test/Parser/asm-goto.c Index: clang/test/Parser/asm-goto.c =================================================================== --- clang/test/Parser/asm-goto.c +++ clang/test/Parser/asm-goto.c @@ -7,6 +7,9 @@ #if !__has_extension(gnu_asm_goto_with_outputs) #error Extension 'gnu_asm_goto_with_outputs' should be available by default #endif +#if !__has_extension(gnu_asm_goto_with_outputs_full) +#error Extension 'gnu_asm_goto_with_outputs_full' should be available by default +#endif int a, b, c, d, e, f, g, h, i, j, k, l; Index: clang/include/clang/Basic/Features.def =================================================================== --- clang/include/clang/Basic/Features.def +++ clang/include/clang/Basic/Features.def @@ -268,6 +268,7 @@ EXTENSION(statement_attributes_with_gnu_syntax, true) EXTENSION(gnu_asm, LangOpts.GNUAsm) EXTENSION(gnu_asm_goto_with_outputs, LangOpts.GNUAsm) +EXTENSION(gnu_asm_goto_with_outputs_full, LangOpts.GNUAsm) EXTENSION(matrix_types, LangOpts.MatrixTypes) EXTENSION(matrix_types_scalar_division, true) EXTENSION(cxx_attributes_on_using_declarations, LangOpts.CPlusPlus11) Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -1583,6 +1583,12 @@ Outputs may be used along any branches from the ``asm goto`` whether the branches are taken or not. +Query for this feature with ``__has_extension(gnu_asm_goto_with_outputs)``. + +Prior to clang-16, the output may only be used safely when the indirect +branches are not taken. Query for this difference with +``__has_extension(gnu_asm_goto_with_outputs_full)``. + When using tied-outputs (i.e. outputs that are inputs and outputs, not just outputs) with the `+r` constraint, there is a hidden input that's created before the label, so numeric references to operands must account for that. @@ -1610,8 +1616,6 @@ return -1; } -Query for this feature with ``__has_extension(gnu_asm_goto_with_outputs)``. - Objective-C Features ====================
Index: clang/test/Parser/asm-goto.c =================================================================== --- clang/test/Parser/asm-goto.c +++ clang/test/Parser/asm-goto.c @@ -7,6 +7,9 @@ #if !__has_extension(gnu_asm_goto_with_outputs) #error Extension 'gnu_asm_goto_with_outputs' should be available by default #endif +#if !__has_extension(gnu_asm_goto_with_outputs_full) +#error Extension 'gnu_asm_goto_with_outputs_full' should be available by default +#endif int a, b, c, d, e, f, g, h, i, j, k, l; Index: clang/include/clang/Basic/Features.def =================================================================== --- clang/include/clang/Basic/Features.def +++ clang/include/clang/Basic/Features.def @@ -268,6 +268,7 @@ EXTENSION(statement_attributes_with_gnu_syntax, true) EXTENSION(gnu_asm, LangOpts.GNUAsm) EXTENSION(gnu_asm_goto_with_outputs, LangOpts.GNUAsm) +EXTENSION(gnu_asm_goto_with_outputs_full, LangOpts.GNUAsm) EXTENSION(matrix_types, LangOpts.MatrixTypes) EXTENSION(matrix_types_scalar_division, true) EXTENSION(cxx_attributes_on_using_declarations, LangOpts.CPlusPlus11) Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -1583,6 +1583,12 @@ Outputs may be used along any branches from the ``asm goto`` whether the branches are taken or not. +Query for this feature with ``__has_extension(gnu_asm_goto_with_outputs)``. + +Prior to clang-16, the output may only be used safely when the indirect +branches are not taken. Query for this difference with +``__has_extension(gnu_asm_goto_with_outputs_full)``. + When using tied-outputs (i.e. outputs that are inputs and outputs, not just outputs) with the `+r` constraint, there is a hidden input that's created before the label, so numeric references to operands must account for that. @@ -1610,8 +1616,6 @@ return -1; } -Query for this feature with ``__has_extension(gnu_asm_goto_with_outputs)``. - Objective-C Features ====================
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits