1 /* Copyright (C) 2008-2012 Free Software Foundation, Inc.
2 Contributor: Joern Rennecke <joern.rennecke@embecosm.com>
3 on behalf of Synopsys Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
26 #include "../arc-ieee-754.h"
46 bic.f 0,0x7f800000,r12
50 jne_s [blink] ; both NaN -> OK
53 #define __mulsf3 __mulsf3_asm
60 ld.as r9,[pcl,80]; [pcl,((.L7f800000-.+2)/4)]
66 breq.d r11,0,.Ldenorm_dbl0
68 breq.d r12,0,.Ldenorm_dbl1
72 breq.d r11,r9,.Linf_nan_dbl0
73 ld.as r4,[pcl,69]; [pcl,((.L7fffffff-.+2)/4)]
74 breq.d r12,r9,.Linf_nan_dbl1
93 ; infinity or denormal number
100 brhi.d r2,24,.Lret_r0 ; right shift shift > 24 -> return +-0
114 .Lret_r0: j_s [blink]
122 breq.d r12,r9,.Ldenorm_dbl0_inf_nan_dbl1
127 ld.as r4,[pcl,28]; [pcl,((.L7fffffff-.+2)/4)]
135 .Ldenorm_dbl0_inf_nan_dbl1:
147 breq.d r11,r9,.Linf_nan_dbl0_2
156 ld.as r4,[pcl,11]; [pcl,((.L7fffffff-.+2)/4)]
166 sub.eq r1,r1,1 ; inf/nan * 0 -> nan
169 or.eq r0,r0,r1 ; r1 nan -> result nan