You are correct. So I should be changing things in the adjust_cost function instead.
I was also wondering, these instructions modify an internal register that has been set as a fixed register. However, the compiler optimizes them out when the accumulator is not retrieved for a calculation. How can I tell the compiler that it should not remove these instructions. Here is an example code: uint64_t foo (uint64_t x, uint64_t y) { uint64_t z; __builtin_newins (x,y); /* Modifies the accumulator */ z = __builtin_retrieve_accum (); /* Retrieve the accumulator */ return z; } If I remove the instruction "z = ...;", then the compiler will optimize out my first builtin call. Thanks for your help and input, Jc On Mon, Dec 14, 2009 at 6:10 PM, Daniel Jacobowitz <d...@false.org> wrote: > On Mon, Dec 14, 2009 at 05:52:50PM -0500, Jean Christophe Beyler wrote: >> I thought of that but then how do I add the cost ? I also have another >> problem: there is a second instruction that would have the exact same >> signature if I use an unspec. >> >> Is there a solution for that and how do I handle the cost then ? >> - Just say that an unspec has a higher cost? > > Are you really talking about rtx_costs? It sounds to me more like you > want to change your scheduler. > > -- > Daniel Jacobowitz > CodeSourcery >