This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Comparison operations in machine description (-1 vs +1)


On 11/12/19 11:29 AM, m wrote:
> Hello gcc developers!
> 
> I am working on a new back end for my MRISC32 ISA [1], and I'm still very
> new to gcc internals. I suspect that I will have more questions further
> down the road, but let's start with this topic...
> 
> The MRISC32 ISA has instructions for setting a register based on the
> outcome of a comparison. For instance:
> 
>   slt s1, s2, s3
> 
> ...which is equal to (in C):
> 
>   int s1 = s2 < s3 ? -1 : 0;
Look at STORE_FLAG_VALUE.  m68k for example works like this.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]