"Memory operands with base register, index register"
(match_test "csky_valid_mem_constraint_operand (op, \"W\")"))
+(define_memory_constraint "Y"
+ "Memory operands without index register"
+ (not (match_test "csky_valid_mem_constraint_operand (op, \"W\")")))
+
(define_constraint "R"
"Memory operands whose address is a label_ref"
(and (match_code "mem")
/* The follow index is for ldr instruction, the ldr cannot
load dword data, so the mode size should not be larger than
4. */
- else if (GET_MODE_SIZE (mode) <= 4)
+ else if (GET_MODE_SIZE (mode) <= 4
+ || (TARGET_HARD_FLOAT && CSKY_VREG_MODE_P (mode)))
{
if (is_csky_address_register_rtx_p (index, strict_p))
return 1;
)
(define_insn "*fpuv2_movdf"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r, r,m, v,?r,Q,v,v,v")
- (match_operand:DF 1 "general_operand" " r,m,mF,r,?r, v,v,Q,v,m"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=r, v,?r,Q,v,v,v,r, r,Y")
+ (match_operand:DF 1 "general_operand" " r,?r, v,v,Q,v,m,Y,YF,r"))]
"CSKY_ISA_FEATURE (fpv2_df)"
"* return csky_output_movedouble(operands, DFmode);"
[(set (attr "length")
)
(define_insn "*fpv3_movdf"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r, r,m,v,?r,Q,v,v,v, v")
- (match_operand:DF 1 "general_operand" " r,m,mF,r,?r,v,v,Q,v,m,Dv"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=r, v,?r,Q,v,v,v, v,r, r,Y")
+ (match_operand:DF 1 "general_operand" " r,?r, v,v,Q,v,m,Dv,Y,YF,r"))]
"CSKY_ISA_FEATURE(fpv3_df)"
"*
switch (which_alternative)
{
- case 4:
+ case 1:
if (TARGET_BIG_ENDIAN)
return \"fmtvr.64\\t%0, %R1, %1\";
return \"fmtvr.64\\t%0, %1, %R1\";
- case 5:
+ case 2:
if (TARGET_BIG_ENDIAN)
return \"fmfvr.64\\t%R0, %0, %1\";
return \"fmfvr.64\\t%0, %R0, %1\";
+ case 3:
+ case 4:
case 6:
- case 7:
- case 9:
return fpuv3_output_move(operands);
- case 8:
+ case 5:
return \"fmov.64\\t%0, %1\";
- case 10:
+ case 7:
return \"fmovi.64\\t%0, %1\";
default:
return csky_output_movedouble(operands, DFmode);
--- /dev/null
+/* { dg-do compile } */
+/* { dg-csky-options "-mcpu=ck810f -O1 -mhard-float" } */
+
+double fldrd (double *pd, int index)
+{
+ return pd[index];
+}
+
+/* { dg-final { scan-assembler "fldrd" } } */
+
+void fstrd (double *pd, int index, double d)
+{
+ pd[index] = d;
+}
+
+/* { dg-final { scan-assembler "fstrd" } } */
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-skip-if "test is specific to ck860f" { csky-*-* } { "*" } { "-mcpu=ck860*f* -mfloat-abi=hard" "-mcpu=ck860*f* -mhard-float" } } */
+/* { dg-options "-O1 -mfpu=fpv3" } */
+
+double fldr64 (double *pd, int index)
+{
+ return pd[index];
+}
+
+/* { dg-final { scan-assembler "fldr.64" } } */
+
+void fstr64 (double *pd, int index, double d)
+{
+ pd[index] = d;
+}
+
+/* { dg-final { scan-assembler "fstr.64" } } */
+