search for: __fastcall

Displaying 17 results from an estimated 17 matches for "__fastcall".

2018 Dec 01
2
Where's the optimiser gone? (part 5.c): missed tail calls, and more...
Compile the following functions with "-O3 -target i386-win32" (see <https://godbolt.org/z/exmjWY>): __int64 __fastcall div(__int64 foo, __int64 bar) { return foo / bar; } On the left the generated code; on the right the expected, properly optimised code: push dword ptr [esp + 16] | push dword ptr [esp + 16] | push dword ptr [esp + 16] | push dword ptr [esp + 16]...
2018 Nov 26
3
BUGS in code generated for target i386-win32
Hi @ll, LLVM/clang generates wrong code for the following program (see <https://godbolt.org/z/UZrrkG>): --- sample.c --- unsigned __fastcall lfsr32(unsigned argument, unsigned polynomial) { __asm { add ecx, ecx ; ecx = argument << 1 sbb eax, eax ; eax = CF ? -1 : 0 and eax, edx ; eax = CF ? polynomial : 0 xor eax, ecx ; eax = (argument << 1) ^ (CF ? polynomial : 0) } } int main()...
2018 Nov 26
2
BUGS in code generated for target i386-win32
...e issues come down to mismatched expectations > on what goes into and out of an __asm block. If you look at the MSVC > documentation (which I think Clang is trying to be compatible with), > it warns against assuming known values are in particular registers at > any point, and even using __fastcall at all for a function with an > __asm block for that reason: > https://docs.microsoft.com/en-gb/cpp/assembler/inline/using-and-preserving-registers-in-inline-assembly?view=vs-2017 Trust me: I KNOW THIS DOCUMENTATION! > I'll try to explain a little below how that one mismatch causes t...
2013 Oct 28
0
[LLVMdev] __fastcall jitting
Hi, We're using LLVM MCJIT on X86 platform. When calling Function::setCallingConv(CallingConv::X86_StdCall) the jitted code indeed conforms __stdcall convention (instead of default __cdecl). However applying Function::setCallingConv(CallingConv::X86_FastCall) seem does not have proper effect; jitted code is still __stdcall. Is it a bug, or am I missing something? Regards, Mikhail
2004 Nov 17
4
[LLVMdev] Re: Notes on the release notes for the fifth public release of LLVM
...and copy the bytecode file over to Windows and then (eventually) > generate assembler that NASM can turn into a binary. But what to link > against? Microsoft's C runtime library? C++ runtime is even worse, as > name mangling is completely different. Then there's __cdecl vs > __fastcall. VC++ exception handling is implemented in an utterly > different fashion than g++ also. Any words of assurance :) OK, I know better than to ask because I already know the answer: the GNU frontends are going to generate code that expects to link with GNU libraries. Other vendors' librar...
2004 Nov 17
0
[LLVMdev] Re: Notes on the release notes for the fifth public release of LLVM
...e file over to Windows and then (eventually) > > generate assembler that NASM can turn into a binary. But what to link > > against? Microsoft's C runtime library? C++ runtime is even worse, as > > name mangling is completely different. Then there's __cdecl vs > > __fastcall. VC++ exception handling is implemented in an utterly > > different fashion than g++ also. Any words of assurance :) > > OK, I know better than to ask because I already know the answer: the > GNU frontends are going to generate code that expects to link with GNU > libraries. O...
2007 Sep 28
2
[LLVMdev] Vector troubles
Hola LLVMers, I'm working on engaging SSE via the LLVM vector ops on x86. I had some questions a while back that you all helped out on, but I'm seeing similar issues and was hoping you'd have some ideas. Below is the dump of the LLVM IR of a program which is designed to take a vector stored in a float*, build an LLVM vector from it, copy it to another vector, and then take it
2010 Dec 14
1
[LLVMdev] qsort callbacks portability issues
...tPredicate in SimplifyCFG.cpp (where the sort is being used to bring duplicate values together) fails this requirement. All the others look ok. Secondly, on Windows qsort() needs its callback to use __cdecl calling convention, which won't be the case by default if LLVM is being built with e.g. __fastcall. VC++ will fault this as an invalid conversion. To make this work, the comparator functions should be marked up with __cdecl. It looks like this would be a few places in STLExtras.h, and two custom comparators elsewhere. It wouldn't be a breaking change. I was wondering what the preferred w...
2004 Nov 17
0
[LLVMdev] Re: Notes on the release notes for the fifth public release of LLVM
...C++ program on Unix and copy the bytecode file over to Windows and then (eventually) generate assembler that NASM can turn into a binary. But what to link against? Microsoft's C runtime library? C++ runtime is even worse, as name mangling is completely different. Then there's __cdecl vs __fastcall. VC++ exception handling is implemented in an utterly different fashion than g++ also. Any words of assurance :) On Tue, 16 Nov 2004 19:37:43 +0100 "Henrik Bach" <henrik_bach_llvm at hotmail.com> wrote: > Well Chris, > > then I've to ask the guys who really have t...
2004 Nov 16
3
[LLVMdev] Re: Notes on the release notes for the fifth public release of LLVM
Well Chris, then I've to ask the guys who really have the hands into the guts of the VC++ code: On Tue, 16 Nov 2004, Henrik Bach wrote: > Hi Chris, > > I'm reading release notes for the fifth public release of LLVM and came > across this line: > > "The LLVM source code is now compatible with Microsoft Visual C++." > > which is almost true, if
2012 Feb 07
2
[LLVMdev] x86 asm dllexport output for mingw targets
It seems that the DLL export directives for __cdecl and __stdcall functions are not correctly written in asm output. For example, when declaring a function like this: __declspec(dllexport) int __cdecl exportFunc1(int c); ASM output is: .def _exportFunc1; .scl 2; .type 32; .endef .text .globl _exportFunc1 .align 16, 0x90 _exportFunc1: movl 4(%esp), %eax ret .section
2012 Feb 07
0
[LLVMdev] x86 asm dllexport output for mingw targets
Alen, > It seems that the DLL export directives for __cdecl and __stdcall > functions are not correctly written in asm output. So, this is for all functions then, right? :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
2009 Jun 07
0
Calling code allocated in memory crashes wine
Hi, I have a program which needs to call some code manually allocated in memory. The code is first prepared and all of its functions/variables are updated with the right address, then its init function is called through a simple __fastcall in C. It works very well under windows, but if i try to run it under wine it crashes when it calls this init function, with the following error: "Unhandled exception: page fault on execute access to 0x00116000 in 32-bit code (0x00116000)" 0x00116000 is the address of the init function....
2016 Nov 30
2
RFC: Adding Support For Vectorcall Calling Convention
...=================================== Vectorcall Calling Convention for x64 ---------------------------------------------------- The __vectorcall calling convention specifies that arguments to functions are to be passed in registers, when possible. __vectorcall uses more registers for arguments than __fastcall or the default x64 calling convention use. The __vectorcall calling convention is only supported in native code on x86 and x64 processors that include Streaming SIMD Extensions 2 (SSE2) and above. The Definition of HVA Types -------------------------------------- A Homogeneous Vector Aggregate (HV...
2017 Apr 22
2
LLVM Optimizations strange behavior/bug
...izations. When I activate the optimization (>= -O1) then the code will be optimized into some constants which sounds great at the beginning but this is not right. I can reproduce this with clang 3.9 and 4.0. GCC 5.4 and VS CL >=2015 do not show this behavior. .text:0000000000400570 ; __int64 __fastcall DecryptBlock(unsigned __int8 *) .text:0000000000400570 public DecryptBlock(unsigned char *) .text:0000000000400570 DecryptBlock(unsigned char *) proc near ; CODE XREF: main+5p .text:0000000000400570 mov cs:byte_60106F, 54h .text:0000000000400577 m...
2019 May 24
0
Wine release 4.9
...nitialize() spec entry. include: Define fastcall assembly wrappers globally. include: Define thiscall assembly wrappers globally. riched20: Declare thiscall functions as __thiscall. winebuild: Support Windows-style name mangling for fastcall functions. include: Use the __fastcall attribute directly for the Windows build. include: Use the __thiscall attribute directly for the Mingw build. include: Pass function name directly to the __ASM_STDCALL macro. winegcc: Use -static-libgcc for the Windows build. msvcp90: Use the standard -mno-cygwin build flag....
2008 Apr 04
0
Wine release 0.9.59
...tead of on demand in the advapi32 services code. widl: Add a function to get the return type of a parsed function. widl: Store function and function pointer types completely within type_t type. widl: Support parsing calling conventions for function identifiers. widl: Support __fastcall and __pascal calling conventions. widl: Add a newline between function prototypes for non-object interfaces. widl: Fix the writing out of function pointers with more than one level of indirection. widl: Turn on verbose errors, which gives a little more information in the case of a...