Commit c47decad by Jeff Law

pa.h (enum processor_type): New enumeration describing the processor to schedule…

pa.h (enum processor_type): New enumeration describing the processor to schedule for (700, 7100, 7100LC).

	* pa.h (enum processor_type): New enumeration describing the
	processor to schedule for (700, 7100, 7100LC).
	(pa_cpu_attr, TARGET_OPTIONS, OVERRIDE_OPTIONS): Define.
	(pa_cpu_string, pa_cpu): Provide extern decls.
	* pa.c (pa_cpu, pa_cpu_string): Provide definitions.
	(override_options): New function.
	(pa_adjust_cost): Handle PROCESSOR_7100 and PROCESSOR_7100LC
	scheduling.  Handle anti-dependendy cases involving fp division
	and sqrt.  Handle output dependencies correctly.  Break TYPE_FPMUL
	into TYPE_FPMULSGL and TYPE_FPMULDBL.
	* pa.md (cpu attribute): New attribute.
	Clean up comments for PROCESSOR_700 scheduling info.  Slightly
	simplify.  Make conditional on PROCESSOR_700.
	Add comments and scheduling information for PROCESSOR_7100 and
	PROCESSOR_7100LC.  Set types for instructions which use the shifter
	to "shift".  Explicitly set lengths and types for all instructions.
	Break type "fpmul" into "fmulsgl" and "fpmuldbl".

From-SVN: r8723
parent c1fe41cb
...@@ -41,6 +41,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -41,6 +41,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
rtx hppa_compare_op0, hppa_compare_op1; rtx hppa_compare_op0, hppa_compare_op1;
enum cmp_type hppa_branch_type; enum cmp_type hppa_branch_type;
/* Which cpu we are scheduling for. */
enum processor_type pa_cpu;
/* String to hold which cpu we are scheduling for. */
char *pa_cpu_string;
rtx hppa_save_pic_table_rtx; rtx hppa_save_pic_table_rtx;
/* Set by the FUNCTION_PROFILER macro. */ /* Set by the FUNCTION_PROFILER macro. */
...@@ -57,6 +63,34 @@ static rtx find_addr_reg (); ...@@ -57,6 +63,34 @@ static rtx find_addr_reg ();
unsigned int total_code_bytes; unsigned int total_code_bytes;
void
override_options ()
{
/* Default to 700 scheduling which is reasonable for older 800 processors
correct for the 700s, and not too bad for the 7100s and 7100LCs. */
if (pa_cpu_string == NULL
|| ! strcmp (pa_cpu_string, "700"))
{
pa_cpu_string = "700";
pa_cpu = PROCESSOR_700;
}
else if (! strcmp (pa_cpu_string, "7100"))
{
pa_cpu_string = "7100";
pa_cpu = PROCESSOR_7100;
}
else if (! strncmp (pa_cpu_string, "7100LC"))
{
pa_cpu_string = "7100LC";
pa_cpu = PROCESSOR_7100LC;
}
else
{
warning ("Unknown -mschedule= option (%s).\nValid options are 700, 7100 and 7100LC\n", pa_cpu_string);
}
}
/* Return non-zero only if OP is a register of mode MODE, /* Return non-zero only if OP is a register of mode MODE,
or CONST0_RTX. */ or CONST0_RTX. */
int int
...@@ -2498,18 +2532,20 @@ pa_adjust_cost (insn, link, dep_insn, cost) ...@@ -2498,18 +2532,20 @@ pa_adjust_cost (insn, link, dep_insn, cost)
switch (get_attr_type (dep_insn)) switch (get_attr_type (dep_insn))
{ {
case TYPE_FPLOAD: case TYPE_FPLOAD:
/* This cost 3 cycles, not 2 as the md says. */ /* This cost 3 cycles, not 2 as the md says for the
return cost + 1; 700 and 7100. Note scaling of cost for 7100. */
return cost + (pa_cpu_attr == PROCESSOR_700) ? 1 : 2;
case TYPE_FPALU: case TYPE_FPALU:
case TYPE_FPMUL: case TYPE_FPMULSGL:
case TYPE_FPMULDBL:
case TYPE_FPDIVSGL: case TYPE_FPDIVSGL:
case TYPE_FPDIVDBL: case TYPE_FPDIVDBL:
case TYPE_FPSQRTSGL: case TYPE_FPSQRTSGL:
case TYPE_FPSQRTDBL: case TYPE_FPSQRTDBL:
/* In these important cases, we save one cycle compared to /* In these important cases, we save one cycle compared to
when flop instruction feed each other. */ when flop instruction feed each other. */
return cost - 1; return cost - (pa_cpu_attr == PROCESSOR_700) ? 1 : 2;
default: default:
return cost; return cost;
...@@ -2547,16 +2583,52 @@ pa_adjust_cost (insn, link, dep_insn, cost) ...@@ -2547,16 +2583,52 @@ pa_adjust_cost (insn, link, dep_insn, cost)
switch (get_attr_type (dep_insn)) switch (get_attr_type (dep_insn))
{ {
case TYPE_FPALU: case TYPE_FPALU:
case TYPE_FPMUL: case TYPE_FPMULSGL:
case TYPE_FPMULDBL:
case TYPE_FPDIVSGL: case TYPE_FPDIVSGL:
case TYPE_FPDIVDBL: case TYPE_FPDIVDBL:
case TYPE_FPSQRTSGL: case TYPE_FPSQRTSGL:
case TYPE_FPSQRTDBL: case TYPE_FPSQRTDBL:
/* A fpload can't be issued until one cycle before a /* A fpload can't be issued until one cycle before a
preceeding arithmetic operation has finished, if preceeding arithmetic operation has finished if
the target of the fpload is any of the sources the target of the fpload is any of the sources
(or destination) of the arithmetic operation. */ (or destination) of the arithmetic operation. */
return cost - 1; return cost - (pa_cpu_attr == PROCESSOR_700) ? 1 : 2;
default:
return 0;
}
}
}
else if (get_attr_type (insn) == TYPE_FPALU)
{
rtx pat = PATTERN (insn);
rtx dep_pat = PATTERN (dep_insn);
if (GET_CODE (pat) == PARALLEL)
{
/* This happens for the fldXs,mb patterns. */
pat = XVECEXP (pat, 0, 0);
}
if (GET_CODE (pat) != SET || GET_CODE (dep_pat) != SET)
/* If this happens, we have to extend this to schedule
optimally. Return 0 for now. */
return 0;
if (reg_mentioned_p (SET_DEST (pat), SET_SRC (dep_pat)))
{
if (! recog_memoized (dep_insn))
return 0;
switch (get_attr_type (dep_insn))
{
case TYPE_FPDIVSGL:
case TYPE_FPDIVDBL:
case TYPE_FPSQRTSGL:
case TYPE_FPSQRTDBL:
/* An ALU flop can't be issued until two cycles before a
preceeding divide or sqrt operation has finished if
the target of the ALU flop is any of the sources
(or destination) of the divide or sqrt operation. */
return cost - (pa_cpu_attr == PROCESSOR_700) ? 2 : 4;
default: default:
return 0; return 0;
...@@ -2567,9 +2639,89 @@ pa_adjust_cost (insn, link, dep_insn, cost) ...@@ -2567,9 +2639,89 @@ pa_adjust_cost (insn, link, dep_insn, cost)
/* For other anti dependencies, the cost is 0. */ /* For other anti dependencies, the cost is 0. */
return 0; return 0;
} }
else if (REG_NOTE_KIND (link) == REG_DEP_OUTPUT)
{
/* Output dependency; DEP_INSN writes a register that INSN writes some
cycles later. */
if (get_attr_type (insn) == TYPE_FPLOAD)
{
rtx pat = PATTERN (insn);
rtx dep_pat = PATTERN (dep_insn);
if (GET_CODE (pat) == PARALLEL)
{
/* This happens for the fldXs,mb patterns. */
pat = XVECEXP (pat, 0, 0);
}
if (GET_CODE (pat) != SET || GET_CODE (dep_pat) != SET)
/* If this happens, we have to extend this to schedule
optimally. Return 0 for now. */
return 0;
if (reg_mentioned_p (SET_DEST (pat), SET_DEST (dep_pat)))
{
if (! recog_memoized (dep_insn))
return 0;
switch (get_attr_type (dep_insn))
{
case TYPE_FPALU:
case TYPE_FPMULSGL:
case TYPE_FPMULDBL:
case TYPE_FPDIVSGL:
case TYPE_FPDIVDBL:
case TYPE_FPSQRTSGL:
case TYPE_FPSQRTDBL:
/* A fpload can't be issued until one cycle before a
preceeding arithmetic operation has finished if
the target of the fpload is the destination of the
arithmetic operation. */
return cost - (pa_cpu_attr == PROCESSOR_700) ? 1 : 2;
/* For output dependencies, the cost is often one too high. */ default:
return cost - 1; return 0;
}
}
}
else if (get_attr_type (insn) == TYPE_FPALU)
{
rtx pat = PATTERN (insn);
rtx dep_pat = PATTERN (dep_insn);
if (GET_CODE (pat) == PARALLEL)
{
/* This happens for the fldXs,mb patterns. */
pat = XVECEXP (pat, 0, 0);
}
if (GET_CODE (pat) != SET || GET_CODE (dep_pat) != SET)
/* If this happens, we have to extend this to schedule
optimally. Return 0 for now. */
return 0;
if (reg_mentioned_p (SET_DEST (pat), SET_DEST (dep_pat)))
{
if (! recog_memoized (dep_insn))
return 0;
switch (get_attr_type (dep_insn))
{
case TYPE_FPDIVSGL:
case TYPE_FPDIVDBL:
case TYPE_FPSQRTSGL:
case TYPE_FPSQRTDBL:
/* An ALU flop can't be issued until two cycles before a
preceeding divide or sqrt operation has finished if
the target of the ALU flop is also the target of
of the divide or sqrt operation. */
return cost - (pa_cpu_attr == PROCESSOR_700) ? 2 : 4;
default:
return 0;
}
}
}
/* For other output dependencies, the cost is 0. */
return 0;
}
else
abort ();
} }
/* Return any length adjustment needed by INSN which already has its length /* Return any length adjustment needed by INSN which already has its length
......
...@@ -31,6 +31,21 @@ enum cmp_type /* comparison type */ ...@@ -31,6 +31,21 @@ enum cmp_type /* comparison type */
/* For long call handling. */ /* For long call handling. */
extern unsigned int total_code_bytes; extern unsigned int total_code_bytes;
/* Which processor to schedule for. */
enum processor_type
{
PROCESSOR_700,
PROCESSOR_7100,
PROCESSOR_7100LC,
};
#define pa_cpu_attr ((enum attr_cpu)pa_cpu)
/* For -mschedule= option. */
extern char *pa_cpu_string;
extern enum processor_type pa_cpu;
/* Print subsidiary information on the compiler version in use. */ /* Print subsidiary information on the compiler version in use. */
#define TARGET_VERSION fprintf (stderr, " (hppa)"); #define TARGET_VERSION fprintf (stderr, " (hppa)");
...@@ -123,6 +138,13 @@ extern int target_flags; ...@@ -123,6 +138,13 @@ extern int target_flags;
#define TARGET_DEFAULT 0x88 /* TARGET_GAS + TARGET_JUMP_IN_DELAY */ #define TARGET_DEFAULT 0x88 /* TARGET_GAS + TARGET_JUMP_IN_DELAY */
#endif #endif
#define TARGET_OPTIONS \
{ \
{ "schedule=", &pa_cpu_string }\
}
#define OVERRIDE_OPTIONS override_options ()
#define DBX_DEBUGGING_INFO #define DBX_DEBUGGING_INFO
#define DEFAULT_GDB_EXTENSIONS 1 #define DEFAULT_GDB_EXTENSIONS 1
......
...@@ -30,9 +30,16 @@ ...@@ -30,9 +30,16 @@
;; type "binary" insns have two input operands (1,2) and one output (0) ;; type "binary" insns have two input operands (1,2) and one output (0)
(define_attr "type" (define_attr "type"
"move,unary,binary,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmul,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,misc,milli" "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli"
(const_string "binary")) (const_string "binary"))
;; Processor type (for scheduling, not code generation) -- this attribute
;; must exactly match the processor_type enumeration in pa.h.
;;
;; FIXME: Add 800 scheduling for completeness?
(define_attr "cpu" "700,7100,7100LC" (const (symbol_ref "pa_cpu_attr")))
;; Length (in # of insns). ;; Length (in # of insns).
(define_attr "length" "" (define_attr "length" ""
(cond [(eq_attr "type" "load,fpload") (cond [(eq_attr "type" "load,fpload")
...@@ -43,11 +50,11 @@ ...@@ -43,11 +50,11 @@
(if_then_else (match_operand 0 "symbolic_memory_operand" "") (if_then_else (match_operand 0 "symbolic_memory_operand" "")
(const_int 8) (const_int 4)) (const_int 8) (const_int 4))
(eq_attr "type" "binary") (eq_attr "type" "binary,shift,nullshift")
(if_then_else (match_operand 2 "arith_operand" "") (if_then_else (match_operand 2 "arith_operand" "")
(const_int 4) (const_int 12)) (const_int 4) (const_int 12))
(eq_attr "type" "move,unary") (eq_attr "type" "move,unary,shift,nullshift")
(if_then_else (match_operand 1 "arith_operand" "") (if_then_else (match_operand 1 "arith_operand" "")
(const_int 4) (const_int 8))] (const_int 4) (const_int 8))]
...@@ -69,7 +76,7 @@ ...@@ -69,7 +76,7 @@
;; Disallow instructions which use the FPU since they will tie up the FPU ;; Disallow instructions which use the FPU since they will tie up the FPU
;; even if the instruction is nullified. ;; even if the instruction is nullified.
(define_attr "in_nullified_branch_delay" "false,true" (define_attr "in_nullified_branch_delay" "false,true"
(if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmul,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl") (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl")
(eq_attr "length" "4")) (eq_attr "length" "4"))
(const_string "true") (const_string "true")
(const_string "false"))) (const_string "false")))
...@@ -122,8 +129,8 @@ ...@@ -122,8 +129,8 @@
(and (eq_attr "in_nullified_branch_delay" "true") (and (eq_attr "in_nullified_branch_delay" "true")
(attr_flag "backward"))]) (attr_flag "backward"))])
;; Function units of the HPPA. The following data is for the "Snake" ;; Function units of the HPPA. The following data is for the 700 CPUs
;; (Mustang CPU + Timex FPU) because that's what I have the docs for. ;; (Mustang CPU + Timex FPU aka PA-89) because that's what I have the docs for.
;; Scheduling instructions for PA-83 machines according to the Snake ;; Scheduling instructions for PA-83 machines according to the Snake
;; constraints shouldn't hurt. ;; constraints shouldn't hurt.
...@@ -135,19 +142,23 @@ ...@@ -135,19 +142,23 @@
;; be specified.) ;; be specified.)
;; (define_function_unit "alu" 1 0 ;; (define_function_unit "alu" 1 0
;; (eq_attr "type" "unary,binary,move,address") 1 0) ;; (and (eq_attr "type" "unary,shift,nullshift,binary,move,address")
;; (eq_attr "cpu" "700"))
;; 1 0)
;; Memory. Disregarding Cache misses, the Mustang memory times are: ;; Memory. Disregarding Cache misses, the Mustang memory times are:
;; load: 2 ;; load: 2, fpload: 3
;; store, fpstore: 3, no D-cache operations should be scheduled. ;; store, fpstore: 3, no D-cache operations should be scheduled.
;; fpload: 3 (really 2 for flops, but I don't think we can specify that).
(define_function_unit "memory" 1 0 (eq_attr "type" "load") 2 0) (define_function_unit "pa700memory" 1 0
(define_function_unit "memory" 1 0 (eq_attr "type" "store,fpstore") 3 3) (and (eq_attr "type" "load,fpload")
(define_function_unit "memory" 1 0 (eq_attr "type" "fpload") 2 0) (eq_attr "cpu" "700")) 2 0)
(define_function_unit "pa700memory" 1 0
(and (eq_attr "type" "store,fpstore")
(eq_attr "cpu" "700")) 3 3)
;; The Timex has two floating-point units: ALU, and MUL/DIV/SQRT unit. ;; The Timex (aka 700) has two floating-point units: ALU, and MUL/DIV/SQRT.
;; Timings: ;; Timings:
;; Instruction Time Unit Minimum Distance (unit contention) ;; Instruction Time Unit Minimum Distance (unit contention)
;; fcpy 3 ALU 2 ;; fcpy 3 ALU 2
...@@ -166,13 +177,160 @@ ...@@ -166,13 +177,160 @@
;; fsqrt,sgl 14 MPY 14 ;; fsqrt,sgl 14 MPY 14
;; fsqrt,dbl 18 MPY 18 ;; fsqrt,dbl 18 MPY 18
(define_function_unit "fp_alu" 1 0 (eq_attr "type" "fpcc") 4 2) (define_function_unit "pa700fp_alu" 1 0
(define_function_unit "fp_alu" 1 0 (eq_attr "type" "fpalu") 3 2) (and (eq_attr "type" "fpcc")
(define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpmul") 3 2) (eq_attr "cpu" "700")) 4 2)
(define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpdivsgl") 10 10) (define_function_unit "pa700fp_alu" 1 0
(define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpdivdbl") 12 12) (and (eq_attr "type" "fpalu")
(define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpsqrtsgl") 14 14) (eq_attr "cpu" "700")) 3 2)
(define_function_unit "fp_mpy" 1 0 (eq_attr "type" "fpsqrtdbl") 18 18) (define_function_unit "pa700fp_mpy" 1 0
(and (eq_attr "type" "fpmulsgl,fpmuldbl")
(eq_attr "cpu" "700")) 3 2)
(define_function_unit "pa700fp_mpy" 1 0
(and (eq_attr "type" "fpdivsgl")
(eq_attr "cpu" "700")) 10 10)
(define_function_unit "pa700fp_mpy" 1 0
(and (eq_attr "type" "fpdivdbl")
(eq_attr "cpu" "700")) 12 12)
(define_function_unit "pa700fp_mpy" 1 0
(and (eq_attr "type" "fpsqrtsgl")
(eq_attr "cpu" "700")) 14 14)
(define_function_unit "pa700fp_mpy" 1 0
(and (eq_attr "type" "fpsqrtdbl")
(eq_attr "cpu" "700")) 18 18)
;; Function units for the 7100 and 7150. The 7100/7150 can dual-issue
;; floating point computations with non-floating point computations (fp loads
;; and stores are not fp computations).
;;
;; As with the alpha we multiply the ready delay by two to encourage
;; schedules which will allow the 7100/7150 to dual issue as many instructions
;; as possible.
;; Memory. Disregarding Cache misses, memory loads take two cycles; stores also
;; take two cycles, during which no Dcache operations should be scheduled.
;; Any special cases are handled in pa_adjust_cost. The 7100, 7150 and 7100LC
;; all have the same memory characteristics if one disregards cache misses.
(define_function_unit "pa7100memory" 1 0
(and (eq_attr "type" "load,fpload")
(eq_attr "cpu" "7100,7100LC")) 4 0)
(define_function_unit "pa7100memory" 1 0
(and (eq_attr "type" "store,fpstore")
(eq_attr "cpu" "7100,7100LC")) 4 4)
;; The 7100/7150 has three floating-point units: ALU, MUL, and DIV.
;; Timings:
;; Instruction Time Unit Minimum Distance (unit contention)
;; fcpy 2 ALU 1
;; fabs 2 ALU 1
;; fadd 2 ALU 1
;; fsub 2 ALU 1
;; fcmp 2 ALU 1
;; fcnv 2 ALU 1
;; fmpyadd 2 ALU,MPY 1
;; fmpysub 2 ALU,MPY 1
;; fmpycfxt 2 ALU,MPY 1
;; fmpy 2 MPY 1
;; fmpyi 2 MPY 1
;; fdiv,sgl 8 DIV 8
;; fdiv,dbl 15 DIV 15
;; fsqrt,sgl 8 DIV 8
;; fsqrt,dbl 15 DIV 15
(define_function_unit "pa7100fp_alu" 1 0
(and (eq_attr "type" "fpcc,fpalu")
(eq_attr "cpu" "7100")) 4 2)
(define_function_unit "pa7100fp_mpy" 1 0
(and (eq_attr "type" "fpmulsgl,fpmuldbl")
(eq_attr "cpu" "7100")) 4 2)
(define_function_unit "pa7100fp_div" 1 0
(and (eq_attr "type" "fpdivsgl,fpsqrtsgl")
(eq_attr "cpu" "7100")) 16 16)
(define_function_unit "pa7100fp_div" 1 0
(and (eq_attr "type" "fpdivdbl,fpsqrtdbl")
(eq_attr "cpu" "7100")) 30 30)
;; To encourage dual issue we define function units corresponding to
;; the instructions which can be dual issued. This is a rather crude
;; approximation, the "pa7100nonflop" test in particular could be refined.
(define_function_unit "pa7100flop" 1 1
(and
(eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl")
(eq_attr "cpu" "7100,7100LC")) 2 2)
(define_function_unit "pa7100nonflop" 1 1
(and
(eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl")
(eq_attr "cpu" "7100")) 2 2)
;; Memory subsystem works just like 7100/7150 (except for cache miss times which
;; we don't model here).
;; The 7100LC has three floating-point units: ALU, MUL, and DIV.
;; Note divides and sqrt flops lock the cpu until the flop is
;; finished. fmpy and xmpyu (fmpyi) lock the cpu for one cycle.
;; There's no way to avoid the penalty.
;; Timings:
;; Instruction Time Unit Minimum Distance (unit contention)
;; fcpy 2 ALU 1
;; fabs 2 ALU 1
;; fadd 2 ALU 1
;; fsub 2 ALU 1
;; fcmp 2 ALU 1
;; fcnv 2 ALU 1
;; fmpyadd,sgl 2 ALU,MPY 1
;; fmpyadd,dbl 3 ALU,MPY 2
;; fmpysub,sgl 2 ALU,MPY 1
;; fmpysub,dbl 3 ALU,MPY 2
;; fmpycfxt,sgl 2 ALU,MPY 1
;; fmpycfxt,dbl 3 ALU,MPY 2
;; fmpy,sgl 2 MPY 1
;; fmpy,dbl 3 MPY 2
;; fmpyi 3 MPY 2
;; fdiv,sgl 8 DIV 8
;; fdiv,dbl 15 DIV 15
;; fsqrt,sgl 8 DIV 8
;; fsqrt,dbl 15 DIV 15
(define_function_unit "pa7100LCfp_alu" 1 0
(and (eq_attr "type" "fpcc,fpalu")
(eq_attr "cpu" "7100LC")) 4 2)
(define_function_unit "pa7100LCfp_mpy" 1 0
(and (eq_attr "type" "fpmulsgl")
(eq_attr "cpu" "7100LC")) 4 2)
(define_function_unit "pa7100LCfp_mpy" 1 0
(and (eq_attr "type" "fpmuldbl")
(eq_attr "cpu" "7100LC")) 6 4)
(define_function_unit "pa7100LCfp_div" 1 0
(and (eq_attr "type" "fpdivsgl,fpsqrtsgl")
(eq_attr "cpu" "7100LC")) 16 16)
(define_function_unit "pa7100LCfp_div" 1 0
(and (eq_attr "type" "fpdivdbl,fpsqrtdbl")
(eq_attr "cpu" "7100LC")) 30 30)
;; Define the various functional units for dual-issue.
;; The 7100LC shares the generic "flop" unit specification with the 7100/7150.
;; The 7100LC has two basic integer which allow dual issue of most integer
;; instructions. This needs further refinement to deal with the nullify,
;; carry/borrow possible the ldw/ldw stw/stw special dual issue cases, and
;; of course it needs to know about hte 2nd alu.
(define_function_unit "pa7100LCnonflop" 1 1
(and
(eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,shift,nullshift")
(eq_attr "cpu" "7100LC")) 2 2)
(define_function_unit "pa7100LCshifter" 1 1
(and
(eq_attr "type" "shift,nullshift")
(eq_attr "cpu" "7100LC")) 2 2)
(define_function_unit "pa7100LCmem" 1 1
(and
(eq_attr "type" "load,fpload,store,fpstore")
(eq_attr "cpu" "7100LC")) 2 2)
;; Compare instructions. ;; Compare instructions.
;; This controls RTL generation and register allocation. ;; This controls RTL generation and register allocation.
...@@ -228,7 +386,8 @@ ...@@ -228,7 +386,8 @@
(match_operand:SF 1 "reg_or_0_operand" "fG")]))] (match_operand:SF 1 "reg_or_0_operand" "fG")]))]
"" ""
"fcmp,sgl,%Y2 %r0,%r1" "fcmp,sgl,%Y2 %r0,%r1"
[(set_attr "type" "fpcc")]) [(set_attr "length" "4")
(set_attr "type" "fpcc")])
(define_insn "" (define_insn ""
[(set (reg:CCFP 0) [(set (reg:CCFP 0)
...@@ -237,7 +396,8 @@ ...@@ -237,7 +396,8 @@
(match_operand:DF 1 "reg_or_0_operand" "fG")]))] (match_operand:DF 1 "reg_or_0_operand" "fG")]))]
"" ""
"fcmp,dbl,%Y2 %r0,%r1" "fcmp,dbl,%Y2 %r0,%r1"
[(set_attr "type" "fpcc")]) [(set_attr "length" "4")
(set_attr "type" "fpcc")])
;; scc insns. ;; scc insns.
...@@ -403,7 +563,7 @@ ...@@ -403,7 +563,7 @@
"" ""
"com%I2clr,%S3 %2,%1,0\;com%I5clr,%B6 %5,%4,%0\;ldi 1,%0" "com%I2clr,%S3 %2,%1,0\;com%I5clr,%B6 %5,%4,%0\;ldi 1,%0"
[(set_attr "type" "binary") [(set_attr "type" "binary")
(set_attr "length" "8")]) (set_attr "length" "12")])
;; Combiner patterns for common operations performed with the output ;; Combiner patterns for common operations performed with the output
;; from an scc insn (negscc and incscc). ;; from an scc insn (negscc and incscc).
...@@ -619,7 +779,7 @@ ...@@ -619,7 +779,7 @@
com%I4clr,%B5 %4,%3,%0\;ldi %1,%0 com%I4clr,%B5 %4,%3,%0\;ldi %1,%0
com%I4clr,%B5 %4,%3,%0\;ldil L'%1,%0 com%I4clr,%B5 %4,%3,%0\;ldil L'%1,%0
com%I4clr,%B5 %4,%3,%0\;zdepi %Z1,%0" com%I4clr,%B5 %4,%3,%0\;zdepi %Z1,%0"
[(set_attr "type" "multi,multi,multi,multi,multi") [(set_attr "type" "multi,multi,multi,multi,nullshift")
(set_attr "length" "8,8,8,8,8")]) (set_attr "length" "8,8,8,8,8")])
(define_insn "" (define_insn ""
...@@ -640,7 +800,7 @@ ...@@ -640,7 +800,7 @@
com%I4clr,%B5 %4,%3,0\;ldi %1,%0 com%I4clr,%B5 %4,%3,0\;ldi %1,%0
com%I4clr,%B5 %4,%3,0\;ldil L'%1,%0 com%I4clr,%B5 %4,%3,0\;ldil L'%1,%0
com%I4clr,%B5 %4,%3,0\;zdepi %Z1,%0" com%I4clr,%B5 %4,%3,0\;zdepi %Z1,%0"
[(set_attr "type" "multi,multi,multi,multi,multi,multi,multi,multi") [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
(set_attr "length" "8,8,8,8,8,8,8,8")]) (set_attr "length" "8,8,8,8,8,8,8,8")])
;; Conditional Branches ;; Conditional Branches
...@@ -1014,7 +1174,7 @@ ...@@ -1014,7 +1174,7 @@
fcpy,sgl %r1,%0 fcpy,sgl %r1,%0
fldws%F1 %1,%0 fldws%F1 %1,%0
fstws%F0 %1,%0" fstws%F0 %1,%0"
[(set_attr "type" "move,move,move,move,load,store,move,fpalu,fpload,fpstore") [(set_attr "type" "move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
(set_attr "length" "4,4,4,4,4,4,4,4,4,4")]) (set_attr "length" "4,4,4,4,4,4,4,4,4,4")])
;; Load indexed. We don't use unscaled modes since they can't be used ;; Load indexed. We don't use unscaled modes since they can't be used
...@@ -1039,7 +1199,7 @@ ...@@ -1039,7 +1199,7 @@
;; has constraints allowing a register. I don't know how this works, ;; has constraints allowing a register. I don't know how this works,
;; but it somehow makes sure that out-of-range constants are placed ;; but it somehow makes sure that out-of-range constants are placed
;; in a register which somehow magically is a "const_int_operand". ;; in a register which somehow magically is a "const_int_operand".
;; (this was stolen from alpha.md, I'm not going to try and change it. ;; (this was stolen from alpha.md, I'm not going to try and change it.)
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "&=r") [(set (match_operand:SI 0 "register_operand" "&=r")
(mem:SI (plus:SI (plus:SI (mem:SI (plus:SI (plus:SI
...@@ -1190,7 +1350,9 @@ ...@@ -1190,7 +1350,9 @@
if (flag_pic != 2) if (flag_pic != 2)
abort (); abort ();
return \"ldw RT'%G2(%1),%0\"; return \"ldw RT'%G2(%1),%0\";
}") }"
[(set_attr "type" "load")
(set_attr "length" "4")])
;; Always use addil rather than ldil;add sequences. This allows the ;; Always use addil rather than ldil;add sequences. This allows the
...@@ -1263,7 +1425,8 @@ ...@@ -1263,7 +1425,8 @@
(match_operand:SI 2 "function_label_operand" "")))] (match_operand:SI 2 "function_label_operand" "")))]
"!TARGET_PORTABLE_RUNTIME" "!TARGET_PORTABLE_RUNTIME"
"ldo RP'%G2(%1),%0" "ldo RP'%G2(%1),%0"
[(set_attr "length" "4")]) [(set_attr "type" "move")
(set_attr "length" "4")])
;; This version is used only for the portable runtime conventions model ;; This version is used only for the portable runtime conventions model
;; (it does not use/support plabels) ;; (it does not use/support plabels)
...@@ -1273,7 +1436,8 @@ ...@@ -1273,7 +1436,8 @@
(match_operand:SI 2 "function_label_operand" "")))] (match_operand:SI 2 "function_label_operand" "")))]
"TARGET_PORTABLE_RUNTIME" "TARGET_PORTABLE_RUNTIME"
"ldo R'%G2(%1),%0" "ldo R'%G2(%1),%0"
[(set_attr "length" "4")]) [(set_attr "type" "move")
(set_attr "length" "4")])
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -1287,7 +1451,8 @@ ...@@ -1287,7 +1451,8 @@
else else
return \"ldo R'%G2(%1),%0\"; return \"ldo R'%G2(%1),%0\";
}" }"
[(set_attr "length" "4")]) [(set_attr "type" "move")
(set_attr "length" "4")])
;; Now that a symbolic_address plus a constant is broken up early ;; Now that a symbolic_address plus a constant is broken up early
;; in the compilation phase (for better CSE) we need a special ;; in the compilation phase (for better CSE) we need a special
...@@ -1327,7 +1492,7 @@ ...@@ -1327,7 +1492,7 @@
sth%M0 %r1,%0 sth%M0 %r1,%0
mtsar %r1 mtsar %r1
fcpy,sgl %r1,%0" fcpy,sgl %r1,%0"
[(set_attr "type" "move,move,move,move,load,store,move,fpalu") [(set_attr "type" "move,move,move,shift,load,store,move,fpalu")
(set_attr "length" "4,4,4,4,4,4,4,4")]) (set_attr "length" "4,4,4,4,4,4,4,4")])
(define_insn "" (define_insn ""
...@@ -1402,7 +1567,8 @@ ...@@ -1402,7 +1567,8 @@
(match_operand 2 "const_int_operand" "")))] (match_operand 2 "const_int_operand" "")))]
"" ""
"ldo R'%G2(%1),%0" "ldo R'%G2(%1),%0"
[(set_attr "length" "4")]) [(set_attr "type" "move")
(set_attr "length" "4")])
(define_expand "movqi" (define_expand "movqi"
[(set (match_operand:QI 0 "general_operand" "") [(set (match_operand:QI 0 "general_operand" "")
...@@ -1428,7 +1594,7 @@ ...@@ -1428,7 +1594,7 @@
stb%M0 %r1,%0 stb%M0 %r1,%0
mtsar %r1 mtsar %r1
fcpy,sgl %r1,%0" fcpy,sgl %r1,%0"
[(set_attr "type" "move,move,move,move,load,store,move,fpalu") [(set_attr "type" "move,move,move,shift,load,store,move,fpalu")
(set_attr "length" "4,4,4,4,4,4,4,4")]) (set_attr "length" "4,4,4,4,4,4,4,4")])
(define_insn "" (define_insn ""
...@@ -1755,7 +1921,7 @@ ...@@ -1755,7 +1921,7 @@
return output_fp_move_double (operands); return output_fp_move_double (operands);
return output_move_double (operands); return output_move_double (operands);
}" }"
[(set_attr "type" "move,store,store,load,load,misc,fpalu,fpload,fpstore") [(set_attr "type" "move,store,store,load,load,multi,fpalu,fpload,fpstore")
(set_attr "length" "8,8,16,8,16,16,4,4,4")]) (set_attr "length" "8,8,16,8,16,16,4,4,4")])
(define_insn "" (define_insn ""
...@@ -1773,9 +1939,8 @@ ...@@ -1773,9 +1939,8 @@
output_asm_insn (\"copy %1,%0\", operands); output_asm_insn (\"copy %1,%0\", operands);
return \"ldo R'%G2(%R1),%R0\"; return \"ldo R'%G2(%R1),%R0\";
}" }"
;; Need to set length for this arith insn because operand2 [(set_attr "type" "move,move")
;; is not an "arith_operand". (set_attr "length" "4,8")])
[(set_attr "length" "4,8")])
;; This pattern forces (set (reg:SF ...) (const_double ...)) ;; This pattern forces (set (reg:SF ...) (const_double ...))
;; to be reloaded by putting the constant into memory when ;; to be reloaded by putting the constant into memory when
...@@ -1944,7 +2109,8 @@ ...@@ -1944,7 +2109,8 @@
"@ "@
extru %1,31,16,%0 extru %1,31,16,%0
ldh%M1 %1,%0" ldh%M1 %1,%0"
[(set_attr "type" "unary,load")]) [(set_attr "type" "shift,load")
(set_attr "length" "4,4")])
(define_insn "zero_extendqihi2" (define_insn "zero_extendqihi2"
[(set (match_operand:HI 0 "register_operand" "=r,r") [(set (match_operand:HI 0 "register_operand" "=r,r")
...@@ -1954,7 +2120,8 @@ ...@@ -1954,7 +2120,8 @@
"@ "@
extru %1,31,8,%0 extru %1,31,8,%0
ldb%M1 %1,%0" ldb%M1 %1,%0"
[(set_attr "type" "unary,load")]) [(set_attr "type" "shift,load")
(set_attr "length" "4,4")])
(define_insn "zero_extendqisi2" (define_insn "zero_extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=r,r") [(set (match_operand:SI 0 "register_operand" "=r,r")
...@@ -1964,7 +2131,8 @@ ...@@ -1964,7 +2131,8 @@
"@ "@
extru %1,31,8,%0 extru %1,31,8,%0
ldb%M1 %1,%0" ldb%M1 %1,%0"
[(set_attr "type" "unary,load")]) [(set_attr "type" "shift,load")
(set_attr "length" "4,4")])
;;- sign extension instructions ;;- sign extension instructions
...@@ -1973,21 +2141,24 @@ ...@@ -1973,21 +2141,24 @@
(sign_extend:SI (match_operand:HI 1 "register_operand" "r")))] (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
"" ""
"extrs %1,31,16,%0" "extrs %1,31,16,%0"
[(set_attr "type" "unary")]) [(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "extendqihi2" (define_insn "extendqihi2"
[(set (match_operand:HI 0 "register_operand" "=r") [(set (match_operand:HI 0 "register_operand" "=r")
(sign_extend:HI (match_operand:QI 1 "register_operand" "r")))] (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
"" ""
"extrs %1,31,8,%0" "extrs %1,31,8,%0"
[(set_attr "type" "unary")]) [(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "extendqisi2" (define_insn "extendqisi2"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(sign_extend:SI (match_operand:QI 1 "register_operand" "r")))] (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
"" ""
"extrs %1,31,8,%0" "extrs %1,31,8,%0"
[(set_attr "type" "unary")]) [(set_attr "type" "shift")
(set_attr "length" "4")])
;; Conversions between float and double. ;; Conversions between float and double.
...@@ -1997,7 +2168,8 @@ ...@@ -1997,7 +2168,8 @@
(match_operand:SF 1 "register_operand" "f")))] (match_operand:SF 1 "register_operand" "f")))]
"" ""
"fcnvff,sgl,dbl %1,%0" "fcnvff,sgl,dbl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "truncdfsf2" (define_insn "truncdfsf2"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
...@@ -2005,7 +2177,8 @@ ...@@ -2005,7 +2177,8 @@
(match_operand:DF 1 "register_operand" "f")))] (match_operand:DF 1 "register_operand" "f")))]
"" ""
"fcnvff,dbl,sgl %1,%0" "fcnvff,dbl,sgl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
;; Conversion between fixed point and floating point. ;; Conversion between fixed point and floating point.
;; Note that among the fix-to-float insns ;; Note that among the fix-to-float insns
...@@ -2031,7 +2204,8 @@ ...@@ -2031,7 +2204,8 @@
(float:SF (match_operand:SI 1 "register_operand" "f")))] (float:SF (match_operand:SI 1 "register_operand" "f")))]
"" ""
"fcnvxf,sgl,sgl %1,%0" "fcnvxf,sgl,sgl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
;; This pattern forces (set (reg:DF ...) (float:DF (const_int ...))) ;; This pattern forces (set (reg:DF ...) (float:DF (const_int ...)))
;; to be reloaded by putting the constant into memory. ;; to be reloaded by putting the constant into memory.
...@@ -2049,7 +2223,8 @@ ...@@ -2049,7 +2223,8 @@
(float:DF (match_operand:SI 1 "register_operand" "f")))] (float:DF (match_operand:SI 1 "register_operand" "f")))]
"" ""
"fcnvxf,sgl,dbl %1,%0" "fcnvxf,sgl,dbl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_expand "floatunssisf2" (define_expand "floatunssisf2"
[(set (subreg:SI (match_dup 2) 1) [(set (subreg:SI (match_dup 2) 1)
...@@ -2076,14 +2251,16 @@ ...@@ -2076,14 +2251,16 @@
(float:SF (match_operand:DI 1 "register_operand" "f")))] (float:SF (match_operand:DI 1 "register_operand" "f")))]
"TARGET_SNAKE" "TARGET_SNAKE"
"fcnvxf,dbl,sgl %1,%0" "fcnvxf,dbl,sgl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "floatdidf2" (define_insn "floatdidf2"
[(set (match_operand:DF 0 "general_operand" "=f") [(set (match_operand:DF 0 "general_operand" "=f")
(float:DF (match_operand:DI 1 "register_operand" "f")))] (float:DF (match_operand:DI 1 "register_operand" "f")))]
"TARGET_SNAKE" "TARGET_SNAKE"
"fcnvxf,dbl,dbl %1,%0" "fcnvxf,dbl,dbl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
;; Convert a float to an actual integer. ;; Convert a float to an actual integer.
;; Truncation is performed as part of the conversion. ;; Truncation is performed as part of the conversion.
...@@ -2093,28 +2270,32 @@ ...@@ -2093,28 +2270,32 @@
(fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))] (fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
"" ""
"fcnvfxt,sgl,sgl %1,%0" "fcnvfxt,sgl,sgl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "fix_truncdfsi2" (define_insn "fix_truncdfsi2"
[(set (match_operand:SI 0 "register_operand" "=f") [(set (match_operand:SI 0 "register_operand" "=f")
(fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))] (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
"" ""
"fcnvfxt,dbl,sgl %1,%0" "fcnvfxt,dbl,sgl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "fix_truncsfdi2" (define_insn "fix_truncsfdi2"
[(set (match_operand:DI 0 "register_operand" "=f") [(set (match_operand:DI 0 "register_operand" "=f")
(fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))] (fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
"TARGET_SNAKE" "TARGET_SNAKE"
"fcnvfxt,sgl,dbl %1,%0" "fcnvfxt,sgl,dbl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "fix_truncdfdi2" (define_insn "fix_truncdfdi2"
[(set (match_operand:DI 0 "register_operand" "=f") [(set (match_operand:DI 0 "register_operand" "=f")
(fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f"))))] (fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
"TARGET_SNAKE" "TARGET_SNAKE"
"fcnvfxt,dbl,dbl %1,%0" "fcnvfxt,dbl,dbl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
;;- arithmetic instructions ;;- arithmetic instructions
...@@ -2135,14 +2316,17 @@ ...@@ -2135,14 +2316,17 @@
else else
return \"add %R2,%R1,%R0\;addc %2,%1,%0\"; return \"add %R2,%R1,%R0\;addc %2,%1,%0\";
}" }"
[(set_attr "length" "8")]) [(set_attr "type" "binary")
(set_attr "length" "8")])
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(plus:SI (not:SI (match_operand:SI 1 "register_operand" "r")) (plus:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
(match_operand:SI 2 "register_operand" "r")))] (match_operand:SI 2 "register_operand" "r")))]
"" ""
"uaddcm %2,%1,%0") "uaddcm %2,%1,%0"
[(set_attr "type" "binary")
(set_attr "length" "4")])
;; define_splits to optimize cases of adding a constant integer ;; define_splits to optimize cases of adding a constant integer
;; to a register when the constant does not fit in 14 bits. */ ;; to a register when the constant does not fit in 14 bits. */
...@@ -2207,7 +2391,9 @@ ...@@ -2207,7 +2391,9 @@
"" ""
"@ "@
addl %1,%2,%0 addl %1,%2,%0
ldo %2(%1),%0") ldo %2(%1),%0"
[(set_attr "type" "binary,binary")
(set_attr "length" "4,4")])
(define_insn "subdi3" (define_insn "subdi3"
[(set (match_operand:DI 0 "register_operand" "=r") [(set (match_operand:DI 0 "register_operand" "=r")
...@@ -2215,7 +2401,8 @@ ...@@ -2215,7 +2401,8 @@
(match_operand:DI 2 "register_operand" "r")))] (match_operand:DI 2 "register_operand" "r")))]
"" ""
"sub %R1,%R2,%R0\;subb %1,%2,%0" "sub %R1,%R2,%R0\;subb %1,%2,%0"
[(set_attr "length" "8")]) [(set_attr "type" "binary")
(set_attr "length" "8")])
(define_insn "subsi3" (define_insn "subsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r") [(set (match_operand:SI 0 "register_operand" "=r,r")
...@@ -2224,7 +2411,9 @@ ...@@ -2224,7 +2411,9 @@
"" ""
"@ "@
sub %1,%2,%0 sub %1,%2,%0
subi %1,%2,%0") subi %1,%2,%0"
[(set_attr "type" "binary,binary")
(set_attr "length" "4,4")])
;; Clobbering a "register_operand" instead of a match_scratch ;; Clobbering a "register_operand" instead of a match_scratch
;; in operand3 of millicode calls avoids spilling %r1 and ;; in operand3 of millicode calls avoids spilling %r1 and
...@@ -2263,7 +2452,8 @@ ...@@ -2263,7 +2452,8 @@
(zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "f"))))] (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "f"))))]
"TARGET_SNAKE && ! TARGET_DISABLE_FPREGS" "TARGET_SNAKE && ! TARGET_DISABLE_FPREGS"
"xmpyu %1,%2,%0" "xmpyu %1,%2,%0"
[(set_attr "type" "fpmul")]) [(set_attr "type" "fpmuldbl")
(set_attr "length" "4")])
(define_insn "" (define_insn ""
[(set (match_operand:DI 0 "nonimmediate_operand" "=f") [(set (match_operand:DI 0 "nonimmediate_operand" "=f")
...@@ -2271,7 +2461,8 @@ ...@@ -2271,7 +2461,8 @@
(match_operand:DI 2 "uint32_operand" "f")))] (match_operand:DI 2 "uint32_operand" "f")))]
"TARGET_SNAKE && ! TARGET_DISABLE_FPREGS" "TARGET_SNAKE && ! TARGET_DISABLE_FPREGS"
"xmpyu %1,%R2,%0" "xmpyu %1,%R2,%0"
[(set_attr "type" "fpmul")]) [(set_attr "type" "fpmuldbl")
(set_attr "length" "4")])
(define_insn "" (define_insn ""
[(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25))) [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
...@@ -2514,7 +2705,8 @@ ...@@ -2514,7 +2705,8 @@
(match_operand:DI 2 "register_operand" "r")))] (match_operand:DI 2 "register_operand" "r")))]
"" ""
"and %1,%2,%0\;and %R1,%R2,%R0" "and %1,%2,%0\;and %R1,%R2,%R0"
[(set_attr "length" "8")]) [(set_attr "type" "binary")
(set_attr "length" "8")])
; The ? for op1 makes reload prefer zdepi instead of loading a huge ; The ? for op1 makes reload prefer zdepi instead of loading a huge
; constant with ldil;ldo. ; constant with ldil;ldo.
...@@ -2524,8 +2716,8 @@ ...@@ -2524,8 +2716,8 @@
(match_operand:SI 2 "and_operand" "rO,P")))] (match_operand:SI 2 "and_operand" "rO,P")))]
"" ""
"* return output_and (operands); " "* return output_and (operands); "
[(set_attr "type" "binary") [(set_attr "type" "binary,shift")
(set_attr "length" "4")]) (set_attr "length" "4,4")])
(define_insn "" (define_insn ""
[(set (match_operand:DI 0 "register_operand" "=r") [(set (match_operand:DI 0 "register_operand" "=r")
...@@ -2533,14 +2725,17 @@ ...@@ -2533,14 +2725,17 @@
(match_operand:DI 2 "register_operand" "r")))] (match_operand:DI 2 "register_operand" "r")))]
"" ""
"andcm %2,%1,%0\;andcm %R2,%R1,%R0" "andcm %2,%1,%0\;andcm %R2,%R1,%R0"
[(set_attr "length" "8")]) [(set_attr "type" "binary")
(set_attr "length" "8")])
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(and:SI (not:SI (match_operand:SI 1 "register_operand" "r")) (and:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
(match_operand:SI 2 "register_operand" "r")))] (match_operand:SI 2 "register_operand" "r")))]
"" ""
"andcm %2,%1,%0") "andcm %2,%1,%0"
[(set_attr "type" "binary")
(set_attr "length" "4")])
(define_expand "iordi3" (define_expand "iordi3"
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")
...@@ -2561,7 +2756,8 @@ ...@@ -2561,7 +2756,8 @@
(match_operand:DI 2 "register_operand" "r")))] (match_operand:DI 2 "register_operand" "r")))]
"" ""
"or %1,%2,%0\;or %R1,%R2,%R0" "or %1,%2,%0\;or %R1,%R2,%R0"
[(set_attr "length" "8")]) [(set_attr "type" "binary")
(set_attr "length" "8")])
;; Need a define_expand because we've run out of CONST_OK... characters. ;; Need a define_expand because we've run out of CONST_OK... characters.
(define_expand "iorsi3" (define_expand "iorsi3"
...@@ -2576,20 +2772,22 @@ ...@@ -2576,20 +2772,22 @@
}") }")
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r,r")
(ior:SI (match_operand:SI 1 "register_operand" "0") (ior:SI (match_operand:SI 1 "register_operand" "0,0")
(match_operand:SI 2 "ior_operand" "")))] (match_operand:SI 2 "ior_operand" "M,i")))]
"" ""
"* return output_ior (operands); " "* return output_ior (operands); "
[(set_attr "type" "binary") [(set_attr "type" "binary,shift")
(set_attr "length" "4")]) (set_attr "length" "4,4")])
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(ior:SI (match_operand:SI 1 "register_operand" "%r") (ior:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))] (match_operand:SI 2 "register_operand" "r")))]
"" ""
"or %1,%2,%0") "or %1,%2,%0"
[(set_attr "type" "binary")
(set_attr "length" "4")])
(define_expand "xordi3" (define_expand "xordi3"
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")
...@@ -2610,14 +2808,17 @@ ...@@ -2610,14 +2808,17 @@
(match_operand:DI 2 "register_operand" "r")))] (match_operand:DI 2 "register_operand" "r")))]
"" ""
"xor %1,%2,%0\;xor %R1,%R2,%R0" "xor %1,%2,%0\;xor %R1,%R2,%R0"
[(set_attr "length" "8")]) [(set_attr "type" "binary")
(set_attr "length" "8")])
(define_insn "xorsi3" (define_insn "xorsi3"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
(xor:SI (match_operand:SI 1 "register_operand" "%r") (xor:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "register_operand" "r")))] (match_operand:SI 2 "register_operand" "r")))]
"" ""
"xor %1,%2,%0") "xor %1,%2,%0"
[(set_attr "type" "binary")
(set_attr "length" "4")])
(define_insn "negdi2" (define_insn "negdi2"
[(set (match_operand:DI 0 "register_operand" "=r") [(set (match_operand:DI 0 "register_operand" "=r")
...@@ -2632,7 +2833,8 @@ ...@@ -2632,7 +2833,8 @@
(neg:SI (match_operand:SI 1 "register_operand" "r")))] (neg:SI (match_operand:SI 1 "register_operand" "r")))]
"" ""
"sub 0,%1,%0" "sub 0,%1,%0"
[(set_attr "type" "unary")]) [(set_attr "type" "unary")
(set_attr "length" "4")])
(define_expand "one_cmpldi2" (define_expand "one_cmpldi2"
[(set (match_operand:DI 0 "register_operand" "") [(set (match_operand:DI 0 "register_operand" "")
...@@ -2657,7 +2859,8 @@ ...@@ -2657,7 +2859,8 @@
(not:SI (match_operand:SI 1 "register_operand" "r")))] (not:SI (match_operand:SI 1 "register_operand" "r")))]
"" ""
"uaddcm 0,%1,%0" "uaddcm 0,%1,%0"
[(set_attr "type" "unary")]) [(set_attr "type" "unary")
(set_attr "length" "4")])
;; Floating point arithmetic instructions. ;; Floating point arithmetic instructions.
...@@ -2667,7 +2870,8 @@ ...@@ -2667,7 +2870,8 @@
(match_operand:DF 2 "register_operand" "f")))] (match_operand:DF 2 "register_operand" "f")))]
"" ""
"fadd,dbl %1,%2,%0" "fadd,dbl %1,%2,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "addsf3" (define_insn "addsf3"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
...@@ -2675,7 +2879,8 @@ ...@@ -2675,7 +2879,8 @@
(match_operand:SF 2 "register_operand" "f")))] (match_operand:SF 2 "register_operand" "f")))]
"" ""
"fadd,sgl %1,%2,%0" "fadd,sgl %1,%2,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "subdf3" (define_insn "subdf3"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
...@@ -2683,7 +2888,8 @@ ...@@ -2683,7 +2888,8 @@
(match_operand:DF 2 "register_operand" "f")))] (match_operand:DF 2 "register_operand" "f")))]
"" ""
"fsub,dbl %1,%2,%0" "fsub,dbl %1,%2,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "subsf3" (define_insn "subsf3"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
...@@ -2691,7 +2897,8 @@ ...@@ -2691,7 +2897,8 @@
(match_operand:SF 2 "register_operand" "f")))] (match_operand:SF 2 "register_operand" "f")))]
"" ""
"fsub,sgl %1,%2,%0" "fsub,sgl %1,%2,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "muldf3" (define_insn "muldf3"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
...@@ -2699,7 +2906,8 @@ ...@@ -2699,7 +2906,8 @@
(match_operand:DF 2 "register_operand" "f")))] (match_operand:DF 2 "register_operand" "f")))]
"" ""
"fmpy,dbl %1,%2,%0" "fmpy,dbl %1,%2,%0"
[(set_attr "type" "fpmul")]) [(set_attr "type" "fpmuldbl")
(set_attr "length" "4")])
(define_insn "mulsf3" (define_insn "mulsf3"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
...@@ -2707,7 +2915,8 @@ ...@@ -2707,7 +2915,8 @@
(match_operand:SF 2 "register_operand" "f")))] (match_operand:SF 2 "register_operand" "f")))]
"" ""
"fmpy,sgl %1,%2,%0" "fmpy,sgl %1,%2,%0"
[(set_attr "type" "fpmul")]) [(set_attr "type" "fpmulsgl")
(set_attr "length" "4")])
(define_insn "divdf3" (define_insn "divdf3"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
...@@ -2715,7 +2924,8 @@ ...@@ -2715,7 +2924,8 @@
(match_operand:DF 2 "register_operand" "f")))] (match_operand:DF 2 "register_operand" "f")))]
"" ""
"fdiv,dbl %1,%2,%0" "fdiv,dbl %1,%2,%0"
[(set_attr "type" "fpdivdbl")]) [(set_attr "type" "fpdivdbl")
(set_attr "length" "4")])
(define_insn "divsf3" (define_insn "divsf3"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
...@@ -2723,49 +2933,56 @@ ...@@ -2723,49 +2933,56 @@
(match_operand:SF 2 "register_operand" "f")))] (match_operand:SF 2 "register_operand" "f")))]
"" ""
"fdiv,sgl %1,%2,%0" "fdiv,sgl %1,%2,%0"
[(set_attr "type" "fpdivsgl")]) [(set_attr "type" "fpdivsgl")
(set_attr "length" "4")])
(define_insn "negdf2" (define_insn "negdf2"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
(neg:DF (match_operand:DF 1 "register_operand" "f")))] (neg:DF (match_operand:DF 1 "register_operand" "f")))]
"" ""
"fsub,dbl 0,%1,%0" "fsub,dbl 0,%1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "negsf2" (define_insn "negsf2"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
(neg:SF (match_operand:SF 1 "register_operand" "f")))] (neg:SF (match_operand:SF 1 "register_operand" "f")))]
"" ""
"fsub,sgl 0,%1,%0" "fsub,sgl 0,%1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "absdf2" (define_insn "absdf2"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
(abs:DF (match_operand:DF 1 "register_operand" "f")))] (abs:DF (match_operand:DF 1 "register_operand" "f")))]
"" ""
"fabs,dbl %1,%0" "fabs,dbl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "abssf2" (define_insn "abssf2"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
(abs:SF (match_operand:SF 1 "register_operand" "f")))] (abs:SF (match_operand:SF 1 "register_operand" "f")))]
"" ""
"fabs,sgl %1,%0" "fabs,sgl %1,%0"
[(set_attr "type" "fpalu")]) [(set_attr "type" "fpalu")
(set_attr "length" "4")])
(define_insn "sqrtdf2" (define_insn "sqrtdf2"
[(set (match_operand:DF 0 "register_operand" "=f") [(set (match_operand:DF 0 "register_operand" "=f")
(sqrt:DF (match_operand:DF 1 "register_operand" "f")))] (sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
"" ""
"fsqrt,dbl %1,%0" "fsqrt,dbl %1,%0"
[(set_attr "type" "fpsqrtdbl")]) [(set_attr "type" "fpsqrtdbl")
(set_attr "length" "4")])
(define_insn "sqrtsf2" (define_insn "sqrtsf2"
[(set (match_operand:SF 0 "register_operand" "=f") [(set (match_operand:SF 0 "register_operand" "=f")
(sqrt:SF (match_operand:SF 1 "register_operand" "f")))] (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
"" ""
"fsqrt,sgl %1,%0" "fsqrt,sgl %1,%0"
[(set_attr "type" "fpsqrtsgl")]) [(set_attr "type" "fpsqrtsgl")
(set_attr "length" "4")])
;;- Shift instructions ;;- Shift instructions
...@@ -2795,7 +3012,9 @@ ...@@ -2795,7 +3012,9 @@
(match_operand:SI 3 "shadd_operand" "")) (match_operand:SI 3 "shadd_operand" ""))
(match_operand:SI 1 "register_operand" "r")))] (match_operand:SI 1 "register_operand" "r")))]
"" ""
"sh%O3addl %2,%1,%0") "sh%O3addl %2,%1,%0"
[(set_attr "type" "binary")
(set_attr "length" "4")])
;; This variant of the above insn can occur if the first operand ;; This variant of the above insn can occur if the first operand
;; is the frame pointer. This is a kludge, but there doesn't ;; is the frame pointer. This is a kludge, but there doesn't
...@@ -2847,7 +3066,7 @@ ...@@ -2847,7 +3066,7 @@
(match_operand:SI 2 "const_int_operand" "n")))] (match_operand:SI 2 "const_int_operand" "n")))]
"" ""
"zdep %1,%P2,%L2,%0" "zdep %1,%P2,%L2,%0"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
; Match cases of op1 a CONST_INT here that zvdep_imm doesn't handle. ; Match cases of op1 a CONST_INT here that zvdep_imm doesn't handle.
...@@ -2864,7 +3083,9 @@ ...@@ -2864,7 +3083,9 @@
"" ""
"@ "@
zvdep %1,32,%0 zvdep %1,32,%0
zvdepi %1,32,%0") zvdepi %1,32,%0"
[(set_attr "type" "shift,shift")
(set_attr "length" "4,4")])
(define_insn "zvdep_imm" (define_insn "zvdep_imm"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -2878,7 +3099,9 @@ ...@@ -2878,7 +3099,9 @@
operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1)); operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1));
operands[1] = GEN_INT ((x & 0xf) - 0x10); operands[1] = GEN_INT ((x & 0xf) - 0x10);
return \"zvdepi %1,%2,%0\"; return \"zvdepi %1,%2,%0\";
}") }"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "vdepi_ior" (define_insn "vdepi_ior"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -2893,7 +3116,9 @@ ...@@ -2893,7 +3116,9 @@
int x = INTVAL (operands[1]); int x = INTVAL (operands[1]);
operands[2] = GEN_INT (exact_log2 (x + 1)); operands[2] = GEN_INT (exact_log2 (x + 1));
return \"vdepi -1,%2,%0\"; return \"vdepi -1,%2,%0\";
}") }"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "vdepi_and" (define_insn "vdepi_and"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -2908,7 +3133,9 @@ ...@@ -2908,7 +3133,9 @@
int x = INTVAL (operands[1]); int x = INTVAL (operands[1]);
operands[2] = GEN_INT (exact_log2 ((~x) + 1)); operands[2] = GEN_INT (exact_log2 ((~x) + 1));
return \"vdepi 0,%2,%0\"; return \"vdepi 0,%2,%0\";
}") }"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_expand "ashrsi3" (define_expand "ashrsi3"
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
...@@ -2932,7 +3159,7 @@ ...@@ -2932,7 +3159,7 @@
(match_operand:SI 2 "const_int_operand" "n")))] (match_operand:SI 2 "const_int_operand" "n")))]
"" ""
"extrs %1,%P2,%L2,%0" "extrs %1,%P2,%L2,%0"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
(define_insn "vextrs32" (define_insn "vextrs32"
...@@ -2941,7 +3168,9 @@ ...@@ -2941,7 +3168,9 @@
(minus:SI (const_int 31) (minus:SI (const_int 31)
(match_operand:SI 2 "register_operand" "q"))))] (match_operand:SI 2 "register_operand" "q"))))]
"" ""
"vextrs %1,32,%0") "vextrs %1,32,%0"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "lshrsi3" (define_insn "lshrsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r") [(set (match_operand:SI 0 "register_operand" "=r,r")
...@@ -2951,7 +3180,7 @@ ...@@ -2951,7 +3180,7 @@
"@ "@
vshd 0,%1,%0 vshd 0,%1,%0
extru %1,%P2,%L2,%0" extru %1,%P2,%L2,%0"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
(define_insn "rotrsi3" (define_insn "rotrsi3"
...@@ -2969,7 +3198,7 @@ ...@@ -2969,7 +3198,7 @@
else else
return \"vshd %1,%1,%0\"; return \"vshd %1,%1,%0\";
}" }"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
(define_insn "rotlsi3" (define_insn "rotlsi3"
...@@ -2982,7 +3211,7 @@ ...@@ -2982,7 +3211,7 @@
operands[2] = GEN_INT ((32 - INTVAL (operands[2])) & 31); operands[2] = GEN_INT ((32 - INTVAL (operands[2])) & 31);
return \"shd %1,%1,%2,%0\"; return \"shd %1,%1,%2,%0\";
}" }"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
(define_insn "" (define_insn ""
...@@ -2994,7 +3223,7 @@ ...@@ -2994,7 +3223,7 @@
(match_operand:SI 4 "const_int_operand" "n"))]))] (match_operand:SI 4 "const_int_operand" "n"))]))]
"INTVAL (operands[3]) + INTVAL (operands[4]) == 32" "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
"shd %1,%2,%4,%0" "shd %1,%2,%4,%0"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
(define_insn "" (define_insn ""
...@@ -3006,7 +3235,7 @@ ...@@ -3006,7 +3235,7 @@
(match_operand:SI 3 "const_int_operand" "n"))]))] (match_operand:SI 3 "const_int_operand" "n"))]))]
"INTVAL (operands[3]) + INTVAL (operands[4]) == 32" "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
"shd %1,%2,%4,%0" "shd %1,%2,%4,%0"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
(define_insn "" (define_insn ""
...@@ -3022,7 +3251,7 @@ ...@@ -3022,7 +3251,7 @@
operands[2] = GEN_INT (31 - cnt); operands[2] = GEN_INT (31 - cnt);
return \"zdep %1,%2,%3,%0\"; return \"zdep %1,%2,%3,%0\";
}" }"
[(set_attr "type" "binary") [(set_attr "type" "shift")
(set_attr "length" "4")]) (set_attr "length" "4")])
;; Unconditional and other jump instructions. ;; Unconditional and other jump instructions.
...@@ -3031,7 +3260,8 @@ ...@@ -3031,7 +3260,8 @@
[(return)] [(return)]
"hppa_can_use_return_insn_p ()" "hppa_can_use_return_insn_p ()"
"bv%* 0(%%r2)" "bv%* 0(%%r2)"
[(set_attr "type" "branch")]) [(set_attr "type" "branch")
(set_attr "length" "4")])
;; Use a different pattern for functions which have non-trivial ;; Use a different pattern for functions which have non-trivial
;; epilogues so as not to confuse jump and reorg. ;; epilogues so as not to confuse jump and reorg.
...@@ -3040,7 +3270,8 @@ ...@@ -3040,7 +3270,8 @@
(return)] (return)]
"" ""
"bv%* 0(%%r2)" "bv%* 0(%%r2)"
[(set_attr "type" "branch")]) [(set_attr "type" "branch")
(set_attr "length" "4")])
(define_expand "prologue" (define_expand "prologue"
[(const_int 0)] [(const_int 0)]
...@@ -3072,7 +3303,8 @@ ...@@ -3072,7 +3303,8 @@
(use (match_operand:SI 0 "const_int_operand" ""))] (use (match_operand:SI 0 "const_int_operand" ""))]
"" ""
"bl _mcount,%%r2\;ldo %0(%%r2),%%r25" "bl _mcount,%%r2\;ldo %0(%%r2),%%r25"
[(set_attr "length" "8")]) [(set_attr "type" "multi")
(set_attr "length" "8")])
(define_insn "blockage" (define_insn "blockage"
[(unspec_volatile [(const_int 2)] 0)] [(unspec_volatile [(const_int 2)] 0)]
...@@ -3156,7 +3388,8 @@ ...@@ -3156,7 +3388,8 @@
return \"sub,>> %0,%1,0\;blr,n %0,0\;b,n %l3\"; return \"sub,>> %0,%1,0\;blr,n %0,0\;b,n %l3\";
} }
}" }"
[(set_attr "length" "12")]) [(set_attr "type" "multi")
(set_attr "length" "12")])
;; Need nops for the calls because execution is supposed to continue ;; Need nops for the calls because execution is supposed to continue
;; past; we don't want to nullify an instruction that we need. ;; past; we don't want to nullify an instruction that we need.
...@@ -3384,14 +3617,17 @@ ...@@ -3384,14 +3617,17 @@
(define_insn "nop" (define_insn "nop"
[(const_int 0)] [(const_int 0)]
"" ""
"nop") "nop"
[(set_attr "type" "move")
(set_attr "length" "4")])
;;; Hope this is only within a function... ;;; Hope this is only within a function...
(define_insn "indirect_jump" (define_insn "indirect_jump"
[(set (pc) (match_operand:SI 0 "register_operand" "r"))] [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
"" ""
"bv%* 0(%0)" "bv%* 0(%0)"
[(set_attr "type" "branch")]) [(set_attr "type" "branch")
(set_attr "length" "4")])
(define_insn "extzv" (define_insn "extzv"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -3399,7 +3635,9 @@ ...@@ -3399,7 +3635,9 @@
(match_operand:SI 2 "uint5_operand" "") (match_operand:SI 2 "uint5_operand" "")
(match_operand:SI 3 "uint5_operand" "")))] (match_operand:SI 3 "uint5_operand" "")))]
"" ""
"extru %1,%3+%2-1,%2,%0") "extru %1,%3+%2-1,%2,%0"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -3407,7 +3645,9 @@ ...@@ -3407,7 +3645,9 @@
(const_int 1) (const_int 1)
(match_operand:SI 3 "register_operand" "q")))] (match_operand:SI 3 "register_operand" "q")))]
"" ""
"vextru %1,1,%0") "vextru %1,1,%0"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "extv" (define_insn "extv"
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -3415,7 +3655,9 @@ ...@@ -3415,7 +3655,9 @@
(match_operand:SI 2 "uint5_operand" "") (match_operand:SI 2 "uint5_operand" "")
(match_operand:SI 3 "uint5_operand" "")))] (match_operand:SI 3 "uint5_operand" "")))]
"" ""
"extrs %1,%3+%2-1,%2,%0") "extrs %1,%3+%2-1,%2,%0"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "" (define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r") [(set (match_operand:SI 0 "register_operand" "=r")
...@@ -3423,7 +3665,9 @@ ...@@ -3423,7 +3665,9 @@
(const_int 1) (const_int 1)
(match_operand:SI 3 "register_operand" "q")))] (match_operand:SI 3 "register_operand" "q")))]
"" ""
"vextrs %1,1,%0") "vextrs %1,1,%0"
[(set_attr "type" "shift")
(set_attr "length" "4")])
(define_insn "insv" (define_insn "insv"
[(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r,r") [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r,r")
...@@ -3433,7 +3677,9 @@ ...@@ -3433,7 +3677,9 @@
"" ""
"@ "@
dep %3,%2+%1-1,%1,%0 dep %3,%2+%1-1,%1,%0
depi %3,%2+%1-1,%1,%0") depi %3,%2+%1-1,%1,%0"
[(set_attr "type" "shift,shift")
(set_attr "length" "4,4")])
;; Optimize insertion of const_int values of type 1...1xxxx. ;; Optimize insertion of const_int values of type 1...1xxxx.
(define_insn "" (define_insn ""
...@@ -3447,7 +3693,9 @@ ...@@ -3447,7 +3693,9 @@
{ {
operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10); operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10);
return \"depi %3,%2+%1-1,%1,%0\"; return \"depi %3,%2+%1-1,%1,%0\";
}") }"
[(set_attr "type" "shift")
(set_attr "length" "4")])
;; This insn is used for some loop tests, typically loops reversed when ;; This insn is used for some loop tests, typically loops reversed when
;; strength reduction is used. It is actually created when the instruction ;; strength reduction is used. It is actually created when the instruction
...@@ -3759,7 +4007,8 @@ ...@@ -3759,7 +4007,8 @@
(use (mem:SI (match_operand:SI 1 "register_operand" "r")))] (use (mem:SI (match_operand:SI 1 "register_operand" "r")))]
"" ""
"fdc 0(0,%0)\;fdc 0(0,%1)\;sync" "fdc 0(0,%0)\;fdc 0(0,%1)\;sync"
[(set_attr "length" "12")]) [(set_attr "type" "multi")
(set_attr "length" "12")])
(define_insn "icacheflush" (define_insn "icacheflush"
[(unspec_volatile [(const_int 2)] 0) [(unspec_volatile [(const_int 2)] 0)
...@@ -3770,4 +4019,5 @@ ...@@ -3770,4 +4019,5 @@
(clobber (match_operand:SI 4 "register_operand" "=&r"))] (clobber (match_operand:SI 4 "register_operand" "=&r"))]
"" ""
"mfsp %%sr0,%4\;ldsid (0,%2),%3\;mtsp %3,%%sr0\;fic 0(%%sr0,%0)\;fic 0(%%sr0,%1)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop" "mfsp %%sr0,%4\;ldsid (0,%2),%3\;mtsp %3,%%sr0\;fic 0(%%sr0,%0)\;fic 0(%%sr0,%1)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop"
[(set_attr "length" "52")]) [(set_attr "type" "multi")
(set_attr "length" "52")])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment