Commit d022d93e by Richard Kenner Committed by Richard Kenner

emit-rtl.c (set_mem_attributes): Alignment is in bits.

	* emit-rtl.c (set_mem_attributes): Alignment is in bits.
	(adjust_address_1, offset_address): Likewise.

From-SVN: r46378
parent 4f9b4029
Sat Oct 20 07:27:14 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Sat Oct 20 07:27:14 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (set_mem_attributes): Alignment is in bits.
(adjust_address_1, offset_address): Likewise.
* final.c (output_asm_operand_names): New fcn, from output_asm_insn. * final.c (output_asm_operand_names): New fcn, from output_asm_insn.
(output_asm_insn): Call it for each line output. (output_asm_insn): Call it for each line output.
Don't record an operand more than once. Don't record an operand more than once.
......
...@@ -1717,7 +1717,7 @@ set_mem_attributes (ref, t, objectp) ...@@ -1717,7 +1717,7 @@ set_mem_attributes (ref, t, objectp)
/* If this is an INDIRECT_REF, we know its alignment. */ /* If this is an INDIRECT_REF, we know its alignment. */
if (TREE_CODE (t) == INDIRECT_REF) if (TREE_CODE (t) == INDIRECT_REF)
set_mem_align (ref, TYPE_ALIGN (type) / BITS_PER_UNIT); set_mem_align (ref, TYPE_ALIGN (type));
/* Now see if we can say more about whether it's an aggregate or /* Now see if we can say more about whether it's an aggregate or
scalar. If we already know it's an aggregate, don't bother. */ scalar. If we already know it's an aggregate, don't bother. */
...@@ -1752,7 +1752,7 @@ set_mem_alias_set (mem, set) ...@@ -1752,7 +1752,7 @@ set_mem_alias_set (mem, set)
MEM_SIZE (mem), MEM_ALIGN (mem)); MEM_SIZE (mem), MEM_ALIGN (mem));
} }
/* Set the alignment of MEM to ALIGN. */ /* Set the alignment of MEM to ALIGN bits. */
void void
set_mem_align (mem, align) set_mem_align (mem, align)
...@@ -1866,7 +1866,7 @@ adjust_address_1 (memref, mode, offset, validate) ...@@ -1866,7 +1866,7 @@ adjust_address_1 (memref, mode, offset, validate)
lowest-order set bit in OFFSET, but don't change the alignment if OFFSET lowest-order set bit in OFFSET, but don't change the alignment if OFFSET
if zero. */ if zero. */
if (offset != 0) if (offset != 0)
memalign = MIN (memalign, offset & -offset); memalign = MIN (memalign, (offset & -offset) * BITS_PER_UNIT);
MEM_ATTRS (new) MEM_ATTRS (new)
= get_mem_attrs (MEM_ALIAS_SET (memref), MEM_DECL (memref), memoffset, = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_DECL (memref), memoffset,
...@@ -1896,7 +1896,8 @@ offset_address (memref, offset, pow2) ...@@ -1896,7 +1896,8 @@ offset_address (memref, offset, pow2)
/* Update the alignment to reflect the offset. Reset the offset, which /* Update the alignment to reflect the offset. Reset the offset, which
we don't know. */ we don't know. */
MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_DECL (memref), MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_DECL (memref),
0, 0, MIN (MEM_ALIGN (memref), pow2)); 0, 0, MIN (MEM_ALIGN (memref),
pow2 * BITS_PER_UNIT));
return new; return new;
} }
......
...@@ -612,7 +612,7 @@ extern rtx memory_address_noforce PARAMS ((enum machine_mode, rtx)); ...@@ -612,7 +612,7 @@ extern rtx memory_address_noforce PARAMS ((enum machine_mode, rtx));
/* Set the alias set of MEM to SET. */ /* Set the alias set of MEM to SET. */
extern void set_mem_alias_set PARAMS ((rtx, HOST_WIDE_INT)); extern void set_mem_alias_set PARAMS ((rtx, HOST_WIDE_INT));
/* Set the alignment of MEM to ALIGN. */ /* Set the alignment of MEM to ALIGN bits. */
extern void set_mem_align PARAMS ((rtx, unsigned int)); extern void set_mem_align PARAMS ((rtx, unsigned int));
/* Return a memory reference like MEMREF, but with its mode changed /* Return a memory reference like MEMREF, but with its mode changed
......
...@@ -95,7 +95,7 @@ typedef struct ...@@ -95,7 +95,7 @@ typedef struct
tree decl; /* decl corresponding to MEM. */ tree decl; /* decl corresponding to MEM. */
rtx offset; /* Offset from start of DECL, as CONST_INT. */ rtx offset; /* Offset from start of DECL, as CONST_INT. */
rtx size; /* Size in bytes, as a CONST_INT. */ rtx size; /* Size in bytes, as a CONST_INT. */
unsigned int align; /* Alignment of MEM in bytes. */ unsigned int align; /* Alignment of MEM in bits. */
} mem_attrs; } mem_attrs;
/* Common union for an element of an rtx. */ /* Common union for an element of an rtx. */
...@@ -912,7 +912,7 @@ extern unsigned int subreg_regno PARAMS ((rtx)); ...@@ -912,7 +912,7 @@ extern unsigned int subreg_regno PARAMS ((rtx));
is always a CONST_INT. */ is always a CONST_INT. */
#define MEM_SIZE(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->size) #define MEM_SIZE(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->size)
/* For a MEM rtx, the alignment in bytes. */ /* For a MEM rtx, the alignment in bits. */
#define MEM_ALIGN(RTX) (MEM_ATTRS (RTX) == 0 ? 1 : MEM_ATTRS (RTX)->align) #define MEM_ALIGN(RTX) (MEM_ATTRS (RTX) == 0 ? 1 : MEM_ATTRS (RTX)->align)
/* Copy the attributes that apply to memory locations from RHS to LHS. */ /* Copy the attributes that apply to memory locations from RHS to LHS. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment