This is the mail archive of the gcc-patches@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: [Ping] [PATCH, 6/10] aarch64: add ccmp CC mode


On 09/22/2014 11:44 PM, Zhenqiang Chen wrote:
> +    case CC_DNEmode:
> +      return comp_code == NE ? AARCH64_NE : AARCH64_EQ;
> +    case CC_DEQmode:
> +      return comp_code == NE ? AARCH64_EQ : AARCH64_NE;
> +    case CC_DGEmode:
> +      return comp_code == NE ? AARCH64_GE : AARCH64_LT;
> +    case CC_DLTmode:
> +      return comp_code == NE ? AARCH64_LT : AARCH64_GE;
> +    case CC_DGTmode:
> +      return comp_code == NE ? AARCH64_GT : AARCH64_LE;
> +    case CC_DLEmode:
> +      return comp_code == NE ? AARCH64_LE : AARCH64_GT;
> +    case CC_DGEUmode:
> +      return comp_code == NE ? AARCH64_CS : AARCH64_CC;
> +    case CC_DLTUmode:
> +      return comp_code == NE ? AARCH64_CC : AARCH64_CS;
> +    case CC_DGTUmode:
> +      return comp_code == NE ? AARCH64_HI : AARCH64_LS;
> +    case CC_DLEUmode:
> +      return comp_code == NE ? AARCH64_LS : AARCH64_HI;

I think these should return -1 if comp_code is not EQ.  Like the CC_Zmode case
below.

Perhaps you can share some code to make the whole thing less bulky.  E.g.

	...
	case CC_DLEUmode:
	  ne = AARCH64_LS;
	  eq = AARCH64_HI;
	  break;
	case CC_Zmode:
	  ne = AARCH64_NE;
	  eq = AARCH64_EQ;
	  break;
        }
      if (code == NE)
	return ne;
      if (code == EQ)
	return eq;
      return -1;

This does beg the question of whether you need both CC_Zmode and CC_DNEmode.
I'll leave it to an ARM maintainer to say which one of the two should be kept.


r~


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