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
4767c570
Commit
4767c570
authored
Aug 24, 2004
by
Richard Sandiford
Committed by
Richard Sandiford
Aug 24, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcc.c-torture/compile/20040824-1.c: New test.
From-SVN: r86513
parent
a657c98a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
81 deletions
+42
-81
gcc/ChangeLog
+4
-0
gcc/config/mips/mips-protos.h
+1
-1
gcc/config/mips/mips.c
+18
-18
gcc/config/mips/mips.md
+17
-62
gcc/testsuite/gcc.c-torture/compile/20040824-1.c
+2
-0
No files found.
gcc/ChangeLog
View file @
4767c570
2004-08-24 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/compile/20040824-1.c: New test.
2004-08-24 Richard Earnshaw <rearnsha@arm.com>
* arm.md: Include predicates.md.
...
...
gcc/config/mips/mips-protos.h
View file @
4767c570
...
...
@@ -203,7 +203,7 @@ extern const char *mips_output_conditional_branch (rtx, rtx *, int, int,
extern
const
char
*
mips_output_division
(
const
char
*
,
rtx
*
);
extern
unsigned
int
mips_hard_regno_nregs
(
int
,
enum
machine_mode
);
extern
bool
mips_linked_madd_p
(
rtx
,
rtx
);
extern
const
char
*
mips_emit_prefetch
(
rtx
*
);
extern
rtx
mips_prefetch_cookie
(
rtx
,
rtx
);
extern
void
irix_asm_output_align
(
FILE
*
,
unsigned
);
extern
const
char
*
current_section_name
(
void
);
...
...
gcc/config/mips/mips.c
View file @
4767c570
...
...
@@ -4836,6 +4836,10 @@ print_operand_address (FILE *file, rtx x)
return
;
case
ADDRESS_CONST_INT
:
output_addr_const
(
file
,
x
);
fprintf
(
file
,
"(%s)"
,
reg_names
[
0
]);
return
;
case
ADDRESS_SYMBOLIC
:
output_addr_const
(
file
,
x
);
return
;
...
...
@@ -9080,26 +9084,22 @@ mips_multipass_dfa_lookahead (void)
return
0
;
}
/* Given that we have an rtx of the form (prefetch ... WRITE LOCALITY),
return the first operand of the associated "pref" or "prefx" insn. */
const
char
*
mips_emit_prefetch
(
rtx
*
operands
)
{
int
write
=
INTVAL
(
operands
[
1
]);
int
locality
=
INTVAL
(
operands
[
2
]);
int
indexed
=
GET_CODE
(
operands
[
3
])
==
REG
;
int
code
;
char
buffer
[
30
];
if
(
locality
<=
0
)
code
=
(
write
?
5
:
4
);
/* store_streamed / load_streamed. */
else
if
(
locality
<=
2
)
code
=
(
write
?
1
:
0
);
/* store / load. */
else
code
=
(
write
?
7
:
6
);
/* store_retained / load_retained. */
rtx
mips_prefetch_cookie
(
rtx
write
,
rtx
locality
)
{
/* store_streamed / load_streamed. */
if
(
INTVAL
(
locality
)
<=
0
)
return
GEN_INT
(
INTVAL
(
write
)
+
4
);
/* store / load. */
if
(
INTVAL
(
locality
)
<=
2
)
return
write
;
sprintf
(
buffer
,
"%s
\t
%d,%%3(%%0)"
,
indexed
?
"prefx"
:
"pref"
,
code
);
output_asm_insn
(
buffer
,
operands
);
return
""
;
/* store_retained / load_retained. */
return
GEN_INT
(
INTVAL
(
write
)
+
6
);
}
#include "gt-mips.h"
gcc/config/mips/mips.md
View file @
4767c570
...
...
@@ -5975,73 +5975,28 @@ beq\t%2,%.,1b\;\
;;
(define_expand "prefetch"
[
(prefetch (match_operand 0 "address_operand")
(match_operand 1 "const_int_operand")
(match_operand 2 "const_int_operand"))]
"ISA_HAS_PREFETCH"
{
if (symbolic_operand (operands
[
0
]
, GET_MODE (operands
[
0
]
)))
operands
[
0
]
= force_reg (GET_MODE (operands
[
0
]
), operands
[
0
]
);
})
(define_insn "prefetch_si_address"
[
(prefetch (plus:SI (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 3 "const_int_operand" "I"))
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == SImode"
{ return mips_emit_prefetch (operands); }
[
(set_attr "type" "prefetch")
]
)
(define_insn "prefetch_indexed_si"
[
(prefetch (plus:SI (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 3 "register_operand" "r"))
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCHX && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && Pmode == SImode"
{ return mips_emit_prefetch (operands); }
[
(set_attr "type" "prefetchx")
]
)
(define_insn "prefetch_si"
[
(prefetch (match_operand:SI 0 "register_operand" "r")
(match_operand:SI 1 "const_int_operand" "n")
(match_operand:SI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == SImode"
{
operands
[
3
]
= const0_rtx;
return mips_emit_prefetch (operands);
(define_insn "prefetch"
[
(prefetch (match_operand:QI 0 "address_operand" "p")
(match_operand 1 "const_int_operand" "n")
(match_operand 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && TARGET_EXPLICIT_RELOCS"
{
operands
[
1
]
= mips_prefetch_cookie (operands
[
1
]
, operands
[
2
]
);
return "pref
\t
%1,%a0";
}
[
(set_attr "type" "prefetch")
]
)
(define_insn "prefetch_di_address"
[
(prefetch (plus:DI (match_operand:DI 0 "register_operand" "r")
(match_operand:DI 3 "const_int_operand" "I"))
(match_operand:DI 1 "const_int_operand" "n")
(match_operand:DI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == DImode"
{ return mips_emit_prefetch (operands); }
[
(set_attr "type" "prefetch")
]
)
(define_insn "prefetch_indexed_di"
[
(prefetch (plus:DI (match_operand:DI 0 "register_operand" "r")
(match_operand:DI 3 "register_operand" "r"))
(match_operand:DI 1 "const_int_operand" "n")
(match_operand:DI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCHX && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && Pmode == DImode"
{ return mips_emit_prefetch (operands); }
[
(set_attr "type" "prefetchx")
]
)
(define_insn "prefetch_di"
[
(prefetch (match_operand:DI 0 "register_operand" "r")
(match_operand:DI 1 "const_int_operand" "n")
(match_operand:DI 2 "const_int_operand" "n"))]
"ISA_HAS_PREFETCH && Pmode == DImode"
(define_insn "
*
prefetch_indexed_
<mode>
"
[
(prefetch (plus:P (match_operand:P 0 "register_operand" "d")
(match_operand:P 1 "register_operand" "d"))
(match_operand 2 "const_int_operand" "n")
(match_operand 3 "const_int_operand" "n"))]
"ISA_HAS_PREFETCHX && TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT"
{
operands
[
3
]
= const0_rtx
;
return
mips_emit_prefetch (operands)
;
operands
[
2
]
= mips_prefetch_cookie (operands
[
2
]
, operands
[
3
]
)
;
return
"prefx
\t
%2,%1(%0)"
;
}
[
(set_attr "type" "prefetch")
]
)
[
(set_attr "type" "prefetch
x
")
]
)
(define_insn "nop"
[
(const_int 0)
]
...
...
gcc/testsuite/gcc.c-torture/compile/20040824-1.c
0 → 100644
View file @
4767c570
/* This caused an out-of-range address on the MIPS port. */
void
foo
(
char
*
x
)
{
__builtin_prefetch
(
x
+
0x8000
);
}
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