1 /* Copyright (C) 2006, 2008 Free Software Foundation, Inc.
3 This file is free software; you can redistribute it and/or modify it under
4 the terms of the GNU General Public License as published by the Free
5 Software Foundation; either version 2 of the License, or (at your option)
8 This file is distributed in the hope that it will be useful, but WITHOUT
9 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 You should have received a copy of the GNU General Public License
14 along with this file; see the file COPYING. If not, write to the Free
15 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
18 /* As a special exception, if you link this library with files compiled with
19 GCC to produce an executable, this does not cause the resulting executable
20 to be covered by the GNU General Public License. The exception does not
21 however invalidate any other reasons why the executable file might be covered
22 by the GNU General Public License. */
24 #include <spu_intrinsics.h>
25 const unsigned char __sidf_pat
[16] __attribute__ ((__aligned__ (16))) = {
26 0x02, 0x03, 0x10, 0x11,
27 0x12, 0x13, 0x80, 0x80,
28 0x06, 0x07, 0x14, 0x15,
29 0x16, 0x17, 0x80, 0x80
32 /* double __float_unssidf (unsigned int SI) */
33 qword
__float_unssidf (qword SI
);
35 __float_unssidf (qword SI
)
37 qword t0
, t1
, t2
, t3
, t4
, t5
, t6
, t7
;
41 t3
= si_ceqi (t0
, 32);
44 t6
= si_andc (t4
, t3
);
45 t7
= si_shufb (t6
, t5
, *(const qword
*) __sidf_pat
);
46 return si_shlqbii (t7
, 4);