]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386-protos.h (x86_emit_floatuns): Declare.
authorJan Hubicka <jh@suse.cz>
Wed, 5 Feb 2003 22:13:40 +0000 (23:13 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 5 Feb 2003 22:13:40 +0000 (22:13 +0000)
* i386-protos.h (x86_emit_floatuns):  Declare.
* i386.c (x86_emit_floatuns): New global function.
* i386.md (floatunssisf2, floatunsdisf2,
floatunsdidf2):  New patterns.

From-SVN: r62452

gcc/ChangeLog
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.md

index 0bcfdb476f62f92ff3111b2accaf5031784f970c..4c27343b56302f00ccd0d447185858fb2ed91a26 100644 (file)
@@ -1,3 +1,10 @@
+Wed Feb  5 23:12:57 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * i386-protos.h (x86_emit_floatuns):  Declare.
+       * i386.c (x86_emit_floatuns): New global function.
+       * i386.md (floatunssisf2, floatunsdisf2,
+       floatunsdidf2):  New patterns.
+
 2003-01-25  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * cfgloopmanip.c (force_single_succ_latches): Fix missindentation.
index c5349a01d28f7007c55572fe9d9fad6ebd4091f2..46493fd3c1242fd21fc53887ff403fd4f0f65863 100644 (file)
@@ -189,6 +189,7 @@ extern void emit_i387_cw_initialization PARAMS ((rtx, rtx));
 extern bool ix86_fp_jump_nontrivial_p PARAMS ((enum rtx_code));
 extern void x86_order_regs_for_local_alloc PARAMS ((void));
 extern void x86_function_profiler PARAMS ((FILE *, int));
+extern void x86_emit_floatuns PARAMS ((rtx [2]));
 
 
 #ifdef TREE_CODE
index 3f2deee968862e197947e47e804d140b8fda88bf..3a3a2f93d8ee109b43a1e89d94ece3bc94eee871 100644 (file)
@@ -15337,4 +15337,39 @@ x86_extended_reg_mentioned_p (insn)
   return for_each_rtx (&PATTERN (insn), extended_reg_mentioned_1, NULL);
 }
 
+/* Generate an unsigned DImode to FP conversion.  This is the same code
+   optabs would emit if we didn't have TFmode patterns.  */
+
+void
+x86_emit_floatuns (operands)
+     rtx operands[2];
+{
+  rtx neglab, donelab, i0, i1, f0, in, out;
+  enum machine_mode mode;
+
+  out = operands[0];
+  in = force_reg (DImode, operands[1]);
+  mode = GET_MODE (out);
+  neglab = gen_label_rtx ();
+  donelab = gen_label_rtx ();
+  i1 = gen_reg_rtx (Pmode);
+  f0 = gen_reg_rtx (mode);
+
+  emit_cmp_and_jump_insns (in, const0_rtx, LT, const0_rtx, Pmode, 0, neglab);
+
+  emit_insn (gen_rtx_SET (VOIDmode, out, gen_rtx_FLOAT (mode, in)));
+  emit_jump_insn (gen_jump (donelab));
+  emit_barrier ();
+
+  emit_label (neglab);
+
+  i0 = expand_simple_binop (Pmode, LSHIFTRT, in, const1_rtx, NULL, 1, OPTAB_DIRECT);
+  i1 = expand_simple_binop (Pmode, AND, in, const1_rtx, NULL, 1, OPTAB_DIRECT);
+  i0 = expand_simple_binop (Pmode, IOR, i0, i1, i0, 1, OPTAB_DIRECT);
+  expand_float (f0, i0, 0);
+  emit_insn (gen_rtx_SET (VOIDmode, out, gen_rtx_PLUS (mode, f0, f0)));
+
+  emit_label (donelab);
+}
+
 #include "gt-i386.h"
index a1eb241d45e1037f6b8857e15b91e10006bc800f..875617d69961229dbaafeaa724f3212b0d0af349 100644 (file)
   ix86_free_from_memory (GET_MODE (operands[1]));
   DONE;
 })
+
+(define_expand "floatunssisf2"
+  [(use (match_operand:SF 0 "register_operand" ""))
+   (use (match_operand:SI 1 "register_operand" ""))]
+  "TARGET_SSE && TARGET_SSE_MATH && !TARGET_64BIT"
+  "x86_emit_floatuns (operands); DONE;")
+
+(define_expand "floatunsdisf2"
+  [(use (match_operand:SF 0 "register_operand" ""))
+   (use (match_operand:DI 1 "register_operand" ""))]
+  "TARGET_SSE && TARGET_SSE_MATH && TARGET_64BIT"
+  "x86_emit_floatuns (operands); DONE;")
+
+(define_expand "floatunsdidf2"
+  [(use (match_operand:DF 0 "register_operand" ""))
+   (use (match_operand:DI 1 "register_operand" ""))]
+  "TARGET_SSE2 && TARGET_SSE_MATH && TARGET_64BIT"
+  "x86_emit_floatuns (operands); DONE;")
 \f
 ;; Add instructions