boolean and interger operation declaration in gcc

Henri Cloetens henri.cloetens@blueice.be
Wed Jan 29 11:26:00 GMT 2020


Hello All,

I have a machine, with a condition code register of type BImode.
It is 12 bit, can hold boolean flags.

Now, consider following C-code:

bool a, b ;

if(a == b)
   // do this
else
   // do that

In Gcc, it will call the "cbranchsi4" construct to translate this to RTL,
and then, on my machine, a and b can either be:
   a. In general register file.
   b. In the condition register.
Now, to do this test, I need to call the XOR function. There is a 
predefined macro for this,
   xorsi3.

Question is : Am I allowed to put the binary XOR operation here , with 
the source and
destination register constrained to be type "y", meaning condition 
register, able to hold
type BImode, and nothing else ?. Or should I define "xorbi3", but then 
how do I refer to "xorsi3"
to make the compiler clear it can also use the 32-bit XOR for binary XOR ?.

Best Regards,

Henri.



More information about the Gcc-help mailing list