History

tccasm: Accept .balign

Michael Matz committed 10 years ago

Commit 63e3ff71 parent 8e4da423 files · +4 −1Browse files

Unified · Split

3 files
  1. tccasm.c +2 −1
  2. tcctok.h +1 −0
  3. tests/asmtest.S +1 −0
tccasm.c+2−1
@@ -368,6 +368,7 @@ static void asm_parse_directive(TCCState *s1) · 367 unmodified lines
368 sec = cur_text_section;368 sec = cur_text_section;
369 switch(tok) {369 switch(tok) {
370 case TOK_ASMDIR_align:370 case TOK_ASMDIR_align:
371 case TOK_ASMDIR_balign:
371 case TOK_ASMDIR_p2align:372 case TOK_ASMDIR_p2align:
372 case TOK_ASMDIR_skip:373 case TOK_ASMDIR_skip:
373 case TOK_ASMDIR_space:374 case TOK_ASMDIR_space:
@@ -381,7 +382,7 @@ static void asm_parse_directive(TCCState *s1) · 7 unmodified lines
381 n = 1 << n;382 n = 1 << n;
382 tok1 = TOK_ASMDIR_align;383 tok1 = TOK_ASMDIR_align;
383 }384 }
384 if (tok1 == TOK_ASMDIR_align) {385 if (tok1 == TOK_ASMDIR_align || tok1 == TOK_ASMDIR_balign) {
385 if (n < 0 || (n & (n-1)) != 0)386 if (n < 0 || (n & (n-1)) != 0)
386 tcc_error("alignment must be a positive power of two");387 tcc_error("alignment must be a positive power of two");
387 offset = (ind + n - 1) & -n;388 offset = (ind + n - 1) & -n;
tcctok.h+1−0
@@ -305,6 +305,7 @@ · 304 unmodified lines
305 DEF_ASMDIR(byte) /* must be first directive */305 DEF_ASMDIR(byte) /* must be first directive */
306 DEF_ASMDIR(word)306 DEF_ASMDIR(word)
307 DEF_ASMDIR(align)307 DEF_ASMDIR(align)
308 DEF_ASMDIR(balign)
308 DEF_ASMDIR(p2align)309 DEF_ASMDIR(p2align)
309 DEF_ASMDIR(skip)310 DEF_ASMDIR(skip)
310 DEF_ASMDIR(space)311 DEF_ASMDIR(space)
tests/asmtest.S+1−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11 .align 811 .align 8
12 .byte 112 .byte 1
13/* .align 16, 0x90 gas is too clever for us with 0x90 fill */13/* .align 16, 0x90 gas is too clever for us with 0x90 fill */
14 .balign 4, 0x92
14 .align 16, 0x91 /* 0x91 tests the non-clever behaviour */15 .align 16, 0x91 /* 0x91 tests the non-clever behaviour */
15 .skip 316 .skip 3
16 .skip 15, 0x9017 .skip 15, 0x90

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t