1;; GCC machine description for IA-32 and x86-64.
2;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3;; 2001, 2002, 2003, 2004, 2005, 2006
4;; Free Software Foundation, Inc.
5;; Mostly by William Schelter.
6;; x86_64 support added by Jan Hubicka
7;;
8;; This file is part of GCC.
--- 139 unchanged lines hidden (view full) ---
148 (UNSPEC_SP_TEST 101)
149 (UNSPEC_SP_TLS_SET 102)
150 (UNSPEC_SP_TLS_TEST 103)
151
152 ; SSSE3
153 (UNSPEC_PSHUFB 120)
154 (UNSPEC_PSIGN 121)
155 (UNSPEC_PALIGNR 122)
156 ])
157
158(define_constants
159 [(UNSPECV_BLOCKAGE 0)
160 (UNSPECV_STACK_PROBE 1)
161 (UNSPECV_EMMS 2)
162 (UNSPECV_LDMXCSR 3)
163 (UNSPECV_STMXCSR 4)
--- 23 unchanged lines hidden (view full) ---
187;; In C guard expressions, put expressions which may be compile-time
188;; constants first. This allows for better optimization. For
189;; example, write "TARGET_64BIT && reload_completed", not
190;; "reload_completed && TARGET_64BIT".
191
192
193;; Processor type. This attribute must exactly match the processor_type
194;; enumeration in i386.h.
195(define_attr "cpu" "i386,i486,pentium,pentiumpro,geode,k6,athlon,pentium4,k8,nocona,core2,generic32,generic64"
196 (const (symbol_ref "ix86_tune")))
197
198;; A basic instruction type. Refinements due to arguments to be
199;; provided in other attributes.
200(define_attr "type"
201 "other,multi,
202 alu,alu1,negnot,imov,imovx,lea,
203 incdec,ishift,ishift1,rotate,rotate1,imul,idiv,
204 icmp,test,ibr,setcc,icmov,
205 push,pop,call,callv,leave,
206 str,cld,
207 fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint,
208 sselog,sselog1,sseiadd,sseishft,sseimul,
209 sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv,
210 mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft"
211 (const_string "other"))
212
213;; Main data type used by the insn
214(define_attr "mode"
215 "unknown,none,QI,HI,SI,DI,SF,DF,XF,TI,V4SF,V2DF,V2SF,V1DF"
216 (const_string "unknown"))
217
218;; The CPU unit operations uses.
219(define_attr "unit" "integer,i387,sse,mmx,unknown"
220 (cond [(eq_attr "type" "fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint")
221 (const_string "i387")
222 (eq_attr "type" "sselog,sselog1,sseiadd,sseishft,sseimul,
223 sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv")
224 (const_string "sse")
225 (eq_attr "type" "mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft")
226 (const_string "mmx")
227 (eq_attr "type" "other")
228 (const_string "unknown")]
229 (const_string "integer")))
230
231;; The (bounding maximum) length of an instruction immediate.
232(define_attr "length_immediate" ""
233 (cond [(eq_attr "type" "incdec,setcc,icmov,str,cld,lea,other,multi,idiv,leave")
234 (const_int 0)
235 (eq_attr "unit" "i387,sse,mmx")
236 (const_int 0)
237 (eq_attr "type" "alu,alu1,negnot,imovx,ishift,rotate,ishift1,rotate1,
238 imul,icmp,push,pop")
239 (symbol_ref "ix86_attr_length_immediate_default(insn,1)")
240 (eq_attr "type" "imov,test")
241 (symbol_ref "ix86_attr_length_immediate_default(insn,0)")
--- 37 unchanged lines hidden (view full) ---
279(define_attr "prefix_rep" ""
280 (if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF"))
281 (const_int 1)
282 (const_int 0)))
283
284;; Set when 0f opcode prefix is used.
285(define_attr "prefix_0f" ""
286 (if_then_else
287 (ior (eq_attr "type" "imovx,setcc,icmov")
288 (eq_attr "unit" "sse,mmx"))
289 (const_int 1)
290 (const_int 0)))
291
292;; Set when REX opcode prefix is used.
293(define_attr "prefix_rex" ""
294 (cond [(and (eq_attr "mode" "DI")
295 (eq_attr "type" "!push,pop,call,callv,leave,ibr"))
--- 112 unchanged lines hidden (view full) ---
408 (match_operand 1 "memory_operand" ""))
409 (const_string "both")
410 (match_operand 0 "memory_operand" "")
411 (const_string "store")
412 (match_operand 1 "memory_operand" "")
413 (const_string "load")
414 (and (eq_attr "type"
415 "!alu1,negnot,ishift1,
416 imov,imovx,icmp,test,
417 fmov,fcmp,fsgn,
418 sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,sselog1,
419 mmx,mmxmov,mmxcmp,mmxcvt")
420 (match_operand 2 "memory_operand" ""))
421 (const_string "load")
422 (and (eq_attr "type" "icmov")
423 (match_operand 3 "memory_operand" ""))
424 (const_string "load")
--- 538 unchanged lines hidden (view full) ---
963
964(define_insn "x86_sahf_1"
965 [(set (reg:CC FLAGS_REG)
966 (unspec:CC [(match_operand:HI 0 "register_operand" "a")] UNSPEC_SAHF))]
967 "!TARGET_64BIT"
968 "sahf"
969 [(set_attr "length" "1")
970 (set_attr "athlon_decode" "vector")
971 (set_attr "mode" "SI")])
972
973;; Pentium Pro can do steps 1 through 3 in one go.
974
975(define_insn "*cmpfp_i_mixed"
976 [(set (reg:CCFP FLAGS_REG)
977 (compare:CCFP (match_operand 0 "register_operand" "f,x")
978 (match_operand 1 "nonimmediate_operand" "f,xm")))]
979 "TARGET_MIX_SSE_I387
980 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
981 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
982 "* return output_fp_compare (insn, operands, 1, 0);"
983 [(set_attr "type" "fcmp,ssecomi")
984 (set (attr "mode")
985 (if_then_else (match_operand:SF 1 "" "")
986 (const_string "SF")
987 (const_string "DF")))
988 (set_attr "athlon_decode" "vector")])
989
990(define_insn "*cmpfp_i_sse"
991 [(set (reg:CCFP FLAGS_REG)
992 (compare:CCFP (match_operand 0 "register_operand" "x")
993 (match_operand 1 "nonimmediate_operand" "xm")))]
994 "TARGET_SSE_MATH
995 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
996 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
997 "* return output_fp_compare (insn, operands, 1, 0);"
998 [(set_attr "type" "ssecomi")
999 (set (attr "mode")
1000 (if_then_else (match_operand:SF 1 "" "")
1001 (const_string "SF")
1002 (const_string "DF")))
1003 (set_attr "athlon_decode" "vector")])
1004
1005(define_insn "*cmpfp_i_i387"
1006 [(set (reg:CCFP FLAGS_REG)
1007 (compare:CCFP (match_operand 0 "register_operand" "f")
1008 (match_operand 1 "register_operand" "f")))]
1009 "TARGET_80387 && TARGET_CMOVE
1010 && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0])))
1011 && FLOAT_MODE_P (GET_MODE (operands[0]))
1012 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1013 "* return output_fp_compare (insn, operands, 1, 0);"
1014 [(set_attr "type" "fcmp")
1015 (set (attr "mode")
1016 (cond [(match_operand:SF 1 "" "")
1017 (const_string "SF")
1018 (match_operand:DF 1 "" "")
1019 (const_string "DF")
1020 ]
1021 (const_string "XF")))
1022 (set_attr "athlon_decode" "vector")])
1023
1024(define_insn "*cmpfp_iu_mixed"
1025 [(set (reg:CCFPU FLAGS_REG)
1026 (compare:CCFPU (match_operand 0 "register_operand" "f,x")
1027 (match_operand 1 "nonimmediate_operand" "f,xm")))]
1028 "TARGET_MIX_SSE_I387
1029 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
1030 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1031 "* return output_fp_compare (insn, operands, 1, 1);"
1032 [(set_attr "type" "fcmp,ssecomi")
1033 (set (attr "mode")
1034 (if_then_else (match_operand:SF 1 "" "")
1035 (const_string "SF")
1036 (const_string "DF")))
1037 (set_attr "athlon_decode" "vector")])
1038
1039(define_insn "*cmpfp_iu_sse"
1040 [(set (reg:CCFPU FLAGS_REG)
1041 (compare:CCFPU (match_operand 0 "register_operand" "x")
1042 (match_operand 1 "nonimmediate_operand" "xm")))]
1043 "TARGET_SSE_MATH
1044 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
1045 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1046 "* return output_fp_compare (insn, operands, 1, 1);"
1047 [(set_attr "type" "ssecomi")
1048 (set (attr "mode")
1049 (if_then_else (match_operand:SF 1 "" "")
1050 (const_string "SF")
1051 (const_string "DF")))
1052 (set_attr "athlon_decode" "vector")])
1053
1054(define_insn "*cmpfp_iu_387"
1055 [(set (reg:CCFPU FLAGS_REG)
1056 (compare:CCFPU (match_operand 0 "register_operand" "f")
1057 (match_operand 1 "register_operand" "f")))]
1058 "TARGET_80387 && TARGET_CMOVE
1059 && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0])))
1060 && FLOAT_MODE_P (GET_MODE (operands[0]))
1061 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1062 "* return output_fp_compare (insn, operands, 1, 1);"
1063 [(set_attr "type" "fcmp")
1064 (set (attr "mode")
1065 (cond [(match_operand:SF 1 "" "")
1066 (const_string "SF")
1067 (match_operand:DF 1 "" "")
1068 (const_string "DF")
1069 ]
1070 (const_string "XF")))
1071 (set_attr "athlon_decode" "vector")])
1072
1073;; Move instructions.
1074
1075;; General case of fullword move.
1076
1077(define_expand "movsi"
1078 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1079 (match_operand:SI 1 "general_operand" ""))]
--- 189 unchanged lines hidden (view full) ---
1269 (match_operand:SI 1 "register_operand" "+r"))
1270 (set (match_dup 1)
1271 (match_dup 0))]
1272 ""
1273 "xchg{l}\t%1, %0"
1274 [(set_attr "type" "imov")
1275 (set_attr "mode" "SI")
1276 (set_attr "pent_pair" "np")
1277 (set_attr "athlon_decode" "vector")])
1278
1279(define_expand "movhi"
1280 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1281 (match_operand:HI 1 "general_operand" ""))]
1282 ""
1283 "ix86_expand_move (HImode, operands); DONE;")
1284
1285(define_insn "*pushhi2"
--- 100 unchanged lines hidden (view full) ---
1386 (match_operand:HI 1 "register_operand" "+r"))
1387 (set (match_dup 1)
1388 (match_dup 0))]
1389 "!TARGET_PARTIAL_REG_STALL || optimize_size"
1390 "xchg{l}\t%k1, %k0"
1391 [(set_attr "type" "imov")
1392 (set_attr "mode" "SI")
1393 (set_attr "pent_pair" "np")
1394 (set_attr "athlon_decode" "vector")])
1395
1396(define_insn "*swaphi_2"
1397 [(set (match_operand:HI 0 "register_operand" "+r")
1398 (match_operand:HI 1 "register_operand" "+r"))
1399 (set (match_dup 1)
1400 (match_dup 0))]
1401 "TARGET_PARTIAL_REG_STALL"
1402 "xchg{w}\t%1, %0"
1403 [(set_attr "type" "imov")
--- 156 unchanged lines hidden (view full) ---
1560 (match_operand:QI 1 "register_operand" "+r"))
1561 (set (match_dup 1)
1562 (match_dup 0))]
1563 "!TARGET_PARTIAL_REG_STALL || optimize_size"
1564 "xchg{l}\t%k1, %k0"
1565 [(set_attr "type" "imov")
1566 (set_attr "mode" "SI")
1567 (set_attr "pent_pair" "np")
1568 (set_attr "athlon_decode" "vector")])
1569
1570(define_insn "*swapqi_2"
1571 [(set (match_operand:QI 0 "register_operand" "+q")
1572 (match_operand:QI 1 "register_operand" "+q"))
1573 (set (match_dup 1)
1574 (match_dup 0))]
1575 "TARGET_PARTIAL_REG_STALL"
1576 "xchg{b}\t%1, %0"
1577 [(set_attr "type" "imov")
--- 537 unchanged lines hidden (view full) ---
2115 (match_operand:DI 1 "register_operand" "+r"))
2116 (set (match_dup 1)
2117 (match_dup 0))]
2118 "TARGET_64BIT"
2119 "xchg{q}\t%1, %0"
2120 [(set_attr "type" "imov")
2121 (set_attr "mode" "DI")
2122 (set_attr "pent_pair" "np")
2123 (set_attr "athlon_decode" "vector")])
2124
2125(define_expand "movti"
2126 [(set (match_operand:TI 0 "nonimmediate_operand" "")
2127 (match_operand:TI 1 "nonimmediate_operand" ""))]
2128 "TARGET_SSE || TARGET_64BIT"
2129{
2130 if (TARGET_64BIT)
2131 ix86_expand_move (TImode, operands);
--- 2013 unchanged lines hidden (view full) ---
4145;; When SSE is available, it is always faster to use it!
4146(define_insn "fix_truncsfdi_sse"
4147 [(set (match_operand:DI 0 "register_operand" "=r,r")
4148 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))]
4149 "TARGET_64BIT && TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4150 "cvttss2si{q}\t{%1, %0|%0, %1}"
4151 [(set_attr "type" "sseicvt")
4152 (set_attr "mode" "SF")
4153 (set_attr "athlon_decode" "double,vector")])
4154
4155(define_insn "fix_truncdfdi_sse"
4156 [(set (match_operand:DI 0 "register_operand" "=r,r")
4157 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))]
4158 "TARGET_64BIT && TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4159 "cvttsd2si{q}\t{%1, %0|%0, %1}"
4160 [(set_attr "type" "sseicvt")
4161 (set_attr "mode" "DF")
4162 (set_attr "athlon_decode" "double,vector")])
4163
4164(define_insn "fix_truncsfsi_sse"
4165 [(set (match_operand:SI 0 "register_operand" "=r,r")
4166 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))]
4167 "TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4168 "cvttss2si\t{%1, %0|%0, %1}"
4169 [(set_attr "type" "sseicvt")
4170 (set_attr "mode" "DF")
4171 (set_attr "athlon_decode" "double,vector")])
4172
4173(define_insn "fix_truncdfsi_sse"
4174 [(set (match_operand:SI 0 "register_operand" "=r,r")
4175 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))]
4176 "TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4177 "cvttsd2si\t{%1, %0|%0, %1}"
4178 [(set_attr "type" "sseicvt")
4179 (set_attr "mode" "DF")
4180 (set_attr "athlon_decode" "double,vector")])
4181
4182;; Avoid vector decoded forms of the instruction.
4183(define_peephole2
4184 [(match_scratch:DF 2 "Y")
4185 (set (match_operand:SSEMODEI24 0 "register_operand" "")
4186 (fix:SSEMODEI24 (match_operand:DF 1 "memory_operand" "")))]
4187 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size"
4188 [(set (match_dup 2) (match_dup 1))
--- 244 unchanged lines hidden (view full) ---
4433(define_insn "x86_fldcw_1"
4434 [(set (reg:HI FPSR_REG)
4435 (unspec:HI [(match_operand:HI 0 "memory_operand" "m")] UNSPEC_FLDCW))]
4436 "TARGET_80387"
4437 "fldcw\t%0"
4438 [(set_attr "length" "2")
4439 (set_attr "mode" "HI")
4440 (set_attr "unit" "i387")
4441 (set_attr "athlon_decode" "vector")])
4442
4443;; Conversion between fixed point and floating point.
4444
4445;; Even though we only accept memory inputs, the backend _really_
4446;; wants to be able to do this between registers.
4447
4448(define_expand "floathisf2"
4449 [(set (match_operand:SF 0 "register_operand" "")
--- 34 unchanged lines hidden (view full) ---
4484 fild%z1\t%1
4485 #
4486 cvtsi2ss\t{%1, %0|%0, %1}
4487 cvtsi2ss\t{%1, %0|%0, %1}"
4488 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4489 (set_attr "mode" "SF")
4490 (set_attr "unit" "*,i387,*,*")
4491 (set_attr "athlon_decode" "*,*,vector,double")
4492 (set_attr "fp_int_src" "true")])
4493
4494(define_insn "*floatsisf2_sse"
4495 [(set (match_operand:SF 0 "register_operand" "=x,x")
4496 (float:SF (match_operand:SI 1 "nonimmediate_operand" "r,mr")))]
4497 "TARGET_SSE_MATH"
4498 "cvtsi2ss\t{%1, %0|%0, %1}"
4499 [(set_attr "type" "sseicvt")
4500 (set_attr "mode" "SF")
4501 (set_attr "athlon_decode" "vector,double")
4502 (set_attr "fp_int_src" "true")])
4503
4504(define_insn "*floatsisf2_i387"
4505 [(set (match_operand:SF 0 "register_operand" "=f,f")
4506 (float:SF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))]
4507 "TARGET_80387"
4508 "@
4509 fild%z1\t%1
--- 17 unchanged lines hidden (view full) ---
4527 fild%z1\t%1
4528 #
4529 cvtsi2ss{q}\t{%1, %0|%0, %1}
4530 cvtsi2ss{q}\t{%1, %0|%0, %1}"
4531 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4532 (set_attr "mode" "SF")
4533 (set_attr "unit" "*,i387,*,*")
4534 (set_attr "athlon_decode" "*,*,vector,double")
4535 (set_attr "fp_int_src" "true")])
4536
4537(define_insn "*floatdisf2_sse"
4538 [(set (match_operand:SF 0 "register_operand" "=x,x")
4539 (float:SF (match_operand:DI 1 "nonimmediate_operand" "r,mr")))]
4540 "TARGET_64BIT && TARGET_SSE_MATH"
4541 "cvtsi2ss{q}\t{%1, %0|%0, %1}"
4542 [(set_attr "type" "sseicvt")
4543 (set_attr "mode" "SF")
4544 (set_attr "athlon_decode" "vector,double")
4545 (set_attr "fp_int_src" "true")])
4546
4547(define_insn "*floatdisf2_i387"
4548 [(set (match_operand:SF 0 "register_operand" "=f,f")
4549 (float:SF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))]
4550 "TARGET_80387"
4551 "@
4552 fild%z1\t%1
--- 42 unchanged lines hidden (view full) ---
4595 fild%z1\t%1
4596 #
4597 cvtsi2sd\t{%1, %0|%0, %1}
4598 cvtsi2sd\t{%1, %0|%0, %1}"
4599 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4600 (set_attr "mode" "DF")
4601 (set_attr "unit" "*,i387,*,*")
4602 (set_attr "athlon_decode" "*,*,double,direct")
4603 (set_attr "fp_int_src" "true")])
4604
4605(define_insn "*floatsidf2_sse"
4606 [(set (match_operand:DF 0 "register_operand" "=Y,Y")
4607 (float:DF (match_operand:SI 1 "nonimmediate_operand" "r,mr")))]
4608 "TARGET_SSE2 && TARGET_SSE_MATH"
4609 "cvtsi2sd\t{%1, %0|%0, %1}"
4610 [(set_attr "type" "sseicvt")
4611 (set_attr "mode" "DF")
4612 (set_attr "athlon_decode" "double,direct")
4613 (set_attr "fp_int_src" "true")])
4614
4615(define_insn "*floatsidf2_i387"
4616 [(set (match_operand:DF 0 "register_operand" "=f,f")
4617 (float:DF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))]
4618 "TARGET_80387"
4619 "@
4620 fild%z1\t%1
--- 17 unchanged lines hidden (view full) ---
4638 fild%z1\t%1
4639 #
4640 cvtsi2sd{q}\t{%1, %0|%0, %1}
4641 cvtsi2sd{q}\t{%1, %0|%0, %1}"
4642 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4643 (set_attr "mode" "DF")
4644 (set_attr "unit" "*,i387,*,*")
4645 (set_attr "athlon_decode" "*,*,double,direct")
4646 (set_attr "fp_int_src" "true")])
4647
4648(define_insn "*floatdidf2_sse"
4649 [(set (match_operand:DF 0 "register_operand" "=Y,Y")
4650 (float:DF (match_operand:DI 1 "nonimmediate_operand" "r,mr")))]
4651 "TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH"
4652 "cvtsi2sd{q}\t{%1, %0|%0, %1}"
4653 [(set_attr "type" "sseicvt")
4654 (set_attr "mode" "DF")
4655 (set_attr "athlon_decode" "double,direct")
4656 (set_attr "fp_int_src" "true")])
4657
4658(define_insn "*floatdidf2_i387"
4659 [(set (match_operand:DF 0 "register_operand" "=f,f")
4660 (float:DF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))]
4661 "TARGET_80387"
4662 "@
4663 fild%z1\t%1
--- 2191 unchanged lines hidden (view full) ---
6855(define_expand "muldi3"
6856 [(parallel [(set (match_operand:DI 0 "register_operand" "")
6857 (mult:DI (match_operand:DI 1 "register_operand" "")
6858 (match_operand:DI 2 "x86_64_general_operand" "")))
6859 (clobber (reg:CC FLAGS_REG))])]
6860 "TARGET_64BIT"
6861 "")
6862
6863(define_insn "*muldi3_1_rex64"
6864 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
6865 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%rm,rm,0")
6866 (match_operand:DI 2 "x86_64_general_operand" "K,e,mr")))
6867 (clobber (reg:CC FLAGS_REG))]
6868 "TARGET_64BIT
6869 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
6870 "@
--- 6 unchanged lines hidden (view full) ---
6877 (cond [(eq_attr "cpu" "athlon")
6878 (const_string "vector")
6879 (eq_attr "alternative" "1")
6880 (const_string "vector")
6881 (and (eq_attr "alternative" "2")
6882 (match_operand 1 "memory_operand" ""))
6883 (const_string "vector")]
6884 (const_string "direct")))
6885 (set_attr "mode" "DI")])
6886
6887(define_expand "mulsi3"
6888 [(parallel [(set (match_operand:SI 0 "register_operand" "")
6889 (mult:SI (match_operand:SI 1 "register_operand" "")
6890 (match_operand:SI 2 "general_operand" "")))
6891 (clobber (reg:CC FLAGS_REG))])]
6892 ""
6893 "")
6894
6895(define_insn "*mulsi3_1"
6896 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
6897 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0")
6898 (match_operand:SI 2 "general_operand" "K,i,mr")))
6899 (clobber (reg:CC FLAGS_REG))]
6900 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
6901 "@
6902 imul{l}\t{%2, %1, %0|%0, %1, %2}
--- 5 unchanged lines hidden (view full) ---
6908 (cond [(eq_attr "cpu" "athlon")
6909 (const_string "vector")
6910 (eq_attr "alternative" "1")
6911 (const_string "vector")
6912 (and (eq_attr "alternative" "2")
6913 (match_operand 1 "memory_operand" ""))
6914 (const_string "vector")]
6915 (const_string "direct")))
6916 (set_attr "mode" "SI")])
6917
6918(define_insn "*mulsi3_1_zext"
6919 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
6920 (zero_extend:DI
6921 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0")
6922 (match_operand:SI 2 "general_operand" "K,i,mr"))))
6923 (clobber (reg:CC FLAGS_REG))]
--- 9 unchanged lines hidden (view full) ---
6933 (cond [(eq_attr "cpu" "athlon")
6934 (const_string "vector")
6935 (eq_attr "alternative" "1")
6936 (const_string "vector")
6937 (and (eq_attr "alternative" "2")
6938 (match_operand 1 "memory_operand" ""))
6939 (const_string "vector")]
6940 (const_string "direct")))
6941 (set_attr "mode" "SI")])
6942
6943(define_expand "mulhi3"
6944 [(parallel [(set (match_operand:HI 0 "register_operand" "")
6945 (mult:HI (match_operand:HI 1 "register_operand" "")
6946 (match_operand:HI 2 "general_operand" "")))
6947 (clobber (reg:CC FLAGS_REG))])]
6948 "TARGET_HIMODE_MATH"
6949 "")
6950
6951(define_insn "*mulhi3_1"
6952 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
6953 (mult:HI (match_operand:HI 1 "nonimmediate_operand" "%rm,rm,0")
6954 (match_operand:HI 2 "general_operand" "K,i,mr")))
6955 (clobber (reg:CC FLAGS_REG))]
6956 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
6957 "@
6958 imul{w}\t{%2, %1, %0|%0, %1, %2}
6959 imul{w}\t{%2, %1, %0|%0, %1, %2}
6960 imul{w}\t{%2, %0|%0, %2}"
6961 [(set_attr "type" "imul")
6962 (set_attr "prefix_0f" "0,0,1")
6963 (set (attr "athlon_decode")
6964 (cond [(eq_attr "cpu" "athlon")
6965 (const_string "vector")
6966 (eq_attr "alternative" "1,2")
6967 (const_string "vector")]
6968 (const_string "direct")))
6969 (set_attr "mode" "HI")])
6970
6971(define_expand "mulqi3"
6972 [(parallel [(set (match_operand:QI 0 "register_operand" "")
6973 (mult:QI (match_operand:QI 1 "nonimmediate_operand" "")
6974 (match_operand:QI 2 "register_operand" "")))
6975 (clobber (reg:CC FLAGS_REG))])]
6976 "TARGET_QIMODE_MATH"
6977 "")
6978
6979(define_insn "*mulqi3_1"
6980 [(set (match_operand:QI 0 "register_operand" "=a")
6981 (mult:QI (match_operand:QI 1 "nonimmediate_operand" "%0")
6982 (match_operand:QI 2 "nonimmediate_operand" "qm")))
6983 (clobber (reg:CC FLAGS_REG))]
6984 "TARGET_QIMODE_MATH
6985 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
6986 "mul{b}\t%2"
6987 [(set_attr "type" "imul")
6988 (set_attr "length_immediate" "0")
6989 (set (attr "athlon_decode")
6990 (if_then_else (eq_attr "cpu" "athlon")
6991 (const_string "vector")
6992 (const_string "direct")))
6993 (set_attr "mode" "QI")])
6994
6995(define_expand "umulqihi3"
6996 [(parallel [(set (match_operand:HI 0 "register_operand" "")
6997 (mult:HI (zero_extend:HI
6998 (match_operand:QI 1 "nonimmediate_operand" ""))
6999 (zero_extend:HI
7000 (match_operand:QI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7011 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7012 "mul{b}\t%2"
7013 [(set_attr "type" "imul")
7014 (set_attr "length_immediate" "0")
7015 (set (attr "athlon_decode")
7016 (if_then_else (eq_attr "cpu" "athlon")
7017 (const_string "vector")
7018 (const_string "direct")))
7019 (set_attr "mode" "QI")])
7020
7021(define_expand "mulqihi3"
7022 [(parallel [(set (match_operand:HI 0 "register_operand" "")
7023 (mult:HI (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))
7024 (sign_extend:HI (match_operand:QI 2 "register_operand" ""))))
7025 (clobber (reg:CC FLAGS_REG))])]
7026 "TARGET_QIMODE_MATH"
--- 8 unchanged lines hidden (view full) ---
7035 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7036 "imul{b}\t%2"
7037 [(set_attr "type" "imul")
7038 (set_attr "length_immediate" "0")
7039 (set (attr "athlon_decode")
7040 (if_then_else (eq_attr "cpu" "athlon")
7041 (const_string "vector")
7042 (const_string "direct")))
7043 (set_attr "mode" "QI")])
7044
7045(define_expand "umulditi3"
7046 [(parallel [(set (match_operand:TI 0 "register_operand" "")
7047 (mult:TI (zero_extend:TI
7048 (match_operand:DI 1 "nonimmediate_operand" ""))
7049 (zero_extend:TI
7050 (match_operand:DI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7061 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7062 "mul{q}\t%2"
7063 [(set_attr "type" "imul")
7064 (set_attr "length_immediate" "0")
7065 (set (attr "athlon_decode")
7066 (if_then_else (eq_attr "cpu" "athlon")
7067 (const_string "vector")
7068 (const_string "double")))
7069 (set_attr "mode" "DI")])
7070
7071;; We can't use this pattern in 64bit mode, since it results in two separate 32bit registers
7072(define_expand "umulsidi3"
7073 [(parallel [(set (match_operand:DI 0 "register_operand" "")
7074 (mult:DI (zero_extend:DI
7075 (match_operand:SI 1 "nonimmediate_operand" ""))
7076 (zero_extend:DI
--- 11 unchanged lines hidden (view full) ---
7088 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7089 "mul{l}\t%2"
7090 [(set_attr "type" "imul")
7091 (set_attr "length_immediate" "0")
7092 (set (attr "athlon_decode")
7093 (if_then_else (eq_attr "cpu" "athlon")
7094 (const_string "vector")
7095 (const_string "double")))
7096 (set_attr "mode" "SI")])
7097
7098(define_expand "mulditi3"
7099 [(parallel [(set (match_operand:TI 0 "register_operand" "")
7100 (mult:TI (sign_extend:TI
7101 (match_operand:DI 1 "nonimmediate_operand" ""))
7102 (sign_extend:TI
7103 (match_operand:DI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7114 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7115 "imul{q}\t%2"
7116 [(set_attr "type" "imul")
7117 (set_attr "length_immediate" "0")
7118 (set (attr "athlon_decode")
7119 (if_then_else (eq_attr "cpu" "athlon")
7120 (const_string "vector")
7121 (const_string "double")))
7122 (set_attr "mode" "DI")])
7123
7124(define_expand "mulsidi3"
7125 [(parallel [(set (match_operand:DI 0 "register_operand" "")
7126 (mult:DI (sign_extend:DI
7127 (match_operand:SI 1 "nonimmediate_operand" ""))
7128 (sign_extend:DI
7129 (match_operand:SI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7140 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7141 "imul{l}\t%2"
7142 [(set_attr "type" "imul")
7143 (set_attr "length_immediate" "0")
7144 (set (attr "athlon_decode")
7145 (if_then_else (eq_attr "cpu" "athlon")
7146 (const_string "vector")
7147 (const_string "double")))
7148 (set_attr "mode" "SI")])
7149
7150(define_expand "umuldi3_highpart"
7151 [(parallel [(set (match_operand:DI 0 "register_operand" "")
7152 (truncate:DI
7153 (lshiftrt:TI
7154 (mult:TI (zero_extend:TI
7155 (match_operand:DI 1 "nonimmediate_operand" ""))
--- 20 unchanged lines hidden (view full) ---
7176 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7177 "mul{q}\t%2"
7178 [(set_attr "type" "imul")
7179 (set_attr "length_immediate" "0")
7180 (set (attr "athlon_decode")
7181 (if_then_else (eq_attr "cpu" "athlon")
7182 (const_string "vector")
7183 (const_string "double")))
7184 (set_attr "mode" "DI")])
7185
7186(define_expand "umulsi3_highpart"
7187 [(parallel [(set (match_operand:SI 0 "register_operand" "")
7188 (truncate:SI
7189 (lshiftrt:DI
7190 (mult:DI (zero_extend:DI
7191 (match_operand:SI 1 "nonimmediate_operand" ""))
--- 19 unchanged lines hidden (view full) ---
7211 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
7212 "mul{l}\t%2"
7213 [(set_attr "type" "imul")
7214 (set_attr "length_immediate" "0")
7215 (set (attr "athlon_decode")
7216 (if_then_else (eq_attr "cpu" "athlon")
7217 (const_string "vector")
7218 (const_string "double")))
7219 (set_attr "mode" "SI")])
7220
7221(define_insn "*umulsi3_highpart_zext"
7222 [(set (match_operand:DI 0 "register_operand" "=d")
7223 (zero_extend:DI (truncate:SI
7224 (lshiftrt:DI
7225 (mult:DI (zero_extend:DI
7226 (match_operand:SI 1 "nonimmediate_operand" "%a"))
--- 6 unchanged lines hidden (view full) ---
7233 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7234 "mul{l}\t%2"
7235 [(set_attr "type" "imul")
7236 (set_attr "length_immediate" "0")
7237 (set (attr "athlon_decode")
7238 (if_then_else (eq_attr "cpu" "athlon")
7239 (const_string "vector")
7240 (const_string "double")))
7241 (set_attr "mode" "SI")])
7242
7243(define_expand "smuldi3_highpart"
7244 [(parallel [(set (match_operand:DI 0 "register_operand" "=d")
7245 (truncate:DI
7246 (lshiftrt:TI
7247 (mult:TI (sign_extend:TI
7248 (match_operand:DI 1 "nonimmediate_operand" ""))
--- 19 unchanged lines hidden (view full) ---
7268 "TARGET_64BIT
7269 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7270 "imul{q}\t%2"
7271 [(set_attr "type" "imul")
7272 (set (attr "athlon_decode")
7273 (if_then_else (eq_attr "cpu" "athlon")
7274 (const_string "vector")
7275 (const_string "double")))
7276 (set_attr "mode" "DI")])
7277
7278(define_expand "smulsi3_highpart"
7279 [(parallel [(set (match_operand:SI 0 "register_operand" "")
7280 (truncate:SI
7281 (lshiftrt:DI
7282 (mult:DI (sign_extend:DI
7283 (match_operand:SI 1 "nonimmediate_operand" ""))
--- 18 unchanged lines hidden (view full) ---
7302 (clobber (reg:CC FLAGS_REG))]
7303 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
7304 "imul{l}\t%2"
7305 [(set_attr "type" "imul")
7306 (set (attr "athlon_decode")
7307 (if_then_else (eq_attr "cpu" "athlon")
7308 (const_string "vector")
7309 (const_string "double")))
7310 (set_attr "mode" "SI")])
7311
7312(define_insn "*smulsi3_highpart_zext"
7313 [(set (match_operand:DI 0 "register_operand" "=d")
7314 (zero_extend:DI (truncate:SI
7315 (lshiftrt:DI
7316 (mult:DI (sign_extend:DI
7317 (match_operand:SI 1 "nonimmediate_operand" "%a"))
--- 5 unchanged lines hidden (view full) ---
7323 "TARGET_64BIT
7324 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7325 "imul{l}\t%2"
7326 [(set_attr "type" "imul")
7327 (set (attr "athlon_decode")
7328 (if_then_else (eq_attr "cpu" "athlon")
7329 (const_string "vector")
7330 (const_string "double")))
7331 (set_attr "mode" "SI")])
7332
7333;; The patterns that match these are at the end of this file.
7334
7335(define_expand "mulxf3"
7336 [(set (match_operand:XF 0 "register_operand" "")
7337 (mult:XF (match_operand:XF 1 "register_operand" "")
7338 (match_operand:XF 2 "register_operand" "")))]
--- 2965 unchanged lines hidden (view full) ---
10304 (clobber (reg:CC FLAGS_REG))]
10305 "TARGET_64BIT"
10306 "@
10307 shld{q}\t{%2, %1, %0|%0, %1, %2}
10308 shld{q}\t{%s2%1, %0|%0, %1, %2}"
10309 [(set_attr "type" "ishift")
10310 (set_attr "prefix_0f" "1")
10311 (set_attr "mode" "DI")
10312 (set_attr "athlon_decode" "vector")])
10313
10314(define_expand "x86_64_shift_adj"
10315 [(set (reg:CCZ FLAGS_REG)
10316 (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "")
10317 (const_int 64))
10318 (const_int 0)))
10319 (set (match_operand:DI 0 "register_operand" "")
10320 (if_then_else:DI (ne (reg:CCZ FLAGS_REG) (const_int 0))
--- 198 unchanged lines hidden (view full) ---
10519 ""
10520 "@
10521 shld{l}\t{%2, %1, %0|%0, %1, %2}
10522 shld{l}\t{%s2%1, %0|%0, %1, %2}"
10523 [(set_attr "type" "ishift")
10524 (set_attr "prefix_0f" "1")
10525 (set_attr "mode" "SI")
10526 (set_attr "pent_pair" "np")
10527 (set_attr "athlon_decode" "vector")])
10528
10529(define_expand "x86_shift_adj_1"
10530 [(set (reg:CCZ FLAGS_REG)
10531 (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "")
10532 (const_int 32))
10533 (const_int 0)))
10534 (set (match_operand:SI 0 "register_operand" "")
10535 (if_then_else:SI (ne (reg:CCZ FLAGS_REG) (const_int 0))
--- 743 unchanged lines hidden (view full) ---
11279 (clobber (reg:CC FLAGS_REG))]
11280 "TARGET_64BIT"
11281 "@
11282 shrd{q}\t{%2, %1, %0|%0, %1, %2}
11283 shrd{q}\t{%s2%1, %0|%0, %1, %2}"
11284 [(set_attr "type" "ishift")
11285 (set_attr "prefix_0f" "1")
11286 (set_attr "mode" "DI")
11287 (set_attr "athlon_decode" "vector")])
11288
11289(define_expand "ashrdi3"
11290 [(set (match_operand:DI 0 "shiftdi_operand" "")
11291 (ashiftrt:DI (match_operand:DI 1 "shiftdi_operand" "")
11292 (match_operand:QI 2 "nonmemory_operand" "")))]
11293 ""
11294 "ix86_expand_binary_operator (ASHIFTRT, DImode, operands); DONE;")
11295
--- 3257 unchanged lines hidden (view full) ---
14553 [(set (match_operand:SI 0 "register_operand" "")
14554 (minus:SI (const_int 31)
14555 (clz:SI (match_operand:SI 1 "nonimmediate_operand" ""))))
14556 (clobber (reg:CC FLAGS_REG))])
14557 (parallel
14558 [(set (match_dup 0) (xor:SI (match_dup 0) (const_int 31)))
14559 (clobber (reg:CC FLAGS_REG))])]
14560 ""
14561 "")
14562
14563(define_insn "*bsr"
14564 [(set (match_operand:SI 0 "register_operand" "=r")
14565 (minus:SI (const_int 31)
14566 (clz:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))))
14567 (clobber (reg:CC FLAGS_REG))]
14568 ""
14569 "bsr{l}\t{%1, %0|%0, %1}"
14570 [(set_attr "prefix_0f" "1")])
14571
14572(define_expand "clzdi2"
14573 [(parallel
14574 [(set (match_operand:DI 0 "register_operand" "")
14575 (minus:DI (const_int 63)
14576 (clz:DI (match_operand:DI 1 "nonimmediate_operand" ""))))
14577 (clobber (reg:CC FLAGS_REG))])
14578 (parallel
14579 [(set (match_dup 0) (xor:DI (match_dup 0) (const_int 63)))
14580 (clobber (reg:CC FLAGS_REG))])]
14581 "TARGET_64BIT"
14582 "")
14583
14584(define_insn "*bsr_rex64"
14585 [(set (match_operand:DI 0 "register_operand" "=r")
14586 (minus:DI (const_int 63)
14587 (clz:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))))
14588 (clobber (reg:CC FLAGS_REG))]
14589 "TARGET_64BIT"
14590 "bsr{q}\t{%1, %0|%0, %1}"
14591 [(set_attr "prefix_0f" "1")])
14592
14593;; Thread-local storage patterns for ELF.
14594;;
14595;; Note that these code sequences must appear exactly as shown
14596;; in order to allow linker relaxation.
14597
14598(define_insn "*tls_global_dynamic_32_gnu"
14599 [(set (match_operand:SI 0 "register_operand" "=a")
--- 889 unchanged lines hidden (view full) ---
15489 [(set (match_operand:SF 0 "register_operand" "=f,x")
15490 (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "0,xm")))]
15491 "TARGET_USE_FANCY_MATH_387 && TARGET_MIX_SSE_I387"
15492 "@
15493 fsqrt
15494 sqrtss\t{%1, %0|%0, %1}"
15495 [(set_attr "type" "fpspc,sse")
15496 (set_attr "mode" "SF,SF")
15497 (set_attr "athlon_decode" "direct,*")])
15498
15499(define_insn "*sqrtsf2_sse"
15500 [(set (match_operand:SF 0 "register_operand" "=x")
15501 (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "xm")))]
15502 "TARGET_SSE_MATH"
15503 "sqrtss\t{%1, %0|%0, %1}"
15504 [(set_attr "type" "sse")
15505 (set_attr "mode" "SF")
15506 (set_attr "athlon_decode" "*")])
15507
15508(define_insn "*sqrtsf2_i387"
15509 [(set (match_operand:SF 0 "register_operand" "=f")
15510 (sqrt:SF (match_operand:SF 1 "register_operand" "0")))]
15511 "TARGET_USE_FANCY_MATH_387"
15512 "fsqrt"
15513 [(set_attr "type" "fpspc")
15514 (set_attr "mode" "SF")
15515 (set_attr "athlon_decode" "direct")])
15516
15517(define_expand "sqrtdf2"
15518 [(set (match_operand:DF 0 "register_operand" "")
15519 (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "")))]
15520 "TARGET_USE_FANCY_MATH_387 || (TARGET_SSE2 && TARGET_SSE_MATH)"
15521{
15522 if (!(TARGET_SSE2 && TARGET_SSE_MATH))
15523 operands[1] = force_reg (DFmode, operands[1]);
15524})
15525
15526(define_insn "*sqrtdf2_mixed"
15527 [(set (match_operand:DF 0 "register_operand" "=f,Y")
15528 (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "0,Ym")))]
15529 "TARGET_USE_FANCY_MATH_387 && TARGET_SSE2 && TARGET_MIX_SSE_I387"
15530 "@
15531 fsqrt
15532 sqrtsd\t{%1, %0|%0, %1}"
15533 [(set_attr "type" "fpspc,sse")
15534 (set_attr "mode" "DF,DF")
15535 (set_attr "athlon_decode" "direct,*")])
15536
15537(define_insn "*sqrtdf2_sse"
15538 [(set (match_operand:DF 0 "register_operand" "=Y")
15539 (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "Ym")))]
15540 "TARGET_SSE2 && TARGET_SSE_MATH"
15541 "sqrtsd\t{%1, %0|%0, %1}"
15542 [(set_attr "type" "sse")
15543 (set_attr "mode" "DF")
15544 (set_attr "athlon_decode" "*")])
15545
15546(define_insn "*sqrtdf2_i387"
15547 [(set (match_operand:DF 0 "register_operand" "=f")
15548 (sqrt:DF (match_operand:DF 1 "register_operand" "0")))]
15549 "TARGET_USE_FANCY_MATH_387"
15550 "fsqrt"
15551 [(set_attr "type" "fpspc")
15552 (set_attr "mode" "DF")
15553 (set_attr "athlon_decode" "direct")])
15554
15555(define_insn "*sqrtextendsfdf2_i387"
15556 [(set (match_operand:DF 0 "register_operand" "=f")
15557 (sqrt:DF (float_extend:DF
15558 (match_operand:SF 1 "register_operand" "0"))))]
15559 "TARGET_USE_FANCY_MATH_387
15560 && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387)"
15561 "fsqrt"
15562 [(set_attr "type" "fpspc")
15563 (set_attr "mode" "DF")
15564 (set_attr "athlon_decode" "direct")])
15565
15566(define_insn "sqrtxf2"
15567 [(set (match_operand:XF 0 "register_operand" "=f")
15568 (sqrt:XF (match_operand:XF 1 "register_operand" "0")))]
15569 "TARGET_USE_FANCY_MATH_387"
15570 "fsqrt"
15571 [(set_attr "type" "fpspc")
15572 (set_attr "mode" "XF")
15573 (set_attr "athlon_decode" "direct")])
15574
15575(define_insn "*sqrtextendsfxf2_i387"
15576 [(set (match_operand:XF 0 "register_operand" "=f")
15577 (sqrt:XF (float_extend:XF
15578 (match_operand:SF 1 "register_operand" "0"))))]
15579 "TARGET_USE_FANCY_MATH_387"
15580 "fsqrt"
15581 [(set_attr "type" "fpspc")
15582 (set_attr "mode" "XF")
15583 (set_attr "athlon_decode" "direct")])
15584
15585(define_insn "*sqrtextenddfxf2_i387"
15586 [(set (match_operand:XF 0 "register_operand" "=f")
15587 (sqrt:XF (float_extend:XF
15588 (match_operand:DF 1 "register_operand" "0"))))]
15589 "TARGET_USE_FANCY_MATH_387"
15590 "fsqrt"
15591 [(set_attr "type" "fpspc")
15592 (set_attr "mode" "XF")
15593 (set_attr "athlon_decode" "direct")])
15594
15595(define_insn "fpremxf4"
15596 [(set (match_operand:XF 0 "register_operand" "=f")
15597 (unspec:XF [(match_operand:XF 2 "register_operand" "0")
15598 (match_operand:XF 3 "register_operand" "1")]
15599 UNSPEC_FPREM_F))
15600 (set (match_operand:XF 1 "register_operand" "=u")
15601 (unspec:XF [(match_dup 2) (match_dup 3)]
--- 4784 unchanged lines hidden (view full) ---
20386;; Imul $32bit_imm, mem, reg is vector decoded, while
20387;; imul $32bit_imm, reg, reg is direct decoded.
20388(define_peephole2
20389 [(match_scratch:DI 3 "r")
20390 (parallel [(set (match_operand:DI 0 "register_operand" "")
20391 (mult:DI (match_operand:DI 1 "memory_operand" "")
20392 (match_operand:DI 2 "immediate_operand" "")))
20393 (clobber (reg:CC FLAGS_REG))])]
20394 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20395 && !satisfies_constraint_K (operands[2])"
20396 [(set (match_dup 3) (match_dup 1))
20397 (parallel [(set (match_dup 0) (mult:DI (match_dup 3) (match_dup 2)))
20398 (clobber (reg:CC FLAGS_REG))])]
20399"")
20400
20401(define_peephole2
20402 [(match_scratch:SI 3 "r")
20403 (parallel [(set (match_operand:SI 0 "register_operand" "")
20404 (mult:SI (match_operand:SI 1 "memory_operand" "")
20405 (match_operand:SI 2 "immediate_operand" "")))
20406 (clobber (reg:CC FLAGS_REG))])]
20407 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20408 && !satisfies_constraint_K (operands[2])"
20409 [(set (match_dup 3) (match_dup 1))
20410 (parallel [(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2)))
20411 (clobber (reg:CC FLAGS_REG))])]
20412"")
20413
20414(define_peephole2
20415 [(match_scratch:SI 3 "r")
20416 (parallel [(set (match_operand:DI 0 "register_operand" "")
20417 (zero_extend:DI
20418 (mult:SI (match_operand:SI 1 "memory_operand" "")
20419 (match_operand:SI 2 "immediate_operand" ""))))
20420 (clobber (reg:CC FLAGS_REG))])]
20421 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20422 && !satisfies_constraint_K (operands[2])"
20423 [(set (match_dup 3) (match_dup 1))
20424 (parallel [(set (match_dup 0) (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2))))
20425 (clobber (reg:CC FLAGS_REG))])]
20426"")
20427
20428;; imul $8/16bit_imm, regmem, reg is vector decoded.
20429;; Convert it into imul reg, reg
20430;; It would be better to force assembler to encode instruction using long
20431;; immediate, but there is apparently no way to do so.
20432(define_peephole2
20433 [(parallel [(set (match_operand:DI 0 "register_operand" "")
20434 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "")
20435 (match_operand:DI 2 "const_int_operand" "")))
20436 (clobber (reg:CC FLAGS_REG))])
20437 (match_scratch:DI 3 "r")]
20438 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20439 && satisfies_constraint_K (operands[2])"
20440 [(set (match_dup 3) (match_dup 2))
20441 (parallel [(set (match_dup 0) (mult:DI (match_dup 0) (match_dup 3)))
20442 (clobber (reg:CC FLAGS_REG))])]
20443{
20444 if (!rtx_equal_p (operands[0], operands[1]))
20445 emit_move_insn (operands[0], operands[1]);
20446})
20447
20448(define_peephole2
20449 [(parallel [(set (match_operand:SI 0 "register_operand" "")
20450 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "")
20451 (match_operand:SI 2 "const_int_operand" "")))
20452 (clobber (reg:CC FLAGS_REG))])
20453 (match_scratch:SI 3 "r")]
20454 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20455 && satisfies_constraint_K (operands[2])"
20456 [(set (match_dup 3) (match_dup 2))
20457 (parallel [(set (match_dup 0) (mult:SI (match_dup 0) (match_dup 3)))
20458 (clobber (reg:CC FLAGS_REG))])]
20459{
20460 if (!rtx_equal_p (operands[0], operands[1]))
20461 emit_move_insn (operands[0], operands[1]);
20462})
20463
20464(define_peephole2
20465 [(parallel [(set (match_operand:HI 0 "register_operand" "")
20466 (mult:HI (match_operand:HI 1 "nonimmediate_operand" "")
20467 (match_operand:HI 2 "immediate_operand" "")))
20468 (clobber (reg:CC FLAGS_REG))])
20469 (match_scratch:HI 3 "r")]
20470 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size"
20471 [(set (match_dup 3) (match_dup 2))
20472 (parallel [(set (match_dup 0) (mult:HI (match_dup 0) (match_dup 3)))
20473 (clobber (reg:CC FLAGS_REG))])]
20474{
20475 if (!rtx_equal_p (operands[0], operands[1]))
20476 emit_move_insn (operands[0], operands[1]);
20477})
20478
--- 480 unchanged lines hidden ---
2;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3;; 2001, 2002, 2003, 2004, 2005, 2006
4;; Free Software Foundation, Inc.
5;; Mostly by William Schelter.
6;; x86_64 support added by Jan Hubicka
7;;
8;; This file is part of GCC.
--- 139 unchanged lines hidden (view full) ---
148 (UNSPEC_SP_TEST 101)
149 (UNSPEC_SP_TLS_SET 102)
150 (UNSPEC_SP_TLS_TEST 103)
151
152 ; SSSE3
153 (UNSPEC_PSHUFB 120)
154 (UNSPEC_PSIGN 121)
155 (UNSPEC_PALIGNR 122)
156 ])
157
158(define_constants
159 [(UNSPECV_BLOCKAGE 0)
160 (UNSPECV_STACK_PROBE 1)
161 (UNSPECV_EMMS 2)
162 (UNSPECV_LDMXCSR 3)
163 (UNSPECV_STMXCSR 4)
--- 23 unchanged lines hidden (view full) ---
187;; In C guard expressions, put expressions which may be compile-time
188;; constants first. This allows for better optimization. For
189;; example, write "TARGET_64BIT && reload_completed", not
190;; "reload_completed && TARGET_64BIT".
191
192
193;; Processor type. This attribute must exactly match the processor_type
194;; enumeration in i386.h.
195(define_attr "cpu" "i386,i486,pentium,pentiumpro,geode,k6,athlon,pentium4,k8,nocona,core2,generic32,generic64"
196 (const (symbol_ref "ix86_tune")))
197
198;; A basic instruction type. Refinements due to arguments to be
199;; provided in other attributes.
200(define_attr "type"
201 "other,multi,
202 alu,alu1,negnot,imov,imovx,lea,
203 incdec,ishift,ishift1,rotate,rotate1,imul,idiv,
204 icmp,test,ibr,setcc,icmov,
205 push,pop,call,callv,leave,
206 str,cld,
207 fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint,
208 sselog,sselog1,sseiadd,sseishft,sseimul,
209 sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv,
210 mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft"
211 (const_string "other"))
212
213;; Main data type used by the insn
214(define_attr "mode"
215 "unknown,none,QI,HI,SI,DI,SF,DF,XF,TI,V4SF,V2DF,V2SF,V1DF"
216 (const_string "unknown"))
217
218;; The CPU unit operations uses.
219(define_attr "unit" "integer,i387,sse,mmx,unknown"
220 (cond [(eq_attr "type" "fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint")
221 (const_string "i387")
222 (eq_attr "type" "sselog,sselog1,sseiadd,sseishft,sseimul,
223 sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv")
224 (const_string "sse")
225 (eq_attr "type" "mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft")
226 (const_string "mmx")
227 (eq_attr "type" "other")
228 (const_string "unknown")]
229 (const_string "integer")))
230
231;; The (bounding maximum) length of an instruction immediate.
232(define_attr "length_immediate" ""
233 (cond [(eq_attr "type" "incdec,setcc,icmov,str,cld,lea,other,multi,idiv,leave")
234 (const_int 0)
235 (eq_attr "unit" "i387,sse,mmx")
236 (const_int 0)
237 (eq_attr "type" "alu,alu1,negnot,imovx,ishift,rotate,ishift1,rotate1,
238 imul,icmp,push,pop")
239 (symbol_ref "ix86_attr_length_immediate_default(insn,1)")
240 (eq_attr "type" "imov,test")
241 (symbol_ref "ix86_attr_length_immediate_default(insn,0)")
--- 37 unchanged lines hidden (view full) ---
279(define_attr "prefix_rep" ""
280 (if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF"))
281 (const_int 1)
282 (const_int 0)))
283
284;; Set when 0f opcode prefix is used.
285(define_attr "prefix_0f" ""
286 (if_then_else
287 (ior (eq_attr "type" "imovx,setcc,icmov")
288 (eq_attr "unit" "sse,mmx"))
289 (const_int 1)
290 (const_int 0)))
291
292;; Set when REX opcode prefix is used.
293(define_attr "prefix_rex" ""
294 (cond [(and (eq_attr "mode" "DI")
295 (eq_attr "type" "!push,pop,call,callv,leave,ibr"))
--- 112 unchanged lines hidden (view full) ---
408 (match_operand 1 "memory_operand" ""))
409 (const_string "both")
410 (match_operand 0 "memory_operand" "")
411 (const_string "store")
412 (match_operand 1 "memory_operand" "")
413 (const_string "load")
414 (and (eq_attr "type"
415 "!alu1,negnot,ishift1,
416 imov,imovx,icmp,test,
417 fmov,fcmp,fsgn,
418 sse,ssemov,ssecmp,ssecomi,ssecvt,sseicvt,sselog1,
419 mmx,mmxmov,mmxcmp,mmxcvt")
420 (match_operand 2 "memory_operand" ""))
421 (const_string "load")
422 (and (eq_attr "type" "icmov")
423 (match_operand 3 "memory_operand" ""))
424 (const_string "load")
--- 538 unchanged lines hidden (view full) ---
963
964(define_insn "x86_sahf_1"
965 [(set (reg:CC FLAGS_REG)
966 (unspec:CC [(match_operand:HI 0 "register_operand" "a")] UNSPEC_SAHF))]
967 "!TARGET_64BIT"
968 "sahf"
969 [(set_attr "length" "1")
970 (set_attr "athlon_decode" "vector")
971 (set_attr "mode" "SI")])
972
973;; Pentium Pro can do steps 1 through 3 in one go.
974
975(define_insn "*cmpfp_i_mixed"
976 [(set (reg:CCFP FLAGS_REG)
977 (compare:CCFP (match_operand 0 "register_operand" "f,x")
978 (match_operand 1 "nonimmediate_operand" "f,xm")))]
979 "TARGET_MIX_SSE_I387
980 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
981 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
982 "* return output_fp_compare (insn, operands, 1, 0);"
983 [(set_attr "type" "fcmp,ssecomi")
984 (set (attr "mode")
985 (if_then_else (match_operand:SF 1 "" "")
986 (const_string "SF")
987 (const_string "DF")))
988 (set_attr "athlon_decode" "vector")])
989
990(define_insn "*cmpfp_i_sse"
991 [(set (reg:CCFP FLAGS_REG)
992 (compare:CCFP (match_operand 0 "register_operand" "x")
993 (match_operand 1 "nonimmediate_operand" "xm")))]
994 "TARGET_SSE_MATH
995 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
996 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
997 "* return output_fp_compare (insn, operands, 1, 0);"
998 [(set_attr "type" "ssecomi")
999 (set (attr "mode")
1000 (if_then_else (match_operand:SF 1 "" "")
1001 (const_string "SF")
1002 (const_string "DF")))
1003 (set_attr "athlon_decode" "vector")])
1004
1005(define_insn "*cmpfp_i_i387"
1006 [(set (reg:CCFP FLAGS_REG)
1007 (compare:CCFP (match_operand 0 "register_operand" "f")
1008 (match_operand 1 "register_operand" "f")))]
1009 "TARGET_80387 && TARGET_CMOVE
1010 && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0])))
1011 && FLOAT_MODE_P (GET_MODE (operands[0]))
1012 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1013 "* return output_fp_compare (insn, operands, 1, 0);"
1014 [(set_attr "type" "fcmp")
1015 (set (attr "mode")
1016 (cond [(match_operand:SF 1 "" "")
1017 (const_string "SF")
1018 (match_operand:DF 1 "" "")
1019 (const_string "DF")
1020 ]
1021 (const_string "XF")))
1022 (set_attr "athlon_decode" "vector")])
1023
1024(define_insn "*cmpfp_iu_mixed"
1025 [(set (reg:CCFPU FLAGS_REG)
1026 (compare:CCFPU (match_operand 0 "register_operand" "f,x")
1027 (match_operand 1 "nonimmediate_operand" "f,xm")))]
1028 "TARGET_MIX_SSE_I387
1029 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
1030 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1031 "* return output_fp_compare (insn, operands, 1, 1);"
1032 [(set_attr "type" "fcmp,ssecomi")
1033 (set (attr "mode")
1034 (if_then_else (match_operand:SF 1 "" "")
1035 (const_string "SF")
1036 (const_string "DF")))
1037 (set_attr "athlon_decode" "vector")])
1038
1039(define_insn "*cmpfp_iu_sse"
1040 [(set (reg:CCFPU FLAGS_REG)
1041 (compare:CCFPU (match_operand 0 "register_operand" "x")
1042 (match_operand 1 "nonimmediate_operand" "xm")))]
1043 "TARGET_SSE_MATH
1044 && SSE_FLOAT_MODE_P (GET_MODE (operands[0]))
1045 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1046 "* return output_fp_compare (insn, operands, 1, 1);"
1047 [(set_attr "type" "ssecomi")
1048 (set (attr "mode")
1049 (if_then_else (match_operand:SF 1 "" "")
1050 (const_string "SF")
1051 (const_string "DF")))
1052 (set_attr "athlon_decode" "vector")])
1053
1054(define_insn "*cmpfp_iu_387"
1055 [(set (reg:CCFPU FLAGS_REG)
1056 (compare:CCFPU (match_operand 0 "register_operand" "f")
1057 (match_operand 1 "register_operand" "f")))]
1058 "TARGET_80387 && TARGET_CMOVE
1059 && (!TARGET_SSE_MATH || !SSE_FLOAT_MODE_P (GET_MODE (operands[0])))
1060 && FLOAT_MODE_P (GET_MODE (operands[0]))
1061 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
1062 "* return output_fp_compare (insn, operands, 1, 1);"
1063 [(set_attr "type" "fcmp")
1064 (set (attr "mode")
1065 (cond [(match_operand:SF 1 "" "")
1066 (const_string "SF")
1067 (match_operand:DF 1 "" "")
1068 (const_string "DF")
1069 ]
1070 (const_string "XF")))
1071 (set_attr "athlon_decode" "vector")])
1072
1073;; Move instructions.
1074
1075;; General case of fullword move.
1076
1077(define_expand "movsi"
1078 [(set (match_operand:SI 0 "nonimmediate_operand" "")
1079 (match_operand:SI 1 "general_operand" ""))]
--- 189 unchanged lines hidden (view full) ---
1269 (match_operand:SI 1 "register_operand" "+r"))
1270 (set (match_dup 1)
1271 (match_dup 0))]
1272 ""
1273 "xchg{l}\t%1, %0"
1274 [(set_attr "type" "imov")
1275 (set_attr "mode" "SI")
1276 (set_attr "pent_pair" "np")
1277 (set_attr "athlon_decode" "vector")])
1278
1279(define_expand "movhi"
1280 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1281 (match_operand:HI 1 "general_operand" ""))]
1282 ""
1283 "ix86_expand_move (HImode, operands); DONE;")
1284
1285(define_insn "*pushhi2"
--- 100 unchanged lines hidden (view full) ---
1386 (match_operand:HI 1 "register_operand" "+r"))
1387 (set (match_dup 1)
1388 (match_dup 0))]
1389 "!TARGET_PARTIAL_REG_STALL || optimize_size"
1390 "xchg{l}\t%k1, %k0"
1391 [(set_attr "type" "imov")
1392 (set_attr "mode" "SI")
1393 (set_attr "pent_pair" "np")
1394 (set_attr "athlon_decode" "vector")])
1395
1396(define_insn "*swaphi_2"
1397 [(set (match_operand:HI 0 "register_operand" "+r")
1398 (match_operand:HI 1 "register_operand" "+r"))
1399 (set (match_dup 1)
1400 (match_dup 0))]
1401 "TARGET_PARTIAL_REG_STALL"
1402 "xchg{w}\t%1, %0"
1403 [(set_attr "type" "imov")
--- 156 unchanged lines hidden (view full) ---
1560 (match_operand:QI 1 "register_operand" "+r"))
1561 (set (match_dup 1)
1562 (match_dup 0))]
1563 "!TARGET_PARTIAL_REG_STALL || optimize_size"
1564 "xchg{l}\t%k1, %k0"
1565 [(set_attr "type" "imov")
1566 (set_attr "mode" "SI")
1567 (set_attr "pent_pair" "np")
1568 (set_attr "athlon_decode" "vector")])
1569
1570(define_insn "*swapqi_2"
1571 [(set (match_operand:QI 0 "register_operand" "+q")
1572 (match_operand:QI 1 "register_operand" "+q"))
1573 (set (match_dup 1)
1574 (match_dup 0))]
1575 "TARGET_PARTIAL_REG_STALL"
1576 "xchg{b}\t%1, %0"
1577 [(set_attr "type" "imov")
--- 537 unchanged lines hidden (view full) ---
2115 (match_operand:DI 1 "register_operand" "+r"))
2116 (set (match_dup 1)
2117 (match_dup 0))]
2118 "TARGET_64BIT"
2119 "xchg{q}\t%1, %0"
2120 [(set_attr "type" "imov")
2121 (set_attr "mode" "DI")
2122 (set_attr "pent_pair" "np")
2123 (set_attr "athlon_decode" "vector")])
2124
2125(define_expand "movti"
2126 [(set (match_operand:TI 0 "nonimmediate_operand" "")
2127 (match_operand:TI 1 "nonimmediate_operand" ""))]
2128 "TARGET_SSE || TARGET_64BIT"
2129{
2130 if (TARGET_64BIT)
2131 ix86_expand_move (TImode, operands);
--- 2013 unchanged lines hidden (view full) ---
4145;; When SSE is available, it is always faster to use it!
4146(define_insn "fix_truncsfdi_sse"
4147 [(set (match_operand:DI 0 "register_operand" "=r,r")
4148 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))]
4149 "TARGET_64BIT && TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4150 "cvttss2si{q}\t{%1, %0|%0, %1}"
4151 [(set_attr "type" "sseicvt")
4152 (set_attr "mode" "SF")
4153 (set_attr "athlon_decode" "double,vector")])
4154
4155(define_insn "fix_truncdfdi_sse"
4156 [(set (match_operand:DI 0 "register_operand" "=r,r")
4157 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))]
4158 "TARGET_64BIT && TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4159 "cvttsd2si{q}\t{%1, %0|%0, %1}"
4160 [(set_attr "type" "sseicvt")
4161 (set_attr "mode" "DF")
4162 (set_attr "athlon_decode" "double,vector")])
4163
4164(define_insn "fix_truncsfsi_sse"
4165 [(set (match_operand:SI 0 "register_operand" "=r,r")
4166 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "x,xm")))]
4167 "TARGET_SSE && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4168 "cvttss2si\t{%1, %0|%0, %1}"
4169 [(set_attr "type" "sseicvt")
4170 (set_attr "mode" "DF")
4171 (set_attr "athlon_decode" "double,vector")])
4172
4173(define_insn "fix_truncdfsi_sse"
4174 [(set (match_operand:SI 0 "register_operand" "=r,r")
4175 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "Y,Ym")))]
4176 "TARGET_SSE2 && (!TARGET_FISTTP || TARGET_SSE_MATH)"
4177 "cvttsd2si\t{%1, %0|%0, %1}"
4178 [(set_attr "type" "sseicvt")
4179 (set_attr "mode" "DF")
4180 (set_attr "athlon_decode" "double,vector")])
4181
4182;; Avoid vector decoded forms of the instruction.
4183(define_peephole2
4184 [(match_scratch:DF 2 "Y")
4185 (set (match_operand:SSEMODEI24 0 "register_operand" "")
4186 (fix:SSEMODEI24 (match_operand:DF 1 "memory_operand" "")))]
4187 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size"
4188 [(set (match_dup 2) (match_dup 1))
--- 244 unchanged lines hidden (view full) ---
4433(define_insn "x86_fldcw_1"
4434 [(set (reg:HI FPSR_REG)
4435 (unspec:HI [(match_operand:HI 0 "memory_operand" "m")] UNSPEC_FLDCW))]
4436 "TARGET_80387"
4437 "fldcw\t%0"
4438 [(set_attr "length" "2")
4439 (set_attr "mode" "HI")
4440 (set_attr "unit" "i387")
4441 (set_attr "athlon_decode" "vector")])
4442
4443;; Conversion between fixed point and floating point.
4444
4445;; Even though we only accept memory inputs, the backend _really_
4446;; wants to be able to do this between registers.
4447
4448(define_expand "floathisf2"
4449 [(set (match_operand:SF 0 "register_operand" "")
--- 34 unchanged lines hidden (view full) ---
4484 fild%z1\t%1
4485 #
4486 cvtsi2ss\t{%1, %0|%0, %1}
4487 cvtsi2ss\t{%1, %0|%0, %1}"
4488 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4489 (set_attr "mode" "SF")
4490 (set_attr "unit" "*,i387,*,*")
4491 (set_attr "athlon_decode" "*,*,vector,double")
4492 (set_attr "fp_int_src" "true")])
4493
4494(define_insn "*floatsisf2_sse"
4495 [(set (match_operand:SF 0 "register_operand" "=x,x")
4496 (float:SF (match_operand:SI 1 "nonimmediate_operand" "r,mr")))]
4497 "TARGET_SSE_MATH"
4498 "cvtsi2ss\t{%1, %0|%0, %1}"
4499 [(set_attr "type" "sseicvt")
4500 (set_attr "mode" "SF")
4501 (set_attr "athlon_decode" "vector,double")
4502 (set_attr "fp_int_src" "true")])
4503
4504(define_insn "*floatsisf2_i387"
4505 [(set (match_operand:SF 0 "register_operand" "=f,f")
4506 (float:SF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))]
4507 "TARGET_80387"
4508 "@
4509 fild%z1\t%1
--- 17 unchanged lines hidden (view full) ---
4527 fild%z1\t%1
4528 #
4529 cvtsi2ss{q}\t{%1, %0|%0, %1}
4530 cvtsi2ss{q}\t{%1, %0|%0, %1}"
4531 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4532 (set_attr "mode" "SF")
4533 (set_attr "unit" "*,i387,*,*")
4534 (set_attr "athlon_decode" "*,*,vector,double")
4535 (set_attr "fp_int_src" "true")])
4536
4537(define_insn "*floatdisf2_sse"
4538 [(set (match_operand:SF 0 "register_operand" "=x,x")
4539 (float:SF (match_operand:DI 1 "nonimmediate_operand" "r,mr")))]
4540 "TARGET_64BIT && TARGET_SSE_MATH"
4541 "cvtsi2ss{q}\t{%1, %0|%0, %1}"
4542 [(set_attr "type" "sseicvt")
4543 (set_attr "mode" "SF")
4544 (set_attr "athlon_decode" "vector,double")
4545 (set_attr "fp_int_src" "true")])
4546
4547(define_insn "*floatdisf2_i387"
4548 [(set (match_operand:SF 0 "register_operand" "=f,f")
4549 (float:SF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))]
4550 "TARGET_80387"
4551 "@
4552 fild%z1\t%1
--- 42 unchanged lines hidden (view full) ---
4595 fild%z1\t%1
4596 #
4597 cvtsi2sd\t{%1, %0|%0, %1}
4598 cvtsi2sd\t{%1, %0|%0, %1}"
4599 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4600 (set_attr "mode" "DF")
4601 (set_attr "unit" "*,i387,*,*")
4602 (set_attr "athlon_decode" "*,*,double,direct")
4603 (set_attr "fp_int_src" "true")])
4604
4605(define_insn "*floatsidf2_sse"
4606 [(set (match_operand:DF 0 "register_operand" "=Y,Y")
4607 (float:DF (match_operand:SI 1 "nonimmediate_operand" "r,mr")))]
4608 "TARGET_SSE2 && TARGET_SSE_MATH"
4609 "cvtsi2sd\t{%1, %0|%0, %1}"
4610 [(set_attr "type" "sseicvt")
4611 (set_attr "mode" "DF")
4612 (set_attr "athlon_decode" "double,direct")
4613 (set_attr "fp_int_src" "true")])
4614
4615(define_insn "*floatsidf2_i387"
4616 [(set (match_operand:DF 0 "register_operand" "=f,f")
4617 (float:DF (match_operand:SI 1 "nonimmediate_operand" "m,?r")))]
4618 "TARGET_80387"
4619 "@
4620 fild%z1\t%1
--- 17 unchanged lines hidden (view full) ---
4638 fild%z1\t%1
4639 #
4640 cvtsi2sd{q}\t{%1, %0|%0, %1}
4641 cvtsi2sd{q}\t{%1, %0|%0, %1}"
4642 [(set_attr "type" "fmov,multi,sseicvt,sseicvt")
4643 (set_attr "mode" "DF")
4644 (set_attr "unit" "*,i387,*,*")
4645 (set_attr "athlon_decode" "*,*,double,direct")
4646 (set_attr "fp_int_src" "true")])
4647
4648(define_insn "*floatdidf2_sse"
4649 [(set (match_operand:DF 0 "register_operand" "=Y,Y")
4650 (float:DF (match_operand:DI 1 "nonimmediate_operand" "r,mr")))]
4651 "TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH"
4652 "cvtsi2sd{q}\t{%1, %0|%0, %1}"
4653 [(set_attr "type" "sseicvt")
4654 (set_attr "mode" "DF")
4655 (set_attr "athlon_decode" "double,direct")
4656 (set_attr "fp_int_src" "true")])
4657
4658(define_insn "*floatdidf2_i387"
4659 [(set (match_operand:DF 0 "register_operand" "=f,f")
4660 (float:DF (match_operand:DI 1 "nonimmediate_operand" "m,?r")))]
4661 "TARGET_80387"
4662 "@
4663 fild%z1\t%1
--- 2191 unchanged lines hidden (view full) ---
6855(define_expand "muldi3"
6856 [(parallel [(set (match_operand:DI 0 "register_operand" "")
6857 (mult:DI (match_operand:DI 1 "register_operand" "")
6858 (match_operand:DI 2 "x86_64_general_operand" "")))
6859 (clobber (reg:CC FLAGS_REG))])]
6860 "TARGET_64BIT"
6861 "")
6862
6863(define_insn "*muldi3_1_rex64"
6864 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
6865 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%rm,rm,0")
6866 (match_operand:DI 2 "x86_64_general_operand" "K,e,mr")))
6867 (clobber (reg:CC FLAGS_REG))]
6868 "TARGET_64BIT
6869 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
6870 "@
--- 6 unchanged lines hidden (view full) ---
6877 (cond [(eq_attr "cpu" "athlon")
6878 (const_string "vector")
6879 (eq_attr "alternative" "1")
6880 (const_string "vector")
6881 (and (eq_attr "alternative" "2")
6882 (match_operand 1 "memory_operand" ""))
6883 (const_string "vector")]
6884 (const_string "direct")))
6885 (set_attr "mode" "DI")])
6886
6887(define_expand "mulsi3"
6888 [(parallel [(set (match_operand:SI 0 "register_operand" "")
6889 (mult:SI (match_operand:SI 1 "register_operand" "")
6890 (match_operand:SI 2 "general_operand" "")))
6891 (clobber (reg:CC FLAGS_REG))])]
6892 ""
6893 "")
6894
6895(define_insn "*mulsi3_1"
6896 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
6897 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0")
6898 (match_operand:SI 2 "general_operand" "K,i,mr")))
6899 (clobber (reg:CC FLAGS_REG))]
6900 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
6901 "@
6902 imul{l}\t{%2, %1, %0|%0, %1, %2}
--- 5 unchanged lines hidden (view full) ---
6908 (cond [(eq_attr "cpu" "athlon")
6909 (const_string "vector")
6910 (eq_attr "alternative" "1")
6911 (const_string "vector")
6912 (and (eq_attr "alternative" "2")
6913 (match_operand 1 "memory_operand" ""))
6914 (const_string "vector")]
6915 (const_string "direct")))
6916 (set_attr "mode" "SI")])
6917
6918(define_insn "*mulsi3_1_zext"
6919 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
6920 (zero_extend:DI
6921 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0")
6922 (match_operand:SI 2 "general_operand" "K,i,mr"))))
6923 (clobber (reg:CC FLAGS_REG))]
--- 9 unchanged lines hidden (view full) ---
6933 (cond [(eq_attr "cpu" "athlon")
6934 (const_string "vector")
6935 (eq_attr "alternative" "1")
6936 (const_string "vector")
6937 (and (eq_attr "alternative" "2")
6938 (match_operand 1 "memory_operand" ""))
6939 (const_string "vector")]
6940 (const_string "direct")))
6941 (set_attr "mode" "SI")])
6942
6943(define_expand "mulhi3"
6944 [(parallel [(set (match_operand:HI 0 "register_operand" "")
6945 (mult:HI (match_operand:HI 1 "register_operand" "")
6946 (match_operand:HI 2 "general_operand" "")))
6947 (clobber (reg:CC FLAGS_REG))])]
6948 "TARGET_HIMODE_MATH"
6949 "")
6950
6951(define_insn "*mulhi3_1"
6952 [(set (match_operand:HI 0 "register_operand" "=r,r,r")
6953 (mult:HI (match_operand:HI 1 "nonimmediate_operand" "%rm,rm,0")
6954 (match_operand:HI 2 "general_operand" "K,i,mr")))
6955 (clobber (reg:CC FLAGS_REG))]
6956 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
6957 "@
6958 imul{w}\t{%2, %1, %0|%0, %1, %2}
6959 imul{w}\t{%2, %1, %0|%0, %1, %2}
6960 imul{w}\t{%2, %0|%0, %2}"
6961 [(set_attr "type" "imul")
6962 (set_attr "prefix_0f" "0,0,1")
6963 (set (attr "athlon_decode")
6964 (cond [(eq_attr "cpu" "athlon")
6965 (const_string "vector")
6966 (eq_attr "alternative" "1,2")
6967 (const_string "vector")]
6968 (const_string "direct")))
6969 (set_attr "mode" "HI")])
6970
6971(define_expand "mulqi3"
6972 [(parallel [(set (match_operand:QI 0 "register_operand" "")
6973 (mult:QI (match_operand:QI 1 "nonimmediate_operand" "")
6974 (match_operand:QI 2 "register_operand" "")))
6975 (clobber (reg:CC FLAGS_REG))])]
6976 "TARGET_QIMODE_MATH"
6977 "")
6978
6979(define_insn "*mulqi3_1"
6980 [(set (match_operand:QI 0 "register_operand" "=a")
6981 (mult:QI (match_operand:QI 1 "nonimmediate_operand" "%0")
6982 (match_operand:QI 2 "nonimmediate_operand" "qm")))
6983 (clobber (reg:CC FLAGS_REG))]
6984 "TARGET_QIMODE_MATH
6985 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
6986 "mul{b}\t%2"
6987 [(set_attr "type" "imul")
6988 (set_attr "length_immediate" "0")
6989 (set (attr "athlon_decode")
6990 (if_then_else (eq_attr "cpu" "athlon")
6991 (const_string "vector")
6992 (const_string "direct")))
6993 (set_attr "mode" "QI")])
6994
6995(define_expand "umulqihi3"
6996 [(parallel [(set (match_operand:HI 0 "register_operand" "")
6997 (mult:HI (zero_extend:HI
6998 (match_operand:QI 1 "nonimmediate_operand" ""))
6999 (zero_extend:HI
7000 (match_operand:QI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7011 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7012 "mul{b}\t%2"
7013 [(set_attr "type" "imul")
7014 (set_attr "length_immediate" "0")
7015 (set (attr "athlon_decode")
7016 (if_then_else (eq_attr "cpu" "athlon")
7017 (const_string "vector")
7018 (const_string "direct")))
7019 (set_attr "mode" "QI")])
7020
7021(define_expand "mulqihi3"
7022 [(parallel [(set (match_operand:HI 0 "register_operand" "")
7023 (mult:HI (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))
7024 (sign_extend:HI (match_operand:QI 2 "register_operand" ""))))
7025 (clobber (reg:CC FLAGS_REG))])]
7026 "TARGET_QIMODE_MATH"
--- 8 unchanged lines hidden (view full) ---
7035 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7036 "imul{b}\t%2"
7037 [(set_attr "type" "imul")
7038 (set_attr "length_immediate" "0")
7039 (set (attr "athlon_decode")
7040 (if_then_else (eq_attr "cpu" "athlon")
7041 (const_string "vector")
7042 (const_string "direct")))
7043 (set_attr "mode" "QI")])
7044
7045(define_expand "umulditi3"
7046 [(parallel [(set (match_operand:TI 0 "register_operand" "")
7047 (mult:TI (zero_extend:TI
7048 (match_operand:DI 1 "nonimmediate_operand" ""))
7049 (zero_extend:TI
7050 (match_operand:DI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7061 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7062 "mul{q}\t%2"
7063 [(set_attr "type" "imul")
7064 (set_attr "length_immediate" "0")
7065 (set (attr "athlon_decode")
7066 (if_then_else (eq_attr "cpu" "athlon")
7067 (const_string "vector")
7068 (const_string "double")))
7069 (set_attr "mode" "DI")])
7070
7071;; We can't use this pattern in 64bit mode, since it results in two separate 32bit registers
7072(define_expand "umulsidi3"
7073 [(parallel [(set (match_operand:DI 0 "register_operand" "")
7074 (mult:DI (zero_extend:DI
7075 (match_operand:SI 1 "nonimmediate_operand" ""))
7076 (zero_extend:DI
--- 11 unchanged lines hidden (view full) ---
7088 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7089 "mul{l}\t%2"
7090 [(set_attr "type" "imul")
7091 (set_attr "length_immediate" "0")
7092 (set (attr "athlon_decode")
7093 (if_then_else (eq_attr "cpu" "athlon")
7094 (const_string "vector")
7095 (const_string "double")))
7096 (set_attr "mode" "SI")])
7097
7098(define_expand "mulditi3"
7099 [(parallel [(set (match_operand:TI 0 "register_operand" "")
7100 (mult:TI (sign_extend:TI
7101 (match_operand:DI 1 "nonimmediate_operand" ""))
7102 (sign_extend:TI
7103 (match_operand:DI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7114 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7115 "imul{q}\t%2"
7116 [(set_attr "type" "imul")
7117 (set_attr "length_immediate" "0")
7118 (set (attr "athlon_decode")
7119 (if_then_else (eq_attr "cpu" "athlon")
7120 (const_string "vector")
7121 (const_string "double")))
7122 (set_attr "mode" "DI")])
7123
7124(define_expand "mulsidi3"
7125 [(parallel [(set (match_operand:DI 0 "register_operand" "")
7126 (mult:DI (sign_extend:DI
7127 (match_operand:SI 1 "nonimmediate_operand" ""))
7128 (sign_extend:DI
7129 (match_operand:SI 2 "register_operand" ""))))
--- 10 unchanged lines hidden (view full) ---
7140 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7141 "imul{l}\t%2"
7142 [(set_attr "type" "imul")
7143 (set_attr "length_immediate" "0")
7144 (set (attr "athlon_decode")
7145 (if_then_else (eq_attr "cpu" "athlon")
7146 (const_string "vector")
7147 (const_string "double")))
7148 (set_attr "mode" "SI")])
7149
7150(define_expand "umuldi3_highpart"
7151 [(parallel [(set (match_operand:DI 0 "register_operand" "")
7152 (truncate:DI
7153 (lshiftrt:TI
7154 (mult:TI (zero_extend:TI
7155 (match_operand:DI 1 "nonimmediate_operand" ""))
--- 20 unchanged lines hidden (view full) ---
7176 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7177 "mul{q}\t%2"
7178 [(set_attr "type" "imul")
7179 (set_attr "length_immediate" "0")
7180 (set (attr "athlon_decode")
7181 (if_then_else (eq_attr "cpu" "athlon")
7182 (const_string "vector")
7183 (const_string "double")))
7184 (set_attr "mode" "DI")])
7185
7186(define_expand "umulsi3_highpart"
7187 [(parallel [(set (match_operand:SI 0 "register_operand" "")
7188 (truncate:SI
7189 (lshiftrt:DI
7190 (mult:DI (zero_extend:DI
7191 (match_operand:SI 1 "nonimmediate_operand" ""))
--- 19 unchanged lines hidden (view full) ---
7211 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
7212 "mul{l}\t%2"
7213 [(set_attr "type" "imul")
7214 (set_attr "length_immediate" "0")
7215 (set (attr "athlon_decode")
7216 (if_then_else (eq_attr "cpu" "athlon")
7217 (const_string "vector")
7218 (const_string "double")))
7219 (set_attr "mode" "SI")])
7220
7221(define_insn "*umulsi3_highpart_zext"
7222 [(set (match_operand:DI 0 "register_operand" "=d")
7223 (zero_extend:DI (truncate:SI
7224 (lshiftrt:DI
7225 (mult:DI (zero_extend:DI
7226 (match_operand:SI 1 "nonimmediate_operand" "%a"))
--- 6 unchanged lines hidden (view full) ---
7233 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7234 "mul{l}\t%2"
7235 [(set_attr "type" "imul")
7236 (set_attr "length_immediate" "0")
7237 (set (attr "athlon_decode")
7238 (if_then_else (eq_attr "cpu" "athlon")
7239 (const_string "vector")
7240 (const_string "double")))
7241 (set_attr "mode" "SI")])
7242
7243(define_expand "smuldi3_highpart"
7244 [(parallel [(set (match_operand:DI 0 "register_operand" "=d")
7245 (truncate:DI
7246 (lshiftrt:TI
7247 (mult:TI (sign_extend:TI
7248 (match_operand:DI 1 "nonimmediate_operand" ""))
--- 19 unchanged lines hidden (view full) ---
7268 "TARGET_64BIT
7269 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7270 "imul{q}\t%2"
7271 [(set_attr "type" "imul")
7272 (set (attr "athlon_decode")
7273 (if_then_else (eq_attr "cpu" "athlon")
7274 (const_string "vector")
7275 (const_string "double")))
7276 (set_attr "mode" "DI")])
7277
7278(define_expand "smulsi3_highpart"
7279 [(parallel [(set (match_operand:SI 0 "register_operand" "")
7280 (truncate:SI
7281 (lshiftrt:DI
7282 (mult:DI (sign_extend:DI
7283 (match_operand:SI 1 "nonimmediate_operand" ""))
--- 18 unchanged lines hidden (view full) ---
7302 (clobber (reg:CC FLAGS_REG))]
7303 "GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM"
7304 "imul{l}\t%2"
7305 [(set_attr "type" "imul")
7306 (set (attr "athlon_decode")
7307 (if_then_else (eq_attr "cpu" "athlon")
7308 (const_string "vector")
7309 (const_string "double")))
7310 (set_attr "mode" "SI")])
7311
7312(define_insn "*smulsi3_highpart_zext"
7313 [(set (match_operand:DI 0 "register_operand" "=d")
7314 (zero_extend:DI (truncate:SI
7315 (lshiftrt:DI
7316 (mult:DI (sign_extend:DI
7317 (match_operand:SI 1 "nonimmediate_operand" "%a"))
--- 5 unchanged lines hidden (view full) ---
7323 "TARGET_64BIT
7324 && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)"
7325 "imul{l}\t%2"
7326 [(set_attr "type" "imul")
7327 (set (attr "athlon_decode")
7328 (if_then_else (eq_attr "cpu" "athlon")
7329 (const_string "vector")
7330 (const_string "double")))
7331 (set_attr "mode" "SI")])
7332
7333;; The patterns that match these are at the end of this file.
7334
7335(define_expand "mulxf3"
7336 [(set (match_operand:XF 0 "register_operand" "")
7337 (mult:XF (match_operand:XF 1 "register_operand" "")
7338 (match_operand:XF 2 "register_operand" "")))]
--- 2965 unchanged lines hidden (view full) ---
10304 (clobber (reg:CC FLAGS_REG))]
10305 "TARGET_64BIT"
10306 "@
10307 shld{q}\t{%2, %1, %0|%0, %1, %2}
10308 shld{q}\t{%s2%1, %0|%0, %1, %2}"
10309 [(set_attr "type" "ishift")
10310 (set_attr "prefix_0f" "1")
10311 (set_attr "mode" "DI")
10312 (set_attr "athlon_decode" "vector")])
10313
10314(define_expand "x86_64_shift_adj"
10315 [(set (reg:CCZ FLAGS_REG)
10316 (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "")
10317 (const_int 64))
10318 (const_int 0)))
10319 (set (match_operand:DI 0 "register_operand" "")
10320 (if_then_else:DI (ne (reg:CCZ FLAGS_REG) (const_int 0))
--- 198 unchanged lines hidden (view full) ---
10519 ""
10520 "@
10521 shld{l}\t{%2, %1, %0|%0, %1, %2}
10522 shld{l}\t{%s2%1, %0|%0, %1, %2}"
10523 [(set_attr "type" "ishift")
10524 (set_attr "prefix_0f" "1")
10525 (set_attr "mode" "SI")
10526 (set_attr "pent_pair" "np")
10527 (set_attr "athlon_decode" "vector")])
10528
10529(define_expand "x86_shift_adj_1"
10530 [(set (reg:CCZ FLAGS_REG)
10531 (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "")
10532 (const_int 32))
10533 (const_int 0)))
10534 (set (match_operand:SI 0 "register_operand" "")
10535 (if_then_else:SI (ne (reg:CCZ FLAGS_REG) (const_int 0))
--- 743 unchanged lines hidden (view full) ---
11279 (clobber (reg:CC FLAGS_REG))]
11280 "TARGET_64BIT"
11281 "@
11282 shrd{q}\t{%2, %1, %0|%0, %1, %2}
11283 shrd{q}\t{%s2%1, %0|%0, %1, %2}"
11284 [(set_attr "type" "ishift")
11285 (set_attr "prefix_0f" "1")
11286 (set_attr "mode" "DI")
11287 (set_attr "athlon_decode" "vector")])
11288
11289(define_expand "ashrdi3"
11290 [(set (match_operand:DI 0 "shiftdi_operand" "")
11291 (ashiftrt:DI (match_operand:DI 1 "shiftdi_operand" "")
11292 (match_operand:QI 2 "nonmemory_operand" "")))]
11293 ""
11294 "ix86_expand_binary_operator (ASHIFTRT, DImode, operands); DONE;")
11295
--- 3257 unchanged lines hidden (view full) ---
14553 [(set (match_operand:SI 0 "register_operand" "")
14554 (minus:SI (const_int 31)
14555 (clz:SI (match_operand:SI 1 "nonimmediate_operand" ""))))
14556 (clobber (reg:CC FLAGS_REG))])
14557 (parallel
14558 [(set (match_dup 0) (xor:SI (match_dup 0) (const_int 31)))
14559 (clobber (reg:CC FLAGS_REG))])]
14560 ""
14561 "")
14562
14563(define_insn "*bsr"
14564 [(set (match_operand:SI 0 "register_operand" "=r")
14565 (minus:SI (const_int 31)
14566 (clz:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))))
14567 (clobber (reg:CC FLAGS_REG))]
14568 ""
14569 "bsr{l}\t{%1, %0|%0, %1}"
14570 [(set_attr "prefix_0f" "1")])
14571
14572(define_expand "clzdi2"
14573 [(parallel
14574 [(set (match_operand:DI 0 "register_operand" "")
14575 (minus:DI (const_int 63)
14576 (clz:DI (match_operand:DI 1 "nonimmediate_operand" ""))))
14577 (clobber (reg:CC FLAGS_REG))])
14578 (parallel
14579 [(set (match_dup 0) (xor:DI (match_dup 0) (const_int 63)))
14580 (clobber (reg:CC FLAGS_REG))])]
14581 "TARGET_64BIT"
14582 "")
14583
14584(define_insn "*bsr_rex64"
14585 [(set (match_operand:DI 0 "register_operand" "=r")
14586 (minus:DI (const_int 63)
14587 (clz:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))))
14588 (clobber (reg:CC FLAGS_REG))]
14589 "TARGET_64BIT"
14590 "bsr{q}\t{%1, %0|%0, %1}"
14591 [(set_attr "prefix_0f" "1")])
14592
14593;; Thread-local storage patterns for ELF.
14594;;
14595;; Note that these code sequences must appear exactly as shown
14596;; in order to allow linker relaxation.
14597
14598(define_insn "*tls_global_dynamic_32_gnu"
14599 [(set (match_operand:SI 0 "register_operand" "=a")
--- 889 unchanged lines hidden (view full) ---
15489 [(set (match_operand:SF 0 "register_operand" "=f,x")
15490 (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "0,xm")))]
15491 "TARGET_USE_FANCY_MATH_387 && TARGET_MIX_SSE_I387"
15492 "@
15493 fsqrt
15494 sqrtss\t{%1, %0|%0, %1}"
15495 [(set_attr "type" "fpspc,sse")
15496 (set_attr "mode" "SF,SF")
15497 (set_attr "athlon_decode" "direct,*")])
15498
15499(define_insn "*sqrtsf2_sse"
15500 [(set (match_operand:SF 0 "register_operand" "=x")
15501 (sqrt:SF (match_operand:SF 1 "nonimmediate_operand" "xm")))]
15502 "TARGET_SSE_MATH"
15503 "sqrtss\t{%1, %0|%0, %1}"
15504 [(set_attr "type" "sse")
15505 (set_attr "mode" "SF")
15506 (set_attr "athlon_decode" "*")])
15507
15508(define_insn "*sqrtsf2_i387"
15509 [(set (match_operand:SF 0 "register_operand" "=f")
15510 (sqrt:SF (match_operand:SF 1 "register_operand" "0")))]
15511 "TARGET_USE_FANCY_MATH_387"
15512 "fsqrt"
15513 [(set_attr "type" "fpspc")
15514 (set_attr "mode" "SF")
15515 (set_attr "athlon_decode" "direct")])
15516
15517(define_expand "sqrtdf2"
15518 [(set (match_operand:DF 0 "register_operand" "")
15519 (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "")))]
15520 "TARGET_USE_FANCY_MATH_387 || (TARGET_SSE2 && TARGET_SSE_MATH)"
15521{
15522 if (!(TARGET_SSE2 && TARGET_SSE_MATH))
15523 operands[1] = force_reg (DFmode, operands[1]);
15524})
15525
15526(define_insn "*sqrtdf2_mixed"
15527 [(set (match_operand:DF 0 "register_operand" "=f,Y")
15528 (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "0,Ym")))]
15529 "TARGET_USE_FANCY_MATH_387 && TARGET_SSE2 && TARGET_MIX_SSE_I387"
15530 "@
15531 fsqrt
15532 sqrtsd\t{%1, %0|%0, %1}"
15533 [(set_attr "type" "fpspc,sse")
15534 (set_attr "mode" "DF,DF")
15535 (set_attr "athlon_decode" "direct,*")])
15536
15537(define_insn "*sqrtdf2_sse"
15538 [(set (match_operand:DF 0 "register_operand" "=Y")
15539 (sqrt:DF (match_operand:DF 1 "nonimmediate_operand" "Ym")))]
15540 "TARGET_SSE2 && TARGET_SSE_MATH"
15541 "sqrtsd\t{%1, %0|%0, %1}"
15542 [(set_attr "type" "sse")
15543 (set_attr "mode" "DF")
15544 (set_attr "athlon_decode" "*")])
15545
15546(define_insn "*sqrtdf2_i387"
15547 [(set (match_operand:DF 0 "register_operand" "=f")
15548 (sqrt:DF (match_operand:DF 1 "register_operand" "0")))]
15549 "TARGET_USE_FANCY_MATH_387"
15550 "fsqrt"
15551 [(set_attr "type" "fpspc")
15552 (set_attr "mode" "DF")
15553 (set_attr "athlon_decode" "direct")])
15554
15555(define_insn "*sqrtextendsfdf2_i387"
15556 [(set (match_operand:DF 0 "register_operand" "=f")
15557 (sqrt:DF (float_extend:DF
15558 (match_operand:SF 1 "register_operand" "0"))))]
15559 "TARGET_USE_FANCY_MATH_387
15560 && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387)"
15561 "fsqrt"
15562 [(set_attr "type" "fpspc")
15563 (set_attr "mode" "DF")
15564 (set_attr "athlon_decode" "direct")])
15565
15566(define_insn "sqrtxf2"
15567 [(set (match_operand:XF 0 "register_operand" "=f")
15568 (sqrt:XF (match_operand:XF 1 "register_operand" "0")))]
15569 "TARGET_USE_FANCY_MATH_387"
15570 "fsqrt"
15571 [(set_attr "type" "fpspc")
15572 (set_attr "mode" "XF")
15573 (set_attr "athlon_decode" "direct")])
15574
15575(define_insn "*sqrtextendsfxf2_i387"
15576 [(set (match_operand:XF 0 "register_operand" "=f")
15577 (sqrt:XF (float_extend:XF
15578 (match_operand:SF 1 "register_operand" "0"))))]
15579 "TARGET_USE_FANCY_MATH_387"
15580 "fsqrt"
15581 [(set_attr "type" "fpspc")
15582 (set_attr "mode" "XF")
15583 (set_attr "athlon_decode" "direct")])
15584
15585(define_insn "*sqrtextenddfxf2_i387"
15586 [(set (match_operand:XF 0 "register_operand" "=f")
15587 (sqrt:XF (float_extend:XF
15588 (match_operand:DF 1 "register_operand" "0"))))]
15589 "TARGET_USE_FANCY_MATH_387"
15590 "fsqrt"
15591 [(set_attr "type" "fpspc")
15592 (set_attr "mode" "XF")
15593 (set_attr "athlon_decode" "direct")])
15594
15595(define_insn "fpremxf4"
15596 [(set (match_operand:XF 0 "register_operand" "=f")
15597 (unspec:XF [(match_operand:XF 2 "register_operand" "0")
15598 (match_operand:XF 3 "register_operand" "1")]
15599 UNSPEC_FPREM_F))
15600 (set (match_operand:XF 1 "register_operand" "=u")
15601 (unspec:XF [(match_dup 2) (match_dup 3)]
--- 4784 unchanged lines hidden (view full) ---
20386;; Imul $32bit_imm, mem, reg is vector decoded, while
20387;; imul $32bit_imm, reg, reg is direct decoded.
20388(define_peephole2
20389 [(match_scratch:DI 3 "r")
20390 (parallel [(set (match_operand:DI 0 "register_operand" "")
20391 (mult:DI (match_operand:DI 1 "memory_operand" "")
20392 (match_operand:DI 2 "immediate_operand" "")))
20393 (clobber (reg:CC FLAGS_REG))])]
20394 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20395 && !satisfies_constraint_K (operands[2])"
20396 [(set (match_dup 3) (match_dup 1))
20397 (parallel [(set (match_dup 0) (mult:DI (match_dup 3) (match_dup 2)))
20398 (clobber (reg:CC FLAGS_REG))])]
20399"")
20400
20401(define_peephole2
20402 [(match_scratch:SI 3 "r")
20403 (parallel [(set (match_operand:SI 0 "register_operand" "")
20404 (mult:SI (match_operand:SI 1 "memory_operand" "")
20405 (match_operand:SI 2 "immediate_operand" "")))
20406 (clobber (reg:CC FLAGS_REG))])]
20407 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20408 && !satisfies_constraint_K (operands[2])"
20409 [(set (match_dup 3) (match_dup 1))
20410 (parallel [(set (match_dup 0) (mult:SI (match_dup 3) (match_dup 2)))
20411 (clobber (reg:CC FLAGS_REG))])]
20412"")
20413
20414(define_peephole2
20415 [(match_scratch:SI 3 "r")
20416 (parallel [(set (match_operand:DI 0 "register_operand" "")
20417 (zero_extend:DI
20418 (mult:SI (match_operand:SI 1 "memory_operand" "")
20419 (match_operand:SI 2 "immediate_operand" ""))))
20420 (clobber (reg:CC FLAGS_REG))])]
20421 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20422 && !satisfies_constraint_K (operands[2])"
20423 [(set (match_dup 3) (match_dup 1))
20424 (parallel [(set (match_dup 0) (zero_extend:DI (mult:SI (match_dup 3) (match_dup 2))))
20425 (clobber (reg:CC FLAGS_REG))])]
20426"")
20427
20428;; imul $8/16bit_imm, regmem, reg is vector decoded.
20429;; Convert it into imul reg, reg
20430;; It would be better to force assembler to encode instruction using long
20431;; immediate, but there is apparently no way to do so.
20432(define_peephole2
20433 [(parallel [(set (match_operand:DI 0 "register_operand" "")
20434 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "")
20435 (match_operand:DI 2 "const_int_operand" "")))
20436 (clobber (reg:CC FLAGS_REG))])
20437 (match_scratch:DI 3 "r")]
20438 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20439 && satisfies_constraint_K (operands[2])"
20440 [(set (match_dup 3) (match_dup 2))
20441 (parallel [(set (match_dup 0) (mult:DI (match_dup 0) (match_dup 3)))
20442 (clobber (reg:CC FLAGS_REG))])]
20443{
20444 if (!rtx_equal_p (operands[0], operands[1]))
20445 emit_move_insn (operands[0], operands[1]);
20446})
20447
20448(define_peephole2
20449 [(parallel [(set (match_operand:SI 0 "register_operand" "")
20450 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "")
20451 (match_operand:SI 2 "const_int_operand" "")))
20452 (clobber (reg:CC FLAGS_REG))])
20453 (match_scratch:SI 3 "r")]
20454 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size
20455 && satisfies_constraint_K (operands[2])"
20456 [(set (match_dup 3) (match_dup 2))
20457 (parallel [(set (match_dup 0) (mult:SI (match_dup 0) (match_dup 3)))
20458 (clobber (reg:CC FLAGS_REG))])]
20459{
20460 if (!rtx_equal_p (operands[0], operands[1]))
20461 emit_move_insn (operands[0], operands[1]);
20462})
20463
20464(define_peephole2
20465 [(parallel [(set (match_operand:HI 0 "register_operand" "")
20466 (mult:HI (match_operand:HI 1 "nonimmediate_operand" "")
20467 (match_operand:HI 2 "immediate_operand" "")))
20468 (clobber (reg:CC FLAGS_REG))])
20469 (match_scratch:HI 3 "r")]
20470 "(TARGET_K8 || TARGET_GENERIC64) && !optimize_size"
20471 [(set (match_dup 3) (match_dup 2))
20472 (parallel [(set (match_dup 0) (mult:HI (match_dup 0) (match_dup 3)))
20473 (clobber (reg:CC FLAGS_REG))])]
20474{
20475 if (!rtx_equal_p (operands[0], operands[1]))
20476 emit_move_insn (operands[0], operands[1]);
20477})
20478
--- 480 unchanged lines hidden ---