Target RejectNegative Joined UInteger Var(la_branch_cost) Save
-mbranch-cost=COST Set the cost of branches to roughly COST instructions.
+maddr-reg-reg-cost=
+Target RejectNegative Joined UInteger Var(la_addr_reg_reg_cost) Save
+-maddr-reg-reg-cost=COST Set the cost of ADDRESS_REG_REG to the value calculated by COST.
+
mcheck-zero-division
Target Mask(CHECK_ZERO_DIV) Save
Trap on integer divide by zero.
movcf2gr (COSTS_N_INSNS (7)),
movgr2cf (COSTS_N_INSNS (15)),
branch_cost (6),
+ addr_reg_reg_cost (3),
memory_latency (4) {}
/* The following properties cannot be looked up directly using "cpucfg".
if (!opts_set->x_la_branch_cost)
opts->x_la_branch_cost = loongarch_cost->branch_cost;
+ if (!opts_set->x_la_addr_reg_reg_cost)
+ opts->x_la_addr_reg_reg_cost = loongarch_cost->addr_reg_reg_cost;
+
/* other stuff */
if (ABI_LP64_P (target->abi.base))
opts->x_flag_pcc_struct_return = 0;
unsigned short movcf2gr;
unsigned short movgr2cf;
unsigned short branch_cost;
+ unsigned short addr_reg_reg_cost;
unsigned short memory_latency;
/* Default RTX cost initializer, implemented in loongarch-def.cc. */
return *this;
}
+ loongarch_rtx_cost_data addr_reg_reg_cost_ (unsigned short _addr_reg_reg_cost)
+ {
+ addr_reg_reg_cost = _addr_reg_reg_cost;
+ return *this;
+ }
+
loongarch_rtx_cost_data memory_latency_ (unsigned short _memory_latency)
{
memory_latency = _memory_latency;
return factor;
case ADDRESS_REG_REG:
- return factor;
+ return factor * la_addr_reg_reg_cost;
case ADDRESS_CONST_INT:
return lsx_p ? 0 : factor;
Target RejectNegative Joined UInteger Var(la_branch_cost) Save
-mbranch-cost=COST Set the cost of branches to roughly COST instructions.
+maddr-reg-reg-cost=
+Target RejectNegative Joined UInteger Var(la_addr_reg_reg_cost) Save
+-maddr-reg-reg-cost=COST Set the cost of ADDRESS_REG_REG to the value calculated by COST.
+
mcheck-zero-division
Target Mask(CHECK_ZERO_DIV) Save
Trap on integer divide by zero.
mbranch-cost=
UrlSuffix(gcc/LoongArch-Options.html#index-mbranch-cost-2)
+maddr-reg-reg-cost=
+UrlSuffix(gcc/LoongArch-Options.html#index-maddr-reg-reg-cost)
+
mcheck-zero-division
UrlSuffix(gcc/LoongArch-Options.html#index-mcheck-zero-division)
@gccoptlist{-march=@var{arch-type} -mtune=@var{tune-type} -mabi=@var{base-abi-type}
-mfpu=@var{fpu-type} -msimd=@var{simd-type}
-msoft-float -msingle-float -mdouble-float -mlsx -mno-lsx -mlasx -mno-lasx
--mbranch-cost=@var{n} -mcheck-zero-division -mno-check-zero-division
+-mbranch-cost=@var{n} -maddr-reg-reg-cost=@var{n} -mcheck-zero-division
+-mno-check-zero-division
-mcond-move-int -mno-cond-move-int
-mcond-move-float -mno-cond-move-float
-memcpy -mno-memcpy -mstrict-align -mno-strict-align -G @var{num}
@item -mbranch-cost=@var{n}
Set the cost of branches to roughly @var{n} instructions.
+@opindex maddr-reg-reg-cost
+@item -maddr-reg-reg-cost=@var{n}
+Set the cost of ADDRESS_REG_REG to the value calculated by @var{n}.
+
@opindex mcheck-zero-division
@item -mcheck-zero-division
@itemx -mno-check-zero-divison
/* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -maddr-reg-reg-cost=1" } */
/* { dg-final { scan-assembler-times {stx\..\t\$r0} 2 } } */
extern float arr_f[];
/* { dg-do compile } */
-/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16" } */
+/* { dg-options "-O2 -fstack-clash-protection --param stack-clash-protection-guard-size=16 -maddr-reg-reg-cost=1" } */
/* { dg-require-effective-target supports_stack_clash_protection } */
/* { dg-require-effective-target alloca } */
/* { dg-skip-if "" { *-*-* } { "-fstack-check" } { "" } } */