Update Linux kernel to current glibc soft-fp

Stefan Liebler stli@linux.vnet.ibm.com
Fri Apr 10 10:41:00 GMT 2015


On 04/02/2015 07:44 PM, Joseph Myers wrote:
> On Thu, 26 Mar 2015, Stefan Liebler wrote:
>
>> According to "error: lvalue required as left operand of assignment":
>> Why did you write back r in include/math-emu/op-common.h:
>> #define _FP_FROM_INT(fs, wc, X, r, rsize, rtype):
>> 	  if ((X##_s = ((r) < 0)))
>> 	    (r) = -(rtype) (r);
>> 	  _FP_FROM_INT_ur = (rtype) (r);
>
> Because the _FP_FROM_INT interface requires an argument of the correct
> signedness, but needs to work internally on an unsigned value, so starts
> by negating a signed argument.
>
>> @@ -435,11 +436,12 @@ void s390_adjust_jiffies(void)
>>   		 * by the cpu capability number. Yes, that means a floating
>>   		 * point division .. math-emu here we come :-)
>>   		 */
>> -		FP_UNPACK_SP(SA, &fmil);
>> -		if ((info->capability >> 23) == 0)
>> -			FP_FROM_INT_S(SB, (long) info->capability, 64, long);
>> -		else
>> -			FP_UNPACK_SP(SB, &info->capability);
>> +		FP_UNPACK_SEMIRAW_SP(SA, &fmil);
>> +		if ((info->capability >> 23) == 0) {
>> +			unsigned long r = info->capability;
>> +			FP_FROM_INT_S(SB, r, 64, unsigned long);
>> +		} else
>> +			FP_UNPACK_SEMIRAW_SP(SB, &info->capability);
>>   		FP_DIV_S(SR, SA, SB);
>>   		FP_TO_INT_S(capability, SR, 32, 0);
>
> Division uses cooked inputs and outputs.  FP_TO_INT uses raw inputs.
> FP_FROM_INT uses raw outputs.
>
> So for unpacking SA you should continue to use FP_UNPACK_SP, as the result
> goes straight into division.  For unpacking SB, it seems appropriate to
> use FP_UNPACK_RAW_SP.  Then, after either unpacking or FP_FROM_INT_S, you
> have a raw value in SB, and can use _FP_UNPACK_CANONICAL to produce a
> cooked value from it that can be used as an input to the division.
>
> As for the integer argument to FP_FROM_INT_S, the existing code treats it
> as signed long, so the same semantics would be preserved by making the
> temporary variable of that type (however, you still need to pass "unsigned
> long" as the last argument to FP_FROM_INT_S, as it expects the type name
> passed to be the name of an unsigned type).
>
Thanks for this information.

I applied your patch from 23.03.2015 to linux-next without the removed 
file arch/s390/math-emu/math.c, adjusted s390_adjust_jiffies() method in 
arch/s390/kernel/sysinfo.c (see attached patch) and build and booted the 
new kernel.
The value "bogomips per cpu" in /proc/cpuinfo is equal to this value 
without these patches.

Bye Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20150410_s390_softfp.patch
Type: text/x-patch
Size: 978 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150410/89a882a8/attachment.bin>


More information about the Libc-alpha mailing list