diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-05 17:49:20 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-05 17:49:20 +0000 |
commit | 8930d5de749ea36918b1592057b0e4a0736e1c8a (patch) | |
tree | 545262d37317cc42d07d086316626461d84df9b8 | |
parent | f3daead2fdedad296a0608221fb911637b2a5803 (diff) | |
download | gcc-8930d5de749ea36918b1592057b0e4a0736e1c8a.tar.gz |
* pa.md (prefetch, prefetch_32, prefetch_64): Only allow short
displacements with the spatial-locality cache-control completer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84125 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/pa/pa.md | 38 |
2 files changed, 37 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3d06b8874ec..07c54214abf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-07-05 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> + + * pa.md (prefetch, prefetch_32, prefetch_64): Only allow short + displacements with the spatial-locality cache-control completer. + 2004-07-05 Zack Weinberg <zack@codesourcery.com> * langhooks.c: Don't include gt-langhooks.h. diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 25389966c8e..cfa3ab3ef58 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -9359,6 +9359,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" (match_operand 2 "const_int_operand" "")] "TARGET_PA_20" { + /* The PA 2.0 prefetch instructions only support short displacements + when a cache control completer needs to be supplied. Thus, we + can't use LO_SUM DLT addresses with the spatial locality completer. */ + if (operands[2] == const0_rtx && IS_LO_SUM_DLT_ADDR_P (operands[0])) + FAIL; + /* We change operand0 to a MEM as we don't have the infrastructure to output all the supported address modes for ldw/ldd but we do have it for MEMs. */ @@ -9385,7 +9391,14 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" [(prefetch (match_operand:DI 0 "prefetch_operand" "A,RQ") (match_operand:DI 1 "const_int_operand" "n,n") (match_operand:DI 2 "const_int_operand" "n,n"))] - "TARGET_64BIT" + "TARGET_64BIT + && (operands[2] != const0_rtx + || REG_P (XEXP (operands[0], 0)) + || IS_INDEX_ADDR_P (XEXP (operands[0], 0)) + || (GET_CODE (XEXP (operands[0], 0)) == PLUS + && REG_P (XEXP (XEXP (operands[0], 0), 0)) + && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT + && VAL_5_BITS_P (XEXP (XEXP (operands[0], 0), 1))))" { /* The SL completor indicates good spatial locality but poor temporal locality. The ldw instruction with a target of general register 0 @@ -9394,11 +9407,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" static const char * const instr[2][2][2] = { { { - "ldw,sl RT'%A0,%%r0", + "", "ldw RT'%A0,%%r0", }, { - "ldd,sl RT'%A0,%%r0", + "", "ldd RT'%A0,%%r0", }, }, @@ -9421,6 +9434,9 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" || (locality < 0 || locality > 3)) abort (); + if (which_alternative == 0 && locality == 0) + abort (); + return instr [which_alternative][read_or_write][locality == 0 ? 0 : 1]; } [(set_attr "type" "load") @@ -9430,7 +9446,14 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" [(prefetch (match_operand:SI 0 "prefetch_operand" "A,RQ") (match_operand:SI 1 "const_int_operand" "n,n") (match_operand:SI 2 "const_int_operand" "n,n"))] - "TARGET_PA_20" + "TARGET_PA_20 + && (operands[2] != const0_rtx + || REG_P (XEXP (operands[0], 0)) + || IS_INDEX_ADDR_P (XEXP (operands[0], 0)) + || (GET_CODE (XEXP (operands[0], 0)) == PLUS + && REG_P (XEXP (XEXP (operands[0], 0), 0)) + && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT + && VAL_5_BITS_P (XEXP (XEXP (operands[0], 0), 1))))" { /* The SL completor indicates good spatial locality but poor temporal locality. The ldw instruction with a target of general register 0 @@ -9439,11 +9462,11 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" static const char * const instr[2][2][2] = { { { - "ldw,sl RT'%A0,%%r0", + "", "ldw RT'%A0,%%r0", }, { - "ldd,sl RT'%A0,%%r0", + "", "ldd RT'%A0,%%r0", }, }, @@ -9466,6 +9489,9 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" || (locality < 0 || locality > 3)) abort (); + if (which_alternative == 0 && locality == 0) + abort (); + return instr [which_alternative][read_or_write][locality == 0 ? 0 : 1]; } [(set_attr "type" "load") |