Thread overview
[Issue 24125] ImportC: vector type initializer not understood
Sep 12, 2023
Walter Bright
Nov 20, 2023
Walter Bright
Nov 21, 2023
Dlang Bot
Nov 23, 2023
Dlang Bot
September 12, 2023
https://issues.dlang.org/show_bug.cgi?id=24125

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
A more complete example:

---
typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));

__m128 test()
{
    return (__m128){ 0.0f, 0.0f, 0.0f, 0.0f };
}
---

--
November 20, 2023
https://issues.dlang.org/show_bug.cgi?id=24125

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
Looks like there are two problems. The first is:

    typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));

This doesn't recognize __m128 as a vector. But this works:

    typedef float __attribute__ ((__vector_size__ (16), __may_alias__)) __m128;

Now __m128 is recognized as a vector. Then it goes on to fail with:

    Error: cannot implicitly convert expression `[0.0F, 0.0F, 0.0F, 0.0F]` of
type `float*` to `__vector(float[4])`

--
November 20, 2023
https://issues.dlang.org/show_bug.cgi?id=24125

--- Comment #3 from Steven Schveighoffer <schveiguy@gmail.com> ---
(In reply to Walter Bright from comment #2)
> Looks like there are two problems. The first is:
> 
>     typedef float __m128 __attribute__ ((__vector_size__ (16),
> __may_alias__));
> 
> This doesn't recognize __m128 as a vector. But this works:
> 
>     typedef float __attribute__ ((__vector_size__ (16), __may_alias__))
> __m128;

I may have copied the header code wrong... I'll double check. That does look more reasonable.

--
November 20, 2023
https://issues.dlang.org/show_bug.cgi?id=24125

--- Comment #4 from Steven Schveighoffer <schveiguy@gmail.com> ---
Hm.. nope, that's the exact code. So that does still need addressing.

--
November 21, 2023
https://issues.dlang.org/show_bug.cgi?id=24125

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #15838 "Fix Issue 24125 - ImportC: vector type initializer not understood" fixing this issue:

- fix Issue 24125 - ImportC: vector type initializer not understood

- fix Issue 24125 - ImportC: vector type initializer not understood

https://github.com/dlang/dmd/pull/15838

--
November 23, 2023
https://issues.dlang.org/show_bug.cgi?id=24125

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15838 "Fix Issue 24125 - ImportC: vector type initializer not understood" was merged into master:

- 785a5a6dd2d87bba88a46d4ab8b5816309cef9f2 by Walter Bright:
  fix Issue 24125 - ImportC: vector type initializer not understood

- eca6b07f424fe726a53596f31dc0a4860faec771 by Walter Bright:
  fix Issue 24125 - ImportC: vector type initializer not understood

https://github.com/dlang/dmd/pull/15838

--