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: condition DCE of partially dead calls


So it was mentioned to me that the reason why for the check is based
on the range of the values rather than based if NaNs and Infs are
supported.  So here is a summary of the issues with spu:
TARGET_FLOAT_FORMAT is set to IEEE_FLOAT_FORMAT.
Double is handled the same as IEEE 64bit (except for denorms are
handled as zero IIRC)
float has the same data format as IEEE 32bit but it does not have nans
or infs and has an extended range and denorms are handled as zero.

In GCC, real_format is the struct which has the format of the floating
point representation.
You can get the format for each mode via REAL_MODE_FORMAT.

You can get the largest finite value representable in mode by using real_maxval.

Some more comments about the code:
from check_pow:
>+      real_from_integer (&mv, VOIDmode, 256, 0, 1);
You really should not being using VOIDmode here but the correct mode
here based on the function call.

+      if (TREE_CODE (base_var) != VAR_DECL
+          && TREE_CODE (base_var) != PARM_DECL)

Use DECL_P instead.

+      bit_sz = TYPE_PRECISION (typ);
+      if (bit_sz > 32)
+        return false;

Huh??? Can you explain why this is needed?  Besides exactness but if
we have powf, 32bit integers won't fix exactly into a 32bit float.

For gen_one_condition:
+  temp = create_tmp_var (float_typ, temp_name1);

Using a temp name here causes a memory overhead.

I see many uses of VOIDmode for real_from_integer which is wrong, use
the correct mode.

Also I just noticed that you don't handle powf and powl.

And check_builtin_call should be always true for the builtins where
they are used.

Thanks,
Andrew Pinski


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