Skip to content

Commit

Permalink
LoongArch: Delete macro definition ASM_OUTPUT_ALIGN_WITH_NOP.
Browse files Browse the repository at this point in the history
There are two reasons for removing this macro definition:
1. The default in the assembler is to use the nop instruction for filling.
2. For assembly directives: .align [abs-expr[, abs-expr[, abs-expr]]]
   The third expression it is the maximum number of bytes that should be
   skipped by this alignment directive.
   Therefore, it will affect the display of the specified alignment rules
   and affect the operating efficiency.

This modification relies on binutils commit 1fb3cdd87ec61715a5684925fb6d6a6cf53bb97c.
(Since the assembler will add nop based on the .align information when doing relax,
it will cause the conditional branch to go out of bounds during the assembly process.
This submission of binutils solves this problem.)

gcc/ChangeLog:

	* config/loongarch/loongarch.h (ASM_OUTPUT_ALIGN_WITH_NOP):
	Delete.

Co-authored-by: Chenghua Xu <xuchenghua@loongson.cn>
  • Loading branch information
chenglulu326 and ChenghuaXu committed Oct 17, 2023
1 parent b25b43c commit b20c7ee
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions gcc/config/loongarch/loongarch.h
Original file line number Diff line number Diff line change
Expand Up @@ -1058,11 +1058,6 @@ typedef struct {

#define ASM_OUTPUT_ALIGN(STREAM, LOG) fprintf (STREAM, "\t.align\t%d\n", (LOG))

/* "nop" instruction 54525952 (andi $r0,$r0,0) is
used for padding. */
#define ASM_OUTPUT_ALIGN_WITH_NOP(STREAM, LOG) \
fprintf (STREAM, "\t.align\t%d,54525952,4\n", (LOG))

/* This is how to output an assembler line to advance the location
counter by SIZE bytes. */

Expand Down

0 comments on commit b20c7ee

Please sign in to comment.