Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
36cf4bcf
Commit
36cf4bcf
authored
Jan 31, 1997
by
Stan Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(idiv,imul,fpmul): Added new functional units for pentiumpro.
From-SVN: r13570
parent
b454fefe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
31 deletions
+74
-31
gcc/config/i386/i386.md
+74
-31
No files found.
gcc/config/i386/i386.md
View file @
36cf4bcf
...
@@ -64,22 +64,51 @@
...
@@ -64,22 +64,51 @@
;; This shadows the processor_type enumeration, so changes must be made
;; This shadows the processor_type enumeration, so changes must be made
;; to i386.h at the same time.
;; to i386.h at the same time.
(define_attr "type" "integer,
fld,fpop,fpdiv
"
(define_attr "type" "integer,
idiv,imul,fld,fpop,fpdiv,fpmul
"
(const_string "integer"))
(const_string "integer"))
;; Functional units
;; Functional units
; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
; TEST READY-DELAY ISSUE-DELAY
[
CONFLICT-LIST
]
)
; pentiumpro has a reservation station with 5 ports
; port 0 has integer, float add, integer divide, float divide, float
; multiply, and shifter units.
; port 1 has integer, and jump units.
; port 2 has the load address generation unit
; ports 3 and 4 have the store address generation units
; pentium has two integer pipelines, the main u pipe and the secondary v pipe.
; and a float pipeline
;; Floating point
;; Floating point
(define_function_unit "fp" 1 0
(define_function_unit "fp" 1 0
(and (eq_attr "type" "fpop") (eq_attr "cpu" "
!pentium
"))
(and (eq_attr "type" "fpop") (eq_attr "cpu" "
i386,i486
"))
5 5)
5 5)
(define_function_unit "fp" 1 0
(define_function_unit "fp" 1 0
(and (eq_attr "type" "fpop") (eq_attr "cpu" "pentium"))
(and (eq_attr "type" "fpop") (eq_attr "cpu" "pentium
,pentiumpro
"))
3 0)
3 0)
(define_function_unit "fp" 1 0
(define_function_unit "fp" 1 0
(and (eq_attr "type" "fpmul") (eq_attr "cpu" "pentium"))
7 0)
(define_function_unit "fp" 1 0
(and (eq_attr "type" "fpmul") (eq_attr "cpu" "pentiumpro"))
5 0)
(define_function_unit "fp" 1 0
(and (eq_attr "type" "idiv") (eq_attr "cpu" "pentiumpro"))
10 10)
(define_function_unit "fp" 1 0
(and (eq_attr "type" "imul") (eq_attr "cpu" "pentiumpro"))
6 0)
(define_function_unit "fp" 1 0
(eq_attr "type" "fpdiv")
(eq_attr "type" "fpdiv")
10 10)
10 10)
...
@@ -1499,7 +1528,7 @@
...
@@ -1499,7 +1528,7 @@
return output_move_double (operands);
return output_move_double (operands);
}"
}"
[(set_attr "type" "fld")])
[(set_attr "type" "fld")])
...
@@ -3374,7 +3403,8 @@
...
@@ -3374,7 +3403,8 @@
/* Assembler has weird restrictions. */
/* Assembler has weird restrictions. */
return AS2 (imul%W0,%2,%0);
return AS2 (imul%W0,%2,%0);
return AS3 (imul%W0,%2,%1,%0);
return AS3 (imul%W0,%2,%1,%0);
}")
}"
[(set_attr "type" "imul")])
(define_insn "mulsi3"
(define_insn "mulsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r")
[(set (match_operand:SI 0 "register_operand" "=r,r")
...
@@ -3389,35 +3419,40 @@
...
@@ -3389,35 +3419,40 @@
/* Assembler has weird restrictions. */
/* Assembler has weird restrictions. */
return AS2 (imul%L0,%2,%0);
return AS2 (imul%L0,%2,%0);
return AS3 (imul%L0,%2,%1,%0);
return AS3 (imul%L0,%2,%1,%0);
}")
}"
[(set_attr "type" "imul")])
(define_insn "umulqihi3"
(define_insn "umulqihi3"
[(set (match_operand:HI 0 "register_operand" "=a")
[(set (match_operand:HI 0 "register_operand" "=a")
(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "%0"))
(mult:HI (zero_extend:HI (match_operand:QI 1 "register_operand" "%0"))
(zero_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm"))))]
(zero_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm"))))]
""
""
"mul%B0 %2")
"mul%B0 %2"
[(set_attr "type" "imul")])
(define_insn "mulqihi3"
(define_insn "mulqihi3"
[(set (match_operand:HI 0 "register_operand" "=a")
[(set (match_operand:HI 0 "register_operand" "=a")
(mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "%0"))
(mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "%0"))
(sign_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm"))))]
(sign_extend:HI (match_operand:QI 2 "nonimmediate_operand" "qm"))))]
""
""
"imul%B0 %2")
"imul%B0 %2"
[(set_attr "type" "imul")])
(define_insn "umulsidi3"
(define_insn "umulsidi3"
[(set (match_operand:DI 0 "register_operand" "=A")
[(set (match_operand:DI 0 "register_operand" "=A")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm"))))]
(zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm"))))]
"TARGET_WIDE_MULTIPLY"
"TARGET_WIDE_MULTIPLY"
"mul%L0 %2")
"mul%L0 %2"
[(set_attr "type" "imul")])
(define_insn "mulsidi3"
(define_insn "mulsidi3"
[(set (match_operand:DI 0 "register_operand" "=A")
[(set (match_operand:DI 0 "register_operand" "=A")
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm"))))]
(sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "rm"))))]
"TARGET_WIDE_MULTIPLY"
"TARGET_WIDE_MULTIPLY"
"imul%L0 %2")
"imul%L0 %2"
[(set_attr "type" "imul")])
(define_insn "umulsi3_highpart"
(define_insn "umulsi3_highpart"
[(set (match_operand:SI 0 "register_operand" "=d")
[(set (match_operand:SI 0 "register_operand" "=d")
...
@@ -3426,7 +3461,8 @@
...
@@ -3426,7 +3461,8 @@
(const_int 32))))
(const_int 32))))
(clobber (match_scratch:SI 3 "=a"))]
(clobber (match_scratch:SI 3 "=a"))]
"TARGET_WIDE_MULTIPLY"
"TARGET_WIDE_MULTIPLY"
"mul%L0 %2")
"mul%L0 %2"
[(set_attr "type" "imul")])
(define_insn "smulsi3_highpart"
(define_insn "smulsi3_highpart"
[(set (match_operand:SI 0 "register_operand" "=d")
[(set (match_operand:SI 0 "register_operand" "=d")
...
@@ -3435,7 +3471,8 @@
...
@@ -3435,7 +3471,8 @@
(const_int 32))))
(const_int 32))))
(clobber (match_scratch:SI 3 "=a"))]
(clobber (match_scratch:SI 3 "=a"))]
"TARGET_WIDE_MULTIPLY"
"TARGET_WIDE_MULTIPLY"
"imul%L0 %2")
"imul%L0 %2"
[(set_attr "type" "imul")])
;; The patterns that match these are at the end of this file.
;; The patterns that match these are at the end of this file.
...
@@ -3474,7 +3511,8 @@
...
@@ -3474,7 +3511,8 @@
(udiv:QI (match_operand:HI 1 "register_operand" "0")
(udiv:QI (match_operand:HI 1 "register_operand" "0")
(match_operand:QI 2 "nonimmediate_operand" "qm")))]
(match_operand:QI 2 "nonimmediate_operand" "qm")))]
""
""
"div%B0 %2")
"div%B0 %2"
[(set_attr "type" "idiv")])
;; The patterns that match these are at the end of this file.
;; The patterns that match these are at the end of this file.
...
@@ -3516,7 +3554,8 @@
...
@@ -3516,7 +3554,8 @@
output_asm_insn (\"cltd\", operands);
output_asm_insn (\"cltd\", operands);
#endif
#endif
return AS1 (idiv%L0,%2);
return AS1 (idiv%L0,%2);
}")
}"
[(set_attr "type" "idiv")])
(define_insn "divmodhi4"
(define_insn "divmodhi4"
[(set (match_operand:HI 0 "register_operand" "=a")
[(set (match_operand:HI 0 "register_operand" "=a")
...
@@ -3525,7 +3564,8 @@
...
@@ -3525,7 +3564,8 @@
(set (match_operand:HI 3 "register_operand" "=&d")
(set (match_operand:HI 3 "register_operand" "=&d")
(mod:HI (match_dup 1) (match_dup 2)))]
(mod:HI (match_dup 1) (match_dup 2)))]
""
""
"cwtd\;idiv%W0 %2")
"cwtd\;idiv%W0 %2"
[(set_attr "type" "idiv")])
;; ??? Can we make gcc zero extend operand[0]?
;; ??? Can we make gcc zero extend operand[0]?
(define_insn "udivmodsi4"
(define_insn "udivmodsi4"
...
@@ -3539,7 +3579,8 @@
...
@@ -3539,7 +3579,8 @@
{
{
output_asm_insn (AS2 (xor%L3,%3,%3), operands);
output_asm_insn (AS2 (xor%L3,%3,%3), operands);
return AS1 (div%L0,%2);
return AS1 (div%L0,%2);
}")
}"
[(set_attr "type" "idiv")])
;; ??? Can we make gcc zero extend operand[0]?
;; ??? Can we make gcc zero extend operand[0]?
(define_insn "udivmodhi4"
(define_insn "udivmodhi4"
...
@@ -3553,7 +3594,8 @@
...
@@ -3553,7 +3594,8 @@
{
{
output_asm_insn (AS2 (xor%W0,%3,%3), operands);
output_asm_insn (AS2 (xor%W0,%3,%3), operands);
return AS1 (div%W0,%2);
return AS1 (div%W0,%2);
}")
}"
[(set_attr "type" "idiv")])
/*
/*
;;this should be a valid double division which we may want to add
;;this should be a valid double division which we may want to add
...
@@ -3565,7 +3607,8 @@
...
@@ -3565,7 +3607,8 @@
(set (match_operand:SI 3 "register_operand" "=d")
(set (match_operand:SI 3 "register_operand" "=d")
(umod:SI (match_dup 1) (match_dup 2)))]
(umod:SI (match_dup 1) (match_dup 2)))]
""
""
"div%L0 %2,%0")
"div%L0 %2,%0"
[(set_attr "type" "idiv")])
*/
*/
;;- and instructions
;;- and instructions
...
@@ -6870,7 +6913,7 @@ byte_xor_operation:
...
@@ -6870,7 +6913,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6887,7 +6930,7 @@ byte_xor_operation:
...
@@ -6887,7 +6930,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6904,7 +6947,7 @@ byte_xor_operation:
...
@@ -6904,7 +6947,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6921,7 +6964,7 @@ byte_xor_operation:
...
@@ -6921,7 +6964,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6938,7 +6981,7 @@ byte_xor_operation:
...
@@ -6938,7 +6981,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6955,7 +6998,7 @@ byte_xor_operation:
...
@@ -6955,7 +6998,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6973,7 +7016,7 @@ byte_xor_operation:
...
@@ -6973,7 +7016,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -6990,7 +7033,7 @@ byte_xor_operation:
...
@@ -6990,7 +7033,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -7007,7 +7050,7 @@ byte_xor_operation:
...
@@ -7007,7 +7050,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -7025,7 +7068,7 @@ byte_xor_operation:
...
@@ -7025,7 +7068,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -7042,7 +7085,7 @@ byte_xor_operation:
...
@@ -7042,7 +7085,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -7059,7 +7102,7 @@ byte_xor_operation:
...
@@ -7059,7 +7102,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
@@ -7076,7 +7119,7 @@ byte_xor_operation:
...
@@ -7076,7 +7119,7 @@ byte_xor_operation:
"
*
return output_387_binary_op (insn, operands);"
"
*
return output_387_binary_op (insn, operands);"
[
(set (attr "type")
[
(set (attr "type")
(cond
[
(match_operand:DF 3 "is_mul" "")
(cond
[
(match_operand:DF 3 "is_mul" "")
(const_string "fp
op
")
(const_string "fp
mul
")
(match_operand:DF 3 "is_div" "")
(match_operand:DF 3 "is_div" "")
(const_string "fpdiv")
(const_string "fpdiv")
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment