Skip to content

Commit 5823ef2

Browse files
jgreenhalgh-armJames Greenhalgh
authored andcommitted
[Patch libgcc 9/17] Update soft-fp from glibc
libgcc/ * soft-fp/extendhftf2.c: New. * soft-fp/fixhfti.c: Likewise. * soft-fp/fixunshfti.c: Likewise. * soft-fp/floattihf.c: Likewise. * soft-fp/floatuntihf.c: Likewise. * soft-fp/half.h: Likewise. * soft-fp/trunctfhf2.c: Likewise. From-SVN: r242779
1 parent 3479b7a commit 5823ef2

File tree

8 files changed

+465
-0
lines changed

8 files changed

+465
-0
lines changed

libgcc/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2016-11-23 James Greenhalgh <[email protected]>
2+
3+
* soft-fp/extendhftf2.c: Update from glibc.
4+
* soft-fp/fixhfti.c: Likewise.
5+
* soft-fp/fixunshfti.c: Likewise.
6+
* soft-fp/floattihf.c: Likewise.
7+
* soft-fp/floatuntihf.c: Likewise.
8+
* soft-fp/half.h: Likewise.
9+
* soft-fp/trunctfhf2.c: Likewise.
10+
111
2016-11-20 Marc Glisse <[email protected]>
212

313
PR libgcc/77813

libgcc/soft-fp/extendhftf2.c

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* Software floating-point emulation.
2+
Return an IEEE half converted to IEEE quad
3+
Copyright (C) 1997-2016 Free Software Foundation, Inc.
4+
This file is part of the GNU C Library.
5+
6+
The GNU C Library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
In addition to the permissions in the GNU Lesser General Public
12+
License, the Free Software Foundation gives you unlimited
13+
permission to link the compiled version of this file into
14+
combinations with other programs, and to distribute those
15+
combinations without any restriction coming from the use of this
16+
file. (The Lesser General Public License restrictions do apply in
17+
other respects; for example, they cover modification of the file,
18+
and distribution when not linked into a combine executable.)
19+
20+
The GNU C Library is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23+
Lesser General Public License for more details.
24+
25+
You should have received a copy of the GNU Lesser General Public
26+
License along with the GNU C Library; if not, see
27+
<http://www.gnu.org/licenses/>. */
28+
29+
#define FP_NO_EXACT_UNDERFLOW
30+
#include "soft-fp.h"
31+
#include "half.h"
32+
#include "quad.h"
33+
34+
TFtype
35+
__extendhftf2 (HFtype a)
36+
{
37+
FP_DECL_EX;
38+
FP_DECL_H (A);
39+
FP_DECL_Q (R);
40+
TFtype r;
41+
42+
FP_INIT_EXCEPTIONS;
43+
FP_UNPACK_RAW_H (A, a);
44+
#if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q
45+
FP_EXTEND (Q, H, 4, 1, R, A);
46+
#else
47+
FP_EXTEND (Q, H, 2, 1, R, A);
48+
#endif
49+
FP_PACK_RAW_Q (r, R);
50+
FP_HANDLE_EXCEPTIONS;
51+
52+
return r;
53+
}

libgcc/soft-fp/fixhfti.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Software floating-point emulation.
2+
Convert IEEE half to 128bit signed integer
3+
Copyright (C) 2007-2016 Free Software Foundation, Inc.
4+
This file is part of the GNU C Library.
5+
6+
The GNU C Library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
In addition to the permissions in the GNU Lesser General Public
12+
License, the Free Software Foundation gives you unlimited
13+
permission to link the compiled version of this file into
14+
combinations with other programs, and to distribute those
15+
combinations without any restriction coming from the use of this
16+
file. (The Lesser General Public License restrictions do apply in
17+
other respects; for example, they cover modification of the file,
18+
and distribution when not linked into a combine executable.)
19+
20+
The GNU C Library is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23+
Lesser General Public License for more details.
24+
25+
You should have received a copy of the GNU Lesser General Public
26+
License along with the GNU C Library; if not, see
27+
<http://www.gnu.org/licenses/>. */
28+
29+
#include "soft-fp.h"
30+
#include "half.h"
31+
32+
TItype
33+
__fixhfti (HFtype a)
34+
{
35+
FP_DECL_EX;
36+
FP_DECL_H (A);
37+
UTItype r;
38+
39+
FP_INIT_EXCEPTIONS;
40+
FP_UNPACK_RAW_H (A, a);
41+
FP_TO_INT_H (r, A, TI_BITS, 1);
42+
FP_HANDLE_EXCEPTIONS;
43+
44+
return r;
45+
}

libgcc/soft-fp/fixunshfti.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Software floating-point emulation.
2+
Convert IEEE half to 128bit unsigned integer
3+
Copyright (C) 2007-2016 Free Software Foundation, Inc.
4+
This file is part of the GNU C Library.
5+
6+
The GNU C Library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
In addition to the permissions in the GNU Lesser General Public
12+
License, the Free Software Foundation gives you unlimited
13+
permission to link the compiled version of this file into
14+
combinations with other programs, and to distribute those
15+
combinations without any restriction coming from the use of this
16+
file. (The Lesser General Public License restrictions do apply in
17+
other respects; for example, they cover modification of the file,
18+
and distribution when not linked into a combine executable.)
19+
20+
The GNU C Library is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23+
Lesser General Public License for more details.
24+
25+
You should have received a copy of the GNU Lesser General Public
26+
License along with the GNU C Library; if not, see
27+
<http://www.gnu.org/licenses/>. */
28+
29+
#include "soft-fp.h"
30+
#include "half.h"
31+
32+
UTItype
33+
__fixunshfti (HFtype a)
34+
{
35+
FP_DECL_EX;
36+
FP_DECL_H (A);
37+
UTItype r;
38+
39+
FP_INIT_EXCEPTIONS;
40+
FP_UNPACK_RAW_H (A, a);
41+
FP_TO_INT_H (r, A, TI_BITS, 0);
42+
FP_HANDLE_EXCEPTIONS;
43+
44+
return r;
45+
}

libgcc/soft-fp/floattihf.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Software floating-point emulation.
2+
Convert a 128bit signed integer to IEEE half
3+
Copyright (C) 2007-2016 Free Software Foundation, Inc.
4+
This file is part of the GNU C Library.
5+
6+
The GNU C Library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
In addition to the permissions in the GNU Lesser General Public
12+
License, the Free Software Foundation gives you unlimited
13+
permission to link the compiled version of this file into
14+
combinations with other programs, and to distribute those
15+
combinations without any restriction coming from the use of this
16+
file. (The Lesser General Public License restrictions do apply in
17+
other respects; for example, they cover modification of the file,
18+
and distribution when not linked into a combine executable.)
19+
20+
The GNU C Library is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23+
Lesser General Public License for more details.
24+
25+
You should have received a copy of the GNU Lesser General Public
26+
License along with the GNU C Library; if not, see
27+
<http://www.gnu.org/licenses/>. */
28+
29+
#include "soft-fp.h"
30+
#include "half.h"
31+
32+
HFtype
33+
__floattihf (TItype i)
34+
{
35+
FP_DECL_EX;
36+
FP_DECL_H (A);
37+
HFtype a;
38+
39+
FP_INIT_ROUNDMODE;
40+
FP_FROM_INT_H (A, i, TI_BITS, UTItype);
41+
FP_PACK_RAW_H (a, A);
42+
FP_HANDLE_EXCEPTIONS;
43+
44+
return a;
45+
}

libgcc/soft-fp/floatuntihf.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Software floating-point emulation.
2+
Convert a 128bit unsigned integer to IEEE half.
3+
Copyright (C) 2007-2016 Free Software Foundation, Inc.
4+
This file is part of the GNU C Library.
5+
6+
The GNU C Library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
In addition to the permissions in the GNU Lesser General Public
12+
License, the Free Software Foundation gives you unlimited
13+
permission to link the compiled version of this file into
14+
combinations with other programs, and to distribute those
15+
combinations without any restriction coming from the use of this
16+
file. (The Lesser General Public License restrictions do apply in
17+
other respects; for example, they cover modification of the file,
18+
and distribution when not linked into a combine executable.)
19+
20+
The GNU C Library is distributed in the hope that it will be useful,
21+
but WITHOUT ANY WARRANTY; without even the implied warranty of
22+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23+
Lesser General Public License for more details.
24+
25+
You should have received a copy of the GNU Lesser General Public
26+
License along with the GNU C Library; if not, see
27+
<http://www.gnu.org/licenses/>. */
28+
29+
#include "soft-fp.h"
30+
#include "half.h"
31+
32+
HFtype
33+
__floatuntihf (UTItype i)
34+
{
35+
FP_DECL_EX;
36+
FP_DECL_H (A);
37+
HFtype a;
38+
39+
FP_INIT_ROUNDMODE;
40+
FP_FROM_INT_H (A, i, TI_BITS, UTItype);
41+
FP_PACK_RAW_H (a, A);
42+
FP_HANDLE_EXCEPTIONS;
43+
44+
return a;
45+
}

0 commit comments

Comments
 (0)