Jump to content
Sign in to follow this  
gurday

Agressive Optimization

Recommended Posts

How is the aggresive optimization set???

 

I added the following pragma at the beginning of my code

 

#pragma OPTIMIZE "a"

 

but when I build the files, the command line shows the -O1 directive???

 

Is there a way to globally set the optimization to aggresive???

 

Rgds

 

Gonzalo

Share this post


Link to post
Share on other sites
How is the aggresive optimization set???

 

I added the following pragma at the beginning of my code

 

#pragma OPTIMIZE "a"

 

but when I build the files, the command line shows the -O1 directive???

 

Is there a way to globally set the optimization to aggresive???

 

Rgds

 

Gonzalo

 

Hi, if you are using MPLAB you can set optimisation level in the project settings,

 

Project->Build options->Project then select BoostC compiler tag.

 

In Sourceboost I am not sure, try

 

Settings->Options

Share this post


Link to post
Share on other sites

Hello Chris:

I also use MPLAB...but when I set the project as you mention then command line changes to -0o which is no optimization, there is also a field for "data" but is blackedout..so no data can be added...I tried to add the -Oa to the command line in the additional command line options...does not seem to work either since the output is of the same size...

 

I must be missing something simple...

 

G

 

How is the aggresive optimization set???

 

I added the following pragma at the beginning of my code

 

#pragma OPTIMIZE "a"

 

but when I build the files, the command line shows the -O1 directive???

 

Is there a way to globally set the optimization to aggresive???

 

Rgds

 

Gonzalo

 

Hi, if you are using MPLAB you can set optimisation level in the project settings,

 

Project->Build options->Project then select BoostC compiler tag.

 

In Sourceboost I am not sure, try

 

Settings->Options

Share this post


Link to post
Share on other sites

Hi again, sorry for that, I assumed that was the case. You can edit the .mcp file in your project directory -

 

[TOOL_SETTINGS]

TS{49571987-4DB6-404E-B859-D38AC1DF8220}=-O1;-p|"$(TARGETBASE)";-t;-ld ;;/ld D:\Sourceboost\BoostC\lib libc.pic18.lib

TS{44A9C2D2-3C5E-4C16-B2D8-E4E7F95F1073}=-O1;-W1;-t;;

TS{49571987-4DB6-404E-B859-D38AC1DF8220}000=-O1;-p|"$(TARGETBASE)";-t;-ld

TS{44A9C2D2-3C5E-4C16-B2D8-E4E7F95F1073}000=-W1;-t;;

 

above is the section that contains the compiler and linker switches, have not tried this so make a copy if you do. If it works then post.

Also,

Edited by chris

Share this post


Link to post
Share on other sites

Aggressive optimization is better to be used on a function-by-function case,

that way if it does something bad you know where the issue is.

 

#pragma OPTIMIZE "a"
int someFunc(short var)
{
blah
}

 

Use this before the function you want to optimize.

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...