Clang ms_abi - vectorcall incompatible?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Clang ms_abi - vectorcall incompatible?

Dennis Luehring via cfe-dev
Hello Clang-Dev-People,

currently I'm experimenting with the different target-triples which Clang supports. My current target is: "x86_64-unknown-linux-gnuabi64-elf"
When I write the following code:

int __attribute__((ms_abi, vectorcall)) printf(const char*, ...);

void printAll(double x, int y, double z, int x2, int y2, double z2)
{
        printf("First message!\n");
        printf("%f %i %f %i %i %f\n", x, y, z, x2, y2, z2);
}

The compiler responses:
"vectorcall and ms_abi attributes are not compatible"

I understand the error - but why? What should I do when I want to use the vectorcall windows x86_x64 calling convention?

Kind regards
Björn
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang ms_abi - vectorcall incompatible?

Dennis Luehring via cfe-dev
On Fri, Mar 9, 2018 at 2:28 AM, via cfe-dev <[hidden email]> wrote:

> Hello Clang-Dev-People,
>
> currently I'm experimenting with the different target-triples which Clang
> supports. My current target is: "x86_64-unknown-linux-gnuabi64-elf"
> When I write the following code:
>
> int __attribute__((ms_abi, vectorcall)) printf(const char*, ...);
>
> void printAll(double x, int y, double z, int x2, int y2, double z2)
> {
>         printf("First message!\n");
>         printf("%f %i %f %i %i %f\n", x, y, z, x2, y2, z2);
> }
>
> The compiler responses:
> "vectorcall and ms_abi attributes are not compatible"
>
> I understand the error - but why? What should I do when I want to use the
> vectorcall windows x86_x64 calling convention?

Clang is diagnosing because it treats ms_abi and vectorcall as both
being calling convention attributes and the conventions don't match.
We give the same diagnostic if you attempt to add both stdcall and
cdecl calling conventions to the function. This happens in
handleFunctionTypeAttr() from SemaType.cpp.

GCC accepts ms_abi and vectorcall on the same declaration, so it would
be reasonable for us to do the same. Would you be willing to file a
bug in Bugzilla so we don't lose track of this?

~Aaron

>
> Kind regards
> Björn
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
> Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang ms_abi - vectorcall incompatible?

Dennis Luehring via cfe-dev
Hello Aaron,

thank you for your response. I can open a bug for it in bugzilla - but there is one thing I don't get.

What do I have to type, to declare a function for using the MS ABI version of vectorcall? I figured out, that ms_abi only works for the cdecl calling convention.

On Fri, Mar 9, 2018 at 2:28 AM, via cfe-dev <[hidden email]> wrote:
> Hello Clang-Dev-People,
>
> currently I'm experimenting with the different target-triples which Clang
> supports. My current target is: "x86_64-unknown-linux-gnuabi64-elf"
> When I write the following code:
>
> int __attribute__((ms_abi, vectorcall)) printf(const char*, ...);
>
> void printAll(double x, int y, double z, int x2, int y2, double z2)
> {
>         printf("First message!\n");
>         printf("%f %i %f %i %i %f\n", x, y, z, x2, y2, z2);
> }
>
> The compiler responses:
> "vectorcall and ms_abi attributes are not compatible"
>
> I understand the error - but why? What should I do when I want to use the
> vectorcall windows x86_x64 calling convention?

Clang is diagnosing because it treats ms_abi and vectorcall as both
being calling convention attributes and the conventions don't match.
We give the same diagnostic if you attempt to add both stdcall and
cdecl calling conventions to the function. This happens in
handleFunctionTypeAttr() from SemaType.cpp.

GCC accepts ms_abi and vectorcall on the same declaration, so it would
be reasonable for us to do the same. Would you be willing to file a
bug in Bugzilla so we don't lose track of this?

~Aaron

>
> Kind regards
> Björn
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
> Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
>
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789
Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Clang ms_abi - vectorcall incompatible?

Dennis Luehring via cfe-dev
On Mon, Mar 12, 2018 at 6:30 AM,  <[hidden email]> wrote:
> Hello Aaron,
>
> thank you for your response. I can open a bug for it in bugzilla - but there
> is one thing I don't get.
>
> What do I have to type, to declare a function for using the MS ABI version
> of vectorcall? I figured out, that ms_abi only works for the cdecl calling
> convention.

I don't think we support this case currently, so I'm not certain there
*is* something you can type to get that behavior.

~Aaron

>
> On Fri, Mar 9, 2018 at 2:28 AM, via cfe-dev <[hidden email]> wrote:
>> Hello Clang-Dev-People,
>>
>> currently I'm experimenting with the different target-triples which Clang
>> supports. My current target is: "x86_64-unknown-linux-gnuabi64-elf"
>> When I write the following code:
>>
>> int __attribute__((ms_abi, vectorcall)) printf(const char*, ...);
>>
>> void printAll(double x, int y, double z, int x2, int y2, double z2)
>> {
>>         printf("First message!\n");
>>         printf("%f %i %f %i %i %f\n", x, y, z, x2, y2, z2);
>> }
>>
>> The compiler responses:
>> "vectorcall and ms_abi attributes are not compatible"
>>
>> I understand the error - but why? What should I do when I want to use the
>> vectorcall windows x86_x64 calling convention?
>
> Clang is diagnosing because it treats ms_abi and vectorcall as both
> being calling convention attributes and the conventions don't match.
> We give the same diagnostic if you attempt to add both stdcall and
> cdecl calling conventions to the function. This happens in
> handleFunctionTypeAttr() from SemaType.cpp.
>
> GCC accepts ms_abi and vectorcall on the same declaration, so it would
> be reasonable for us to do the same. Would you be willing to file a
> bug in Bugzilla so we don't lose track of this?
>
> ~Aaron
>
>>
>> Kind regards
>> Björn
>> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
>> USt.ID-Nr. DE 114 165 789
>> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode,
>> Heiko
>> Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
>
>
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
> Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev