public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC __asm__( … )
@ 2024-04-11 17:21 alines #7777
  2024-04-11 17:35 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: alines #7777 @ 2024-04-11 17:21 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

Hello, I was wondering where I could find the source code for the inline assembly feature of the GCC compiler,
I’ve been having trouble with an assembly instruction for “bswapl” on a i386 computer with GCC version 2.95.
The bswap instruction works fine with it, however bswapl doesn’t let my code compile, whether I use a long long int for its input as i assume or a 32-bit integer. The compiler says that I’m using invalid operands with the instruction, rather than that the instruction doesn’t exist, and I’m hoping to understand what kind of operands would be valid.
Thank you

--

Alines Quasev


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: GCC __asm__( … )
  2024-04-11 17:21 GCC __asm__( … ) alines #7777
@ 2024-04-11 17:35 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2024-04-11 17:35 UTC (permalink / raw)
  To: alines #7777; +Cc: gcc-help

On Thu, 11 Apr 2024 at 18:22, alines #7777 via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hello, I was wondering where I could find the source code for the inline assembly feature of the GCC compiler,

There isn't just one bit of code for it. Search for RID_ASM for where
it's handled by the parser, then you might be able to follow where it
goes next.


> I’ve been having trouble with an assembly instruction for “bswapl” on a i386 computer with GCC version 2.95.
> The bswap instruction works fine with it, however bswapl doesn’t let my code compile, whether I use a long long int for its input as i assume or a 32-bit integer. The compiler says that I’m using invalid operands with the instruction, rather than that the instruction doesn’t exist, and I’m hoping to understand what kind of operands would be valid.

Are you sure it's the compiler giving that error, and not the
assembler, which is not part of GCC at all?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-11 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-11 17:21 GCC __asm__( … ) alines #7777
2024-04-11 17:35 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).