Unreviewed patch: PATCH: [darwin] Adding branch prediction bits for bdxx instructions

Caroline Tice ctice@apple.com
Tue Feb 10 19:18:00 GMT 2004


I submitted this patch nearly a month ago, and so far no one has said 
anything about it at all.  Could
someone *PLEASE* review it sometime soon?  (This is my third "PING" of 
this patch as well!)
Thank you!

-- Caroline Tice
ctice@apple.com

Begin forwarded message:

> From: Caroline Tice <ctice@apple.com>
> Date: January 16, 2004 12:37:30 PM PST
> To: gcc-patches@gcc.gnu.org
> Cc: david edelsohn <dje@watson.ibm.com>, geoffrey Keating 
> <geoffk@apple.com>
> Subject: Re: PATCH: [darwin] Adding branch prediction bits for bdxx 
> instructions
>
>
> On Dec 19, 2003, at 10:53 AM, Caroline Tice wrote:
>
>>
>> This is a bit of code we've had in the Apple compiler for the last 
>> six months or so, and
>> we hope the FSF community will accept it.  It adds branch prediction 
>> bits to the bdn, bdz,
>> and bdnz instructions.  It also adds two target options for 
>> controlling this:  -mbranch-predictions,
>> which indicates whether or not to add the branch prediction bits, and
>> -mbranch-predictions-threshold, which takes an integer value 
>> indicating what percentage of
>> the time a branch needs to be taken in order for the bits to be set.
>>
>> All the code changes are in the config/rs6000 directory, so should 
>> only affect darwin.  This code
>> has been tested on G4 and G5 architectures, running 
>> powerpc-apple-darwin7.0.0.  It has
>> bootstrapped and passed the DejaGnu tests.
>>
>> May I commit it to 3.4?
>>
>> -- Caroline Tice
>> ctice@apple.com
>>
>>
>
> I've updated the original patch to incorporate the various suggestions 
> I received.  Below is the
> updated patch, as well as five new test-cases.  It passes the test 
> cases, it bootstraps, and it passes
>  DejaGnu.  This was tested on both a G4 and  a G5 running 
> powerpc-apple-darwin.
>
> Is this okay to commit to the 3.5 integration branch?
>
> -- Caroline Tice
> ctice@apple.com
>
> ChangeLog entry:
>
> 2004-01-16  Caroline Tice <ctice@apple.com>
>
> 	    * config/rs6000/rs6000-protos.h (output_bdxx_branch):  New extern 
> function
> 	    declaration.
> 	    * config/rs6000/rs6000.h (MASK_NO_BRANCH_PREDICTIONS): New 
> definition, for
> 	    adding m(no-)branch-predictions to list of target_flags.
> 		(TARGET_NO_BRANCH_PREDICTIONS): Likewise.
> 		(TARGET_BRANCH_PREDICTIONS): Likewise.
> 		(TARGET_SWITCHES):  Added branch-predictions and 
> no-branch-predictions.
> 		(TARGET_OPTIONS):  Added branch-predictions-threshold=xx.
> 		(rs6000_branch_predictions_threshold_string): New extern global 
> variable
> 	    definition.
> 	    * config/rs6000/rs6000.c (rs6000_branch_predictions_threshold): 
> New global
>         variable.
> 	    (rs6000_branch_predictions_threshold_string): New global variable.
> 	    (rs6000_override_options): Add code to set value of
> 	    rs6000_branch_predictions_threshold.
> 	    (determine_branch_prediction_bits):  New function.
> 		(output_cbranch):  Moved code for determining branch prediction bits 
> into
> 	    new function (see above); added call to the new function.
> 	    (output_bdxx_branch): New function, to output bdn, bdz, and bdnz
> 	    instructions, with the appropriate branch prediction bits set.
> 		* config/rs6000/rs6000.md (*ctrsi_internal1): Combined two 
> alternatives
> 	    into a single function call (output_bdxx_branch); made number of
>         constraints match the reduced number of alternatives.
> 	    (*ctrsi_internal2): Likewise.
> 		(*ctrdi_internal1): Likewise.
> 		(*ctrdi_internal2): Likewise.
> 		(*ctrsi_internal3): Likewise.
> 		(*ctrsi_internal4): Likewise.
> 		(*ctrdi_internal3): Likewise.
> 		(*ctrdi_internal4): Likewise.
> 		(*ctrsi_internal5): Likewise.
> 		(*ctrsi_internal6): Likewise.
> 		(*ctrdi_internal5): Likewise.
> 		(*ctrdi_internal6): Likewise.
> 		* doc/invoke.texi (m(no-)branch-predictions):  Document new option.
> 		(mbranch-predictions-threshold):  Document new option.
>
>
> Here is the patch:
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 4143 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc5-branch-pred.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment.txt>
-------------- next part --------------
>
>
>
>
>
> Here are the test cases:
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 52 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: branch-pred-1.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: branch-pred-2.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment-0001.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: branch-pred-3.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment-0002.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: branch-pred-4.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment-0003.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: branch-pred-5.c
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040210/76c3befb/attachment-0004.c>


More information about the Gcc-patches mailing list