Thread overview
[Issue 22161] importC: Support parsing C asm expressions
Jul 30, 2021
Iain Buclaw
Sep 26, 2021
Walter Bright
Sep 26, 2021
Iain Buclaw
Sep 28, 2021
Walter Bright
Feb 10, 2022
Walter Bright
Nov 26, 2022
TheGag96
Nov 26, 2022
TheGag96
Nov 26, 2022
Iain Buclaw
Dec 17, 2022
Iain Buclaw
Apr 01, 2023
Walter Bright
July 30, 2021
https://issues.dlang.org/show_bug.cgi?id=22161

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ImportC, rejects-valid
                 CC|                            |ibuclaw@gdcproject.org

--
September 26, 2021
https://issues.dlang.org/show_bug.cgi?id=22161

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           Severity|major                       |enhancement

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
That's unsurprising as the D asm parser is being used here. Not really sure what to do about it, as duplicating the gcc asm behavior would be a big job.

I'm going to mark this as an Enhancement, as ImportC's mission is to compile C11.

--
September 26, 2021
https://issues.dlang.org/show_bug.cgi?id=22161

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Walter Bright from comment #1)
> That's unsurprising as the D asm parser is being used here. Not really sure what to do about it, as duplicating the gcc asm behavior would be a big job.
> 
> I'm going to mark this as an Enhancement, as ImportC's mission is to compile C11.

The focus for DMD itself may be to make importC follow DMC asm as closely as it makes sense to do so.

https://www.digitalmars.com/ctg/ctgInlineAsm.html

This bug report is more for me (and ldc) though, as all asm code in Posix C headers and sources would be in the GCC style.

--
September 28, 2021
https://issues.dlang.org/show_bug.cgi?id=22161

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
(In reply to Iain Buclaw from comment #2)
> This bug report is more for me (and ldc) though, as all asm code in Posix C headers and sources would be in the GCC style.

I'm surprised the GDC inline asm isn't the same as GCC. I just presumed they were the same. DMC and DMD inline asm differs mainly because I didn't backport the improvements to DMC.

--
February 10, 2022
https://issues.dlang.org/show_bug.cgi?id=22161

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=22722

--
November 26, 2022
https://issues.dlang.org/show_bug.cgi?id=22161

TheGag96 <kipthemudkip@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kipthemudkip@yahoo.com

--- Comment #4 from TheGag96 <kipthemudkip@yahoo.com> ---
Link to Mosquitto library: https://github.com/eclipse/mosquitto

--
November 26, 2022
https://issues.dlang.org/show_bug.cgi?id=22161

--- Comment #5 from TheGag96 <kipthemudkip@yahoo.com> ---
(In reply to TheGag96 from comment #4)
> Link to Mosquitto library: https://github.com/eclipse/mosquitto

Woops, posted this in the wrong bug. Sorry!!

--
November 26, 2022
https://issues.dlang.org/show_bug.cgi?id=22161

--- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Walter Bright from comment #3)
> (In reply to Iain Buclaw from comment #2)
> > This bug report is more for me (and ldc) though, as all asm code in Posix C headers and sources would be in the GCC style.
> 
> I'm surprised the GDC inline asm isn't the same as GCC. I just presumed they were the same. DMC and DMD inline asm differs mainly because I didn't backport the improvements to DMC.
In D, asm is a statement, in C/C++ its an expression.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22161

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
April 01, 2023
https://issues.dlang.org/show_bug.cgi?id=22161

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |LATER

--- Comment #7 from Walter Bright <bugzilla@digitalmars.com> ---
DMD now supports parsing GCC style inline assembler, although it doesn't actually turn it into assembler code - it replaces it with an assert(0).

DMD's inline assembler is derived from DMC's, although the latter does not support 64 bit code or SIMD instructions. I don't recall how different it is for ordinary 32 bit code.

At this point it is not worth worrying about DMC inline asm compatibility, so deferring a decision about it until an actual issue crops up about it.

--