aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/frv/frv.md
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2005-07-28 02:03:45 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2005-07-28 02:03:45 +0000
commit38c28a2564a0f81eb26b2eec0908190c2094dd1f (patch)
tree86d74a60faadcae82333a3bbc29a7771ade8a80b /gcc/config/frv/frv.md
parent47c504ea5ba6da768565dc25fd0455001cec7090 (diff)
downloadgcc-38c28a2564a0f81eb26b2eec0908190c2094dd1f.zip
gcc-38c28a2564a0f81eb26b2eec0908190c2094dd1f.tar.gz
gcc-38c28a2564a0f81eb26b2eec0908190c2094dd1f.tar.bz2
frv.opt (moptimize-membar): New.
* config/frv/frv.opt (moptimize-membar): New. * doc/invoke.texi: Document -moptimize-membar and its inverse. * config/frv/frv.h: Remove machine_function definition. * config/frv/frv.c (struct frv_io): New. (struct machine_function): Moved from frv.h. Add has_membar_p. (frv_same_doubleword_p, frv_io_fixed_order_p, frv_io_union) (frv_extract_membar, frv_io_check_address, frv_io_handle_set) (frv_io_handle_use_1, frv_io_handle_use, frv_optimize_membar_local) (frv_optimize_membar_global, frv_optimize_membar): New functions. (frv_reorg): Call frv_optimize_membar when appropriate. (bdesc_loads, bdesc_stores): Use the membar code as the icode field. (frv_expand_builtin): Adjust calls accordingly. (frv_io_address_cookie): New function. (frv_expand_load_builtin, frv_expand_store_builtin): Emit a normal load or store rather than a special insn. Add ccnstant address and io-type operands to the membar. (frv_ifcvt_modify_tests): Unsign regno. (frv_ifcvt_modify_tests): Same. * config/frv/frv.md: Remove UNSPEC_BUILTIN_{LOAD,STORE}. Change UNSPEC_OPTIONAL_MEMBAR constant. (builtin_read_<mode>): Delete. (builtin_write_<mode>): Delete. ("optional_membar_<mode>"): Add operand. * testsuite/gcc.target/frv/all-builtin-read8.c: Delete. * testsuite/gcc.target/frv/all-builtin-read16.c: Delete. * testsuite/gcc.target/frv/all-builtin-read32.c: Delete. * testsuite/gcc.target/frv/all-builtin-read64.c: Delete. * testsuite/gcc.target/frv/all-builtin-write8.c: Delete. * testsuite/gcc.target/frv/all-builtin-write16.c: Delete. * testsuite/gcc.target/frv/all-builtin-write32.c: Delete. * testsuite/gcc.target/frv/all-builtin-write64.c: Delete. * testsuite/gcc.target/frv/all-read-write-1.c: New. From-SVN: r102455
Diffstat (limited to 'gcc/config/frv/frv.md')
-rw-r--r--gcc/config/frv/frv.md44
1 files changed, 9 insertions, 35 deletions
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index 5b744bb..d0f3592 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -41,9 +41,7 @@
(UNSPEC_EH_RETURN_EPILOGUE 6)
(UNSPEC_GOT 7)
(UNSPEC_LDD 8)
- (UNSPEC_BUILTIN_LOAD 9)
- (UNSPEC_BUILTIN_STORE 10)
- (UNSPEC_OPTIONAL_MEMBAR 11)
+ (UNSPEC_OPTIONAL_MEMBAR 9)
(UNSPEC_GETTLSOFF 200)
(UNSPEC_TLS_LOAD_GOTTLSOFF12 201)
@@ -2168,41 +2166,17 @@
FAIL;
}")
-;; The load part of a __builtin_read* function.
-;; Use UNSPECs to distinguish these patterns from normal moves.
-(define_insn "builtin_read_<mode>"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (zero_extend:SI (unspec:IMODE
- [(match_operand:IMODE 1 "memory_operand" "m")]
- UNSPEC_BUILTIN_LOAD)))]
- ""
- "ld<BREADsuffix>%I1%U1 %M1,%0"
- [(set_attr "length" "4")
- (set_attr "type" "gload")])
-
-;; The store part of a __builtin_write* function.
-(define_insn "builtin_write_<mode>"
- [(set (match_operand:IMODE 0 "memory_operand" "=m")
- (unspec:IMODE [(match_operand:IMODE 1 "reg_or_0_operand" "dO")]
- UNSPEC_BUILTIN_STORE))]
- ""
- "st<IMODEsuffix>%I0%U0 %z1, %M0"
- [(set_attr "length" "4")
- (set_attr "type" "gstore")])
-
-;; This one has a different predicate for operand 1.
-(define_insn "builtin_write64"
- [(set (match_operand:DI 0 "memory_operand" "=m")
- (unspec:DI [(match_operand:DI 1 "register_operand" "d")]
- UNSPEC_BUILTIN_STORE))]
- ""
- "std%I0%U0 %z1, %M0"
- [(set_attr "length" "4")
- (set_attr "type" "gstore")])
+;; The "membar" part of a __builtin_read* or __builtin_write* function.
+;; Operand 0 is a volatile reference to the memory that the function reads
+;; or writes. Operand 1 is the address being accessed, or zero if the
+;; address isn't a known constant. Operand 2 describes the __builtin
+;; function (either FRV_IO_READ or FRV_IO_WRITE).
(define_insn "optional_membar_<mode>"
[(set (match_operand:IMODE 0 "memory_operand" "=m")
- (unspec:IMODE [(const_int 0)] UNSPEC_OPTIONAL_MEMBAR))]
+ (unspec:IMODE [(match_operand 1 "const_int_operand" "")
+ (match_operand 2 "const_int_operand" "")]
+ UNSPEC_OPTIONAL_MEMBAR))]
""
"membar"
[(set_attr "length" "4")])