GCC "thiscall" calling convention [Linux/Win32 MinGW] menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by amadmonk View Post
    ZOMBIE! Just had to comment on this nearly year-old thread. As someone who used to work on the MSVC team, I should point out that both internal calling conventions and structure packing/layout are, technically, implementation-defined. So it's not that MSVC is "wrong" and GCC is "right" (or vice-versa). Just different.

    Of course, this implementation-dependent thing may have changed since FWIK C++0x has done some work to define backwards "binary compatibility" w/C, but back when we were doing the MSVC compiler (circa VS2k3... yes, I'm old), the ONLY thing that guided us in this respect was the ANSI/ISO standards (which left the implementation up to the compiler writer) and the Intel ABI, which just gave hints and a few hard-coded specifications (specifically calling conventions).

    <end defensive rant for a product that I no longer work around>
    While you're here... Why does MSVC pad the object if you use an __int64?

    GCC &quot;thiscall&quot; calling convention [Linux/Win32 MinGW]
  2. #17
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    While you're here... Why does MSVC pad the object if you use an __int64?
    Wouldn't that be to make sure they're always 8-byte aligned?
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #18
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    Wouldn't that be to make sure they're always 8-byte aligned?
    Objects in MSVC are 8-byte aligned even when compiling for x86? I always just assumed it would be 4-byte, i.e. sizeof(void*). (Serious question.. I've never actually bothered to look into the internals of all that.)

  4. #19
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Objects in MSVC are 8-byte aligned even when compiling for x86? I always just assumed it would be 4-byte, i.e. sizeof(void*). (Serious question.. I've never actually bothered to look into the internals of all that.)
    It does make sense to 8-byte align 64-bit datatypes (like __int64) because there are certain instructions that require aligned 8-byte memory instructions, for instance almost all of the SSE instruction set requires aligned operands.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  5. #20
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    It does make sense to 8-byte align 64-bit datatypes (like __int64) because there are certain instructions that require aligned 8-byte memory instructions, for instance almost all of the SSE instruction set requires aligned operands.
    Good point. Thanks.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Quotes from Steven Write
    By Amedis in forum Community Chat
    Replies: 2
    Last Post: 11-14-2022, 10:26 AM
  2. [1.12] Trouble with ClntObjMgrObjectPtr calling convention
    By Saridormi in forum WoW Memory Editing
    Replies: 6
    Last Post: 06-24-2016, 05:57 AM
  3. Remote function call, calling convention?
    By lweid in forum WoW Memory Editing
    Replies: 11
    Last Post: 03-24-2011, 03:39 PM
  4. WTB Powerleveling - Need Quotes!!
    By Drovos in forum Members Only Gold And Powerleveling Buy Sell
    Replies: 7
    Last Post: 10-14-2007, 10:26 AM
  5. Funny GM quotes
    By shadowfox47 in forum World of Warcraft General
    Replies: 9
    Last Post: 08-13-2007, 07:24 PM
All times are GMT -5. The time now is 10:14 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search