1 1.1.1.10 mrg ; Copyright (C) 2012-2024 Free Software Foundation, Inc. 2 1.1 mrg ; Contributed by Red Hat. 3 1.1 mrg ; 4 1.1 mrg ; This file is free software; you can redistribute it and/or modify it 5 1.1 mrg ; under the terms of the GNU General Public License as published by the 6 1.1 mrg ; Free Software Foundation; either version 3, or (at your option) any 7 1.1 mrg ; later version. 8 1.1 mrg ; 9 1.1 mrg ; This file is distributed in the hope that it will be useful, but 10 1.1 mrg ; WITHOUT ANY WARRANTY; without even the implied warranty of 11 1.1 mrg ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 1.1 mrg ; General Public License for more details. 13 1.1 mrg ; 14 1.1 mrg ; Under Section 7 of GPL version 3, you are granted additional 15 1.1 mrg ; permissions described in the GCC Runtime Library Exception, version 16 1.1 mrg ; 3.1, as published by the Free Software Foundation. 17 1.1 mrg ; 18 1.1 mrg ; You should have received a copy of the GNU General Public License and 19 1.1 mrg ; a copy of the GCC Runtime Library Exception along with this program; 20 1.1 mrg ; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 21 1.1 mrg ; <http://www.gnu.org/licenses/>. 22 1.1 mrg 23 1.1 mrg #include "vregs.h" 24 1.1 mrg 25 1.1 mrg ;; int signbitf (float X) 26 1.1 mrg ;; int signbit (double X) 27 1.1 mrg ;; int signbitl (long double X) 28 1.1 mrg ;; 29 1.1 mrg ;; `signbit' returns a nonzero value if the value of X has its sign 30 1.1 mrg ;; bit set. 31 1.1 mrg ;; 32 1.1 mrg ;; This is not the same as `x < 0.0', because IEEE 754 floating point 33 1.1 mrg ;; allows zero to be signed. The comparison `-0.0 < 0.0' is false, 34 1.1 mrg ;; but `signbit (-0.0)' will return a nonzero value. 35 1.1 mrg 36 1.1 mrg ;---------------------------------------------------------------------- 37 1.1 mrg 38 1.1 mrg .text 39 1.1 mrg 40 1.1 mrg START_FUNC _signbit 41 1.1 mrg START_ANOTHER_FUNC _signbitf 42 1.1 mrg ;; X is at [sp+4]..[SP+7] 43 1.1 mrg ;; result is in R8..R9 44 1.1 mrg 45 1.1 mrg movw r8, #0 46 1.1 mrg mov a, [sp+7] 47 1.1 mrg mov1 cy, a.7 48 1.1 mrg sknc 49 1.1 mrg movw r8, #1 50 1.1 mrg ret 51 1.1 mrg END_ANOTHER_FUNC _signbitf 52 1.1 mrg END_FUNC _signbit 53 1.1 mrg 54 1.1 mrg 55 1.1 mrg START_FUNC _signbitl 56 1.1 mrg ;; X is at [sp+4]..[SP+7] 57 1.1 mrg ;; result is in R8..R9 58 1.1 mrg 59 1.1 mrg movw r8, #0 60 1.1 mrg mov a, [sp+11] 61 1.1 mrg mov1 cy, a.7 62 1.1 mrg sknc 63 1.1 mrg movw r8, #1 64 1.1 mrg ret 65 1.1 mrg END_FUNC _signbitl 66