Date: Wed, 19 Nov 2014 23:06:33 -0500 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: question about malloc's bin_index On Wed, Nov 19, 2014 at 06:43:23PM -0800, Weiming Zhao wrote: > Hi, > > > > I'm trying to use MUSL on a hardware without floating point unit, however, > the "union" in the bin_index brings some issues. > > I'm using -mgeneral-regs-only and gcc refuses to compile it due to the > floating point conversion. This is odd. It should use soft-float if there's no fpu. > I'm wondering what's the purpose of the union? How should I rewrite it to > use integer only? The value we want, for categorizing sizes into bins, is exactly the floating point exponent and first 2 bits of the mantissa. It's basically a sort of base-2 log with 4 linear steps between successive logarithmic-scale points. I think nsz has an integer-only version of this code that might be useful; it performs mildly better on archs without fpu and mildly worse on ones with fpu and it's somewhat larger (but of course not as large as soft-float code). I'll see if I can find a copy or if he can post it. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.