• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "libm.h"
17 
18 #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024
copysignl(long double x,long double y)19 long double copysignl(long double x, long double y)
20 {
21     return copysign(x, y);
22 }
23 #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384
copysignl(long double x,long double y)24 long double copysignl(long double x, long double y)
25 {
26     union ldshape ux = {x}, uy = {y};
27     ux.i.se &= 0x7fff;
28     ux.i.se |= uy.i.se & 0x8000;
29     return ux.f;
30 }
31 #endif
32