/* ====================================================================== */
/* The implementation of the abstract floating point class based on gcc's
- real.c. I.e. the object of this excersize. Templated so that we can
+ real.c. I.e. the object of this exercise. Templated so that we can
all fp sizes. */
class real_c_float
static const enum machine_mode MODE = SFmode;
private:
- long image[128 / 32];
+ static const int external_max = 128 / 32;
+ static const int internal_max
+ = (sizeof (REAL_VALUE_TYPE) + sizeof (long) + 1) / sizeof (long);
+ long image[external_max < internal_max ? internal_max : external_max];
void from_long(long);
void from_str(const char *);
int main(int ac, char **av)
{
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+
while (1)
switch (getopt (ac, av, "pvg:fdl"))
{
F(i370_double),
F(c4x_single),
F(c4x_extended),
+ F(real_internal),
#undef F
};
}
int target_flags = 0;
+
+extern "C" int
+floor_log2_wide (unsigned HOST_WIDE_INT x)
+{
+ int log = -1;
+ while (x != 0)
+ log++,
+ x >>= 1;
+ return log;
+}