This is the mail archive of the
mailing list for the GCC project.
Re: x86_64 gen_align fix
- From: Jan Hubicka <jh at suse dot cz>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 5 Jun 2003 11:37:56 +0200
- Subject: Re: x86_64 gen_align fix
- References: <20030604202031.GA17749@twiddle.net>
> We could fall through without returning anything. Probably
> only shows up for real with cross compilers, since no real
> version of the x86_64 assembler doesn't support max skip.
> --- 14279,14298 ----
> (set_attr "modrm" "0")
> (set_attr "ppro_uops" "one")])
> ! ;; Align to 16-byte boundary, max skip in op0. Used to avoid
> ! ;; branch prediction penalty for the third jump in a 16-byte
> ! ;; block on K8.
> (define_insn "align"
> [(unspec_volatile [(match_operand 0 "" "")] UNSPECV_ALIGN)]
> ! #ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
> ! ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, 4, INTVAL (operands));
> ! #else
> ! ASM_OUTPUT_ALIGN (asm_out_file, 4);
> + return "";
Uhm, this is actually wrong. We don't want to output normal alignment
as it is too costy for this minor optimization. You also introduced an
warning when P2align is available. I am testing the attached patch
to fix that.
Thu Jun 5 11:32:26 CEST 2003 Jan Hubicka <firstname.lastname@example.org>
* i386.md (align): Fix warning; clarify what to do when no p2align
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.465
diff -c -3 -p -r1.465 i386.md
*** i386.md 5 Jun 2003 00:23:21 -0000 1.465
--- i386.md 5 Jun 2003 09:32:10 -0000
*** 14289,14297 ****
! ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, 4, INTVAL (operands));
! ASM_OUTPUT_ALIGN (asm_out_file, 4);
--- 14289,14300 ----
! ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file, 4, (int)INTVAL (operands));
! /* It is tempting to use ASM_OUTPUT_ALIGN here, but we don't want to do that.
! The align insn is used to avoid 3 jump instructions in the row to improve
! branch prediction and the benefits hardly outweight the cost of extra 8
! nops on the average inserted by full alignment pseudo operation. */