Patch to remove x86 fixuns_trunc patterns

John Wehle john@feith.com
Sat Apr 10 00:09:00 GMT 1999


This patch removes the x86 fixuns_trunc patterns since:

  1) The x86 isn't actually capable of converting a float
     to an unsigned integer.

  2) expand_fix in optabs.c is already capable of using
     fix_trunc to implement fixuns_trunc.

ChangeLog:

Sat Apr 10 00:59:58 EDT 1999  John Wehle  (john@feith.com)

	* i386.md (fixuns_truncsfsi2, fixuns_truncdfsi2,
	fixuns_truncxfsi2): Delete.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i386/i386.md.ORIGINAL	Fri Apr  9 22:37:59 1999
--- gcc/config/i386/i386.md	Sat Apr 10 00:35:48 1999
***************
*** 2663,2737 ****
  }"
    [(set_attr "type" "fpop")])
  
- ;; The 387 requires that the stack top dies after converting to DImode.
- 
- ;; Represent an unsigned conversion from SImode to MODE_FLOAT by first
- ;; doing a signed conversion to DImode, and then taking just the low
- ;; part.
- 
- (define_expand "fixuns_truncxfsi2"
-   [(set (match_dup 4)
- 	(match_operand:XF 1 "register_operand" ""))
-    (parallel [(set (match_dup 2)
- 		   (fix:DI (fix:XF (match_dup 4))))
- 	      (clobber (match_dup 4))
- 	      (clobber (match_dup 5))
- 	      (clobber (match_dup 6))
- 	      (clobber (match_scratch:SI 7 ""))])
-    (set (match_operand:SI 0 "general_operand" "")
- 	(match_dup 3))]
-   "TARGET_80387"
-   "
- {
-   operands[2] = gen_reg_rtx (DImode);
-   operands[3] = gen_lowpart (SImode, operands[2]);
-   operands[4] = gen_reg_rtx (XFmode);
-   operands[5] = (rtx) assign_386_stack_local (SImode, 0);
-   operands[6] = (rtx) assign_386_stack_local (DImode, 1);
- }")
- 
- (define_expand "fixuns_truncdfsi2"
-   [(set (match_dup 4)
- 	(match_operand:DF 1 "register_operand" ""))
-    (parallel [(set (match_dup 2)
- 		   (fix:DI (fix:DF (match_dup 4))))
- 	      (clobber (match_dup 4))
- 	      (clobber (match_dup 5))
- 	      (clobber (match_dup 6))
- 	      (clobber (match_scratch:SI 7 ""))])
-    (set (match_operand:SI 0 "general_operand" "")
- 	(match_dup 3))]
-   "TARGET_80387"
-   "
- {
-   operands[2] = gen_reg_rtx (DImode);
-   operands[3] = gen_lowpart (SImode, operands[2]);
-   operands[4] = gen_reg_rtx (DFmode);
-   operands[5] = (rtx) assign_386_stack_local (SImode, 0);
-   operands[6] = (rtx) assign_386_stack_local (DImode, 1);
- }")
- 
- (define_expand "fixuns_truncsfsi2"
-   [(set (match_dup 4)
- 	(match_operand:SF 1 "register_operand" ""))
-    (parallel [(set (match_dup 2)
- 		   (fix:DI (fix:SF (match_dup 4))))
- 	      (clobber (match_dup 4))
- 	      (clobber (match_dup 5))
- 	      (clobber (match_dup 6))
- 	      (clobber (match_scratch:SI 7 ""))])
-    (set (match_operand:SI 0 "general_operand" "")
- 	(match_dup 3))]
-   "TARGET_80387"
-   "
- {
-   operands[2] = gen_reg_rtx (DImode);
-   operands[3] = gen_lowpart (SImode, operands[2]);
-   operands[4] = gen_reg_rtx (SFmode);
-   operands[5] = (rtx) assign_386_stack_local (SImode, 0);
-   operands[6] = (rtx) assign_386_stack_local (DImode, 1);
- }")
- 
  ;; Signed conversion to DImode.
  
  (define_expand "fix_truncxfdi2"
--- 2663,2668 ----
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc-patches mailing list