1 /* Copyright (C) 2008-2018 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 /* XMAC schedule: directly back-to-back multiplies stall; the third
27 instruction after a multiply stalls unless it is also a multiply. */
28 #include "arc-ieee-754.h"
48 bic.f 0,0x7f800000,r12
52 jne_s [blink] ; both NaN -> OK
55 #define __mulsf3 __mulsf3_asm
62 ld.as r9,[pcl,79]; [pcl,((.L7f800000-.+2)/4)]
69 breq r11,0,.Ldenorm_dbl0
71 breq r11,r9,.Linf_nan_dbl0
74 breq r12,0,.Ldenorm_dbl1
81 ld.as r4,[pcl,64]; [pcl,((.L7fffffff-.+2)/4)]
84 breq r12,r9,.Linf_nan_dbl1
95 ; infinity or denormal number
102 brhi r2,24,.Lret_r0 ; right shift shift > 24 -> return +-0
116 .Lret_r0: j_s [blink]
120 sub_s r2,r1,1 ; inf/nan * 0 -> nan; inf * nan -> nan (use |r2| >= inf)
129 .Ldenorm_dbl0_inf_nan_dbl1:
148 breq r12,r9,.Ldenorm_dbl0_inf_nan_dbl1
170 bhi.d .Lpast_denorm_dbl1