Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1416733 > unrolled thread
| Started by | "H. Peter Anvin" <hpa@linux.intel.com> |
|---|---|
| First post | 2016-06-08 01:40 +0200 |
| Last post | 2016-06-08 21:40 +0200 |
| Articles | 6 — 5 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 04/10] x86, asm: define CC_SET() and CC_OUT() macros "H. Peter Anvin" <hpa@linux.intel.com> - 2016-06-08 01:40 +0200
[tip:x86/asm] x86, asm: define CC_SET() and CC_OUT() macros "tip-bot for H. Peter Anvin" <tipbot@zytor.com> - 2016-06-08 01:50 +0200
Re: [PATCH 04/10] x86, asm: define CC_SET() and CC_OUT() macros Andy Lutomirski <luto@amacapital.net> - 2016-06-08 07:10 +0200
Re: [PATCH 04/10] x86, asm: define CC_SET() and CC_OUT() macros "H. Peter Anvin" <hpa@zytor.com> - 2016-06-08 21:40 +0200
Re: [PATCH 04/10] x86, asm: define CC_SET() and CC_OUT() macros "H. Peter Anvin" <hpa@linux.intel.com> - 2016-06-08 21:40 +0200
Re: [PATCH 04/10] x86, asm: define CC_SET() and CC_OUT() macros Borislav Petkov <bp@alien8.de> - 2016-06-08 21:40 +0200
| From | "H. Peter Anvin" <hpa@linux.intel.com> |
|---|---|
| Date | 2016-06-08 01:40 +0200 |
| Subject | [PATCH 04/10] x86, asm: define CC_SET() and CC_OUT() macros |
| Message-ID | <rHyLf-GT-11@gated-at.bofh.it> |
From: "H. Peter Anvin" <hpa@zytor.com> The CC_SET() and CC_OUT() macros can be used together to take advantage of the new __GCC_ASM_FLAG_OUTPUTS__ feature in gcc 6+ while remaining backwards compatible. CC_SET() generates a SET instruction on older compilers; CC_OUT() makes sure the output is received in the correct variable. Signed-off-by: H. Peter Anvin <hpa@zytor.com> --- arch/x86/include/asm/asm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index f5063b6..7acb51c 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -42,6 +42,18 @@ #define _ASM_SI __ASM_REG(si) #define _ASM_DI __ASM_REG(di) +/* + * Macros to generate condition code outputs from inline assembly, + * The output operand must be type "bool". + */ +#ifdef __GCC_ASM_FLAG_OUTPUTS__ +# define CC_SET(c) "\n\t/* output condition code " #c "*/\n" +# define CC_OUT(c) "=@cc" #c +#else +# define CC_SET(c) "\n\tset" #c " %[_cc_" #c "]\n" +# define CC_OUT(c) [_cc_ ## c] "=qm" +#endif + /* Exception table entry */ #ifdef __ASSEMBLY__ # define _ASM_EXTABLE_HANDLE(from, to, handler) \ -- 2.7.3.0.11.gd79db92
[toc] | [next] | [standalone]
| From | "tip-bot for H. Peter Anvin" <tipbot@zytor.com> |
|---|---|
| Date | 2016-06-08 01:50 +0200 |
| Subject | [tip:x86/asm] x86, asm: define CC_SET() and CC_OUT() macros |
| Message-ID | <rHyUV-KQ-13@gated-at.bofh.it> |
| In reply to | #1416733 |
Commit-ID: 2d81d0e1bd0f48049a6a6e289c937bc24c98649e Gitweb: http://git.kernel.org/tip/2d81d0e1bd0f48049a6a6e289c937bc24c98649e Author: H. Peter Anvin <hpa@zytor.com> AuthorDate: Tue, 7 Jun 2016 16:31:03 -0700 Committer: H. Peter Anvin <hpa@linux.intel.com> CommitDate: Tue, 7 Jun 2016 16:36:42 -0700 x86, asm: define CC_SET() and CC_OUT() macros The CC_SET() and CC_OUT() macros can be used together to take advantage of the new __GCC_ASM_FLAG_OUTPUTS__ feature in gcc 6+ while remaining backwards compatible. CC_SET() generates a SET instruction on older compilers; CC_OUT() makes sure the output is received in the correct variable. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Link: http://lkml.kernel.org/r/1465342269-492350-5-git-send-email-hpa@linux.intel.com --- arch/x86/include/asm/asm.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index f5063b6..7acb51c 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -42,6 +42,18 @@ #define _ASM_SI __ASM_REG(si) #define _ASM_DI __ASM_REG(di) +/* + * Macros to generate condition code outputs from inline assembly, + * The output operand must be type "bool". + */ +#ifdef __GCC_ASM_FLAG_OUTPUTS__ +# define CC_SET(c) "\n\t/* output condition code " #c "*/\n" +# define CC_OUT(c) "=@cc" #c +#else +# define CC_SET(c) "\n\tset" #c " %[_cc_" #c "]\n" +# define CC_OUT(c) [_cc_ ## c] "=qm" +#endif + /* Exception table entry */ #ifdef __ASSEMBLY__ # define _ASM_EXTABLE_HANDLE(from, to, handler) \
[toc] | [prev] | [next] | [standalone]
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Date | 2016-06-08 07:10 +0200 |
| Message-ID | <rHDUB-4ax-5@gated-at.bofh.it> |
| In reply to | #1416733 |
On Tue, Jun 7, 2016 at 4:31 PM, H. Peter Anvin <hpa@linux.intel.com> wrote: > From: "H. Peter Anvin" <hpa@zytor.com> > > The CC_SET() and CC_OUT() macros can be used together to take > advantage of the new __GCC_ASM_FLAG_OUTPUTS__ feature in gcc 6+ while > remaining backwards compatible. CC_SET() generates a SET instruction > on older compilers; CC_OUT() makes sure the output is received in the > correct variable. Nice. Reviewed-by: Andy Lutomirski <luto@kernel.org>
[toc] | [prev] | [next] | [standalone]
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Date | 2016-06-08 21:40 +0200 |
| Message-ID | <rHRux-4jK-13@gated-at.bofh.it> |
| In reply to | #1416869 |
On 06/07/16 22:09, Andy Lutomirski wrote: > On Tue, Jun 7, 2016 at 4:31 PM, H. Peter Anvin <hpa@linux.intel.com> wrote: >> From: "H. Peter Anvin" <hpa@zytor.com> >> >> The CC_SET() and CC_OUT() macros can be used together to take >> advantage of the new __GCC_ASM_FLAG_OUTPUTS__ feature in gcc 6+ while >> remaining backwards compatible. CC_SET() generates a SET instruction >> on older compilers; CC_OUT() makes sure the output is received in the >> correct variable. > > Nice. > > Reviewed-by: Andy Lutomirski <luto@kernel.org> > Did you mean this for the entire patch series or for this one patch only? I want to make sure to add the proper tags for the repost. -hpa
[toc] | [prev] | [next] | [standalone]
| From | "H. Peter Anvin" <hpa@linux.intel.com> |
|---|---|
| Date | 2016-06-08 21:40 +0200 |
| Message-ID | <rHRux-4jK-15@gated-at.bofh.it> |
| In reply to | #1417794 |
On 06/08/16 12:29, H. Peter Anvin wrote: > On 06/07/16 22:09, Andy Lutomirski wrote: >> On Tue, Jun 7, 2016 at 4:31 PM, H. Peter Anvin <hpa@linux.intel.com> wrote: >>> From: "H. Peter Anvin" <hpa@zytor.com> >>> >>> The CC_SET() and CC_OUT() macros can be used together to take >>> advantage of the new __GCC_ASM_FLAG_OUTPUTS__ feature in gcc 6+ while >>> remaining backwards compatible. CC_SET() generates a SET instruction >>> on older compilers; CC_OUT() makes sure the output is received in the >>> correct variable. >> >> Nice. >> >> Reviewed-by: Andy Lutomirski <luto@kernel.org> >> > > Did you mean this for the entire patch series or for this one patch > only? I want to make sure to add the proper tags for the repost. > (I'm going to assume for now that you meant the whole patch series.) -hpa
[toc] | [prev] | [next] | [standalone]
| From | Borislav Petkov <bp@alien8.de> |
|---|---|
| Date | 2016-06-08 21:40 +0200 |
| Message-ID | <rHRuy-4jK-27@gated-at.bofh.it> |
| In reply to | #1417795 |
On Wed, Jun 08, 2016 at 12:34:05PM -0700, H. Peter Anvin wrote:
> (I'm going to assume for now that you meant the whole patch series.)
Same from me:
Reviewed-by: Borislav Petkov <bp@suse.de>
--
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web