Skip to content

Commit

Permalink
set STACKALIGN for all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed Jan 7, 2013
1 parent e818024 commit 0e60d26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/backend/cg.c
@@ -1,5 +1,5 @@
// Copyright (C) 1984-1995 by Symantec
// Copyright (C) 2000-2009 by Digital Mars
// Copyright (C) 2000-2012 by Digital Mars
// All Rights Reserved
// http://www.digitalmars.com
// Written by Walter Bright
Expand Down Expand Up @@ -53,8 +53,4 @@ regm_t DOUBLEREGS = DOUBLEREGS_16;
symbol *localgot; // reference to GOT for this function
symbol *tls_get_addr_sym; // function __tls_get_addr

#if TARGET_OSX
int STACKALIGN = 16;
#else
int STACKALIGN = 0;
#endif
int STACKALIGN = 2; // default for 16 bit code
8 changes: 8 additions & 0 deletions src/backend/cod3.c
Expand Up @@ -349,6 +349,12 @@ void cod3_set32()

for (unsigned i = 0x80; i < 0x90; i++)
inssize2[i] = W|T|6;

#if TARGET_OSX

This comment has been minimized.

Copy link
@alexrp

alexrp Jan 8, 2013

Member

@WalterBright I meant here, or is this code only triggered for OS X or something?

This comment has been minimized.

Copy link
@alexrp

alexrp Jan 8, 2013

Member

Aah, never mind. After looking at the function names it makes a lot more sense. Ignore me.

STACKALIGN = 16; // 16 for OSX because OSX uses SIMD
#else
STACKALIGN = 4;
#endif
}

/********************************
Expand Down Expand Up @@ -378,6 +384,8 @@ void cod3_set64()

for (unsigned i = 0x80; i < 0x90; i++)
inssize2[i] = W|T|6;

STACKALIGN = 16; // 16 rather than 8 because of SIMD alignment
}

/*********************************
Expand Down

2 comments on commit 0e60d26

@alexrp
Copy link
Member

@alexrp alexrp commented on 0e60d26 Jan 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with what exactly STACKALIGN is used for, but if it is what I think it is, it probably should be 16 for all 64-bit targets...

@WalterBright
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and it is!

Please sign in to comment.