Questions tagged [fastcall]

Anything related to the `fastcall` calling convention, i.e. one of the common subroutine calling conventions used on systems with x86 architecture.

Anything related to the fastcall calling convention, i.e. one of the common subroutine calling conventions used on systems with x86 architecture.

See Wikipedia on:

18 questions
44
votes
4 answers

Is fastcall really faster?

Is the fastcall calling convention really faster than other calling conventions, such as cdecl? Are there any benchmarks out there that show how performance is affected by calling convention?
zr.
  • 7,528
  • 11
  • 50
  • 84
13
votes
2 answers

Why should I not use __fastcall instead the standard __cdecl?

I'd listening some people saying __fastcall is faster than __cdecl and __stdcall cause it puts two parameters in register, instead of the one of other calls; but, in other hand, this is not the standard used in C. I would like to know what makes…
lucastamoios
  • 562
  • 1
  • 8
  • 22
12
votes
2 answers

What is the fastcall keyword used for in visual c?

I have seen the fastcall notation appended before many functions. Why it is used?
Raulp
  • 7,758
  • 20
  • 93
  • 155
10
votes
2 answers

Fastcall GCC example

Could some one provide an example use of fastcall for use with gcc? If possible could you provide the equivalent call without using fastcall and explain how they would be different?
Ian Lewis
  • 917
  • 1
  • 7
  • 17
7
votes
1 answer

fastcall: What happens with the stack?

I'm currently learning x64 assembly by myself and have trouble understanding what happen with the stack when calling an assembly procedure from c++. From what I currently understand from MSDN and Intel, the first 4 integer/floating point parameters…
3
votes
1 answer

performance impact of "inline" function with "fastcall" calling convension

I have a CRC calculation function which gets called with extremely high frequency. I have already declared as inline i tried making it a __attribute((hot))__ but i am not sure if that buys anything. I am thinking about making it a…
Jay D
  • 3,263
  • 4
  • 32
  • 48
2
votes
1 answer

Fastcall name decoration in Windows does not port easily

I'm using mingw in Windows to compile code in C and assembly, several functions in which have the fastcall calling convention (as Microsoft defines it). If I use __fastcall in the declaration, mingw does what Windows does and name decorates: An at…
carveone
  • 889
  • 9
  • 16
2
votes
1 answer

Fastcall in 64 bit

I've been reading up on the differences in 32bit calling conventions. The fastcall vs. stdcall ordeal that is. From what I read there was great confusion with the two conventions, and 64 bit was standardized to avoid this confusion. I have to ask,…
Hawken
  • 2,059
  • 19
  • 34
1
vote
2 answers

Addressing variables (or, what is ML64 generating?)

I have an ASM file written for X64. It provides a leaf function. The file was assembled with MASM64/ML64. The C-pseduo code with a signature is: int GenerateBlock(byte* ptr, size_t size, unsigned int safety) { if (ptr == NUL) return 0; /*FAIL*/ …
jww
  • 97,681
  • 90
  • 411
  • 885
1
vote
1 answer

Why does MS fastcall on x86 not use EAX for the first argument?

According to wikipedia: "Microsoft or GCC __fastcall convention (aka __msfastcall) passes the first two arguments (evaluated left to right) that fit into ECX and EDX. Remaining arguments are pushed onto the stack from right to left." Why did they…
Yifan
  • 4,867
  • 5
  • 25
  • 24
1
vote
2 answers

What is better to declare for calling convention of Windows program?

I have read an article about Calling convention (__stdcall, __fastcall, pascal, cdecl etc...) And I wonder: Why is often __stdcall (WinAPI) declared for WinMain() function? As I read, __stdcall operates with the stack, __fastcall operates on…
user2402179
1
vote
1 answer

C manually call function with stack and register

i know this is the big deal to manipulate stack but i think it would be a great lesson for me. im searched the internet, and i found calling convention. I know how its working and why. I whant to simulate some of "Callee clean-up stack" maybe…
Jan3Sobieski
  • 259
  • 1
  • 7
  • 16
1
vote
2 answers

MASM x86 fastcall function declaration... how?

I'm trying to make a VisualStudio 2010 C program call a fastcall convention assembly routine. This is the declaration in the C code: extern boolean _fastcall InNonSuspendableCriticalRegion(DWORD); This is the declaration in the assembly code: …
Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
0
votes
0 answers

issue with accessing c++ library using fastcall. (javascript, nodejs, foreign function interface)

I tried using fastcall, this is my first time using fastcall and foreign function interface, I tried to load datatable.dll it is throwing error, tried passing every possible library path (absolute and relative). using nodejs, fastcall,…
0
votes
1 answer

Fastcall function crashes

trying to call a process function using fastcall convention from my program, but got a crash everytime trying to. Have passed so much time on it and can't solve that... need some help please... Here's all needed informations and my trying: The…
Mssm
  • 717
  • 11
  • 29
1
2