On Thu, Jul 29, 2021 at 10:49 AM unlvsur unlvsur via Gcc <gcc@gcc.gnu.org> wrote: > > What I mean is that what macro GCC sets when it compiles -masm=intel > > > Int main() > { > #ifdef /*__INTEL_ASM????*/ > printf(“intel”); > #else > printf(“at&t”); > #endif > } not fully understand what you're seeking, probably you're looking for ASSEMBLER_DIALECT.
cut from i386.c --------------- void ix86_print_operand (FILE *file, rtx x, int code) { if (code) { switch (code) { case 'A': switch (ASSEMBLER_DIALECT) { case ASM_ATT: putc ('*', file); break; case ASM_INTEL: /* Intel syntax. For absolute addresses, registers should not be surrounded by braces. */ if (!REG_P (x)) { putc ('[', file); ix86_print_operand (file, x, 0); putc (']', file); return; } break; -------------- > Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 > > From: Andrew Pinski<mailto:pins...@gmail.com> > Sent: Wednesday, July 28, 2021 21:43 > To: unlvsur unlvsur<mailto:unlv...@live.com> > Cc: gcc@gcc.gnu.org<mailto:gcc@gcc.gnu.org> > Subject: Re: How to detect user uses -masm=intel? > > On Wed, Jul 28, 2021 at 6:41 PM unlvsur unlvsur via Gcc <gcc@gcc.gnu.org> > wrote: > > > > Any GCC macro that can tell the code it is using the intel format’s > > assembly instead of at&t?? > > Inside the inline-asm you can use the alternative. > Like this: > cmp{b}\t{%1, %h0|%h0, %1} > > This is how GCC implements this inside too. > > Thanks, > Andrew > > > > > Sent from > > Mail<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=04%7C01%7C%7C9ff9312911b84c6126dc08d952323529%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637631197911449533%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ygQvHY1b7whxaAMvhglHY12E688oc%2F%2BqBe7AKwVQfBs%3D&reserved=0> > > for Windows 10 > > > -- BR, Hongtao