summaryrefslogtreecommitdiff
path: root/gcc/reg-stack.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2007-01-31 13:30:20 +0100
committerUros Bizjak <uros@gcc.gnu.org>2007-01-31 13:30:20 +0100
commit9ed4207fce7efe340cbdf1017fa0d1271a710487 (patch)
tree8644f765075eeb7076137f6a73a27bd54182e229 /gcc/reg-stack.c
parent010dc0fdd0c5189383207fde6281d8f9c1e06908 (diff)
downloadgcc-9ed4207fce7efe340cbdf1017fa0d1271a710487.tar.gz
optabs.h (enum optab_index): Add new OTI_isinf.
* optabs.h (enum optab_index): Add new OTI_isinf. (isinf_optab): Define corresponding macro. * optabs.c (init_optabs): Initialize isinf_optab. * genopinit.c (optabs): Implement isinf_optab using isinf?f2 patterns. * builtins.c (mathfn_built_in): Handle BUILT_IN_ISINF{,F,L}. (expand_builtin_interclass_mathfn): Expand BUILT_IN_ISINF{,F,L} using isinf_optab. (expand_builtin): Expand BUILT_IN_ISINF{,F,L} using expand_builtin_interclass_mathfn. * reg_stack.c (subst_stack_regs_pat): Handle UNSPEC_FXAM. * config/i386/i386.md (UNSPEC_FXAM): New constant. (fxam<mode>2_i387): New insn pattern. (isinf<mode>2) New expander to implement isinf, isinff and isinfl built-in functions as x87 inline asm. testsuite/ChangeLog: * gcc.dg/builtins-63.c: New test. From-SVN: r121419
Diffstat (limited to 'gcc/reg-stack.c')
-rw-r--r--gcc/reg-stack.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 0df425eebeb..f21d833c00b 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -1629,6 +1629,27 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
replace_reg (src1, FIRST_STACK_REG);
break;
+ case UNSPEC_FXAM:
+
+ /* This insn only operate on the top of the stack. */
+
+ src1 = get_true_reg (&XVECEXP (pat_src, 0, 0));
+ emit_swap_insn (insn, regstack, *src1);
+
+ src1_note = find_regno_note (insn, REG_DEAD, REGNO (*src1));
+
+ replace_reg (src1, FIRST_STACK_REG);
+
+ if (src1_note)
+ {
+ remove_regno_note (insn, REG_DEAD,
+ REGNO (XEXP (src1_note, 0)));
+ emit_pop_insn (insn, regstack, XEXP (src1_note, 0),
+ EMIT_AFTER);
+ }
+
+ break;
+
case UNSPEC_SIN:
case UNSPEC_COS:
case UNSPEC_FRNDINT: