[cfe-dev] Clang ms_abi - vectorcall incompatible?
Aaron Ballman via cfe-dev
cfe-dev at lists.llvm.org
Mon Mar 12 05:46:48 PDT 2018
On Mon, Mar 12, 2018 at 6:30 AM, <bjoern.gaier at horiba.com> 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 <cfe-dev at lists.llvm.org> 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
>> cfe-dev at lists.llvm.org
>> 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.
>
More information about the cfe-dev
mailing list