Register | Login
Forum Index > Requests and Feedback > #align
Author Message
Pages: 1
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1531] #align - posted: 2015-01-28 19:33:35
#align; - align current code to 2,4,8 boundary (dependant on architecture)

Looks like only 2,4,8 byte alignment available.

What if we need 16 byte alignment? For example, instructions:
MOVAPS — Move Aligned Packed Single-Precision Floating-Point
MOVAPD — Move Aligned Packed Double-Precision Floating-Point
The MOVAPx instructions copy a vector of four single-precision floating-point values (MOVAPS) or a
vector of two double-precision floating-point values (MOVAPD) from the second operand to the first
operand — i.e., from an XMMregister or 128-bit memory location or to another XMMregister, or vice
versa. A general-protection exception occurs if a memory operand is not aligned on a 16-byte
boundary.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1532] - posted: 2015-01-28 20:27:38
The #align directive is for code only, I will be adding other alignment options for variables and other data such as blocks hopefully for the next release. smile

e.g.

Code:
push eax
push ecx
push edx
#align;            // aligned on 4 byte boundary
call MyProcedure


For data, I may add several options such as

Code:
#set align 16;
DWord myVariable;
#set align 4;
Dword myVariable2;


In fact, maybe I should rename #align; to #aligncode;

and then use #align as you say... #align 16; etc... What do you think?

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 199
Topics: 37

Location:
[1533] - posted: 2015-01-28 21:16:04
I think that there is many ways to implement this.

#align <value>; -- seems useable, also we can to allow #align sysword;

What about #aligncode; then
we can make all procedures/functions autoaligned by #procalign <value>;
Also we can add #loopalign <value>; for align of while\repeat loops.

May be also should use some alignment by default.

In any way it should be completely explained in our documentation of Ziron.
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[1534] - posted: 2015-01-28 22:05:30
ok that's a good idea, maybe i will change it and add some directives.

Code:
#set code_align <x>;
#set loop_align <x>;
#set data_align <x>;
#set proc_align <x>;


etc... I will look into this, seems there is a big issue with latest release, something is broken, i guess from one of the procedure rewrites for memory operands.

Edit: This issue i have fixed, so i will take a look at this after i finish 1 new emacro feature.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 7 user(s) online. 0 member(s) and 7 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd