
Currently we're hacking libs-y to include libgcc.a, but this has unforeseen consequences since the userspace libgcc is linked with fpregs enabled. We need the kernel to stop using fpregs in an uncontrolled manner to implement lazy fpu state saves. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
30 lines
309 B
C
30 lines
309 B
C
#include "libgcc.h"
|
|
|
|
u32 __clzsi2(u32 v)
|
|
{
|
|
int p = 31;
|
|
|
|
if (v & 0xffff0000) {
|
|
p -= 16;
|
|
v >>= 16;
|
|
}
|
|
if (v & 0xff00) {
|
|
p -= 8;
|
|
v >>= 8;
|
|
}
|
|
if (v & 0xf0) {
|
|
p -= 4;
|
|
v >>= 4;
|
|
}
|
|
if (v & 0xc) {
|
|
p -= 2;
|
|
v >>= 2;
|
|
}
|
|
if (v & 0x2) {
|
|
p -= 1;
|
|
v >>= 1;
|
|
}
|
|
|
|
return p;
|
|
}
|
|
EXPORT_SYMBOL(__clzsi2);
|