1 /* Copyright (C) 2008-2015 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,76]; [pcl,((.L7f800000-.+2)/4)]
65 breq.d r11,0,.Ldenorm_dbl0
68 breq.d r11,r9,.Linf_nan_dbl0
70 breq r12,0,.Ldenorm_dbl1
71 breq r12,r9,.Linf_nan_dbl1
75 ; We could so this a bit faster here with a 32 bit shift register and
76 ; inserting the r2 factor / retrieving the low result a byte at a time,
77 ; but that'd increase code size.
85 ld.as r4,[pcl,59]; [pcl,((.L7fffffff-.+2)/4)]
102 ; infinity or denormal number
109 brhi.d r2,24,.Lret_r0 ; right shift shift > 24 -> return +-0
123 .Lret_r0: j_s [blink]
131 breq.d r12,r9,.Ldenorm_dbl0_inf_nan_dbl1
141 .Ldenorm_dbl0_inf_nan_dbl1:
151 sub_s r2,r1,1 ; inf/nan * 0 -> nan; inf * nan -> nan (use |r2| >= inf)