From 001b246b66e9ba912435973e77e300c0d90b5ad5 Mon Sep 17 00:00:00 2001 From: aldyh Date: Thu, 28 Jul 2005 02:03:45 +0000 Subject: * 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_): Delete. (builtin_write_): Delete. ("optional_membar_"): 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102455 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/config/frv/frv.md | 44 +++++++++----------------------------------- 1 file changed, 9 insertions(+), 35 deletions(-) (limited to 'gcc/config/frv/frv.md') diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index 5b744bbc523..d0f35927759 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_" - [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extend:SI (unspec:IMODE - [(match_operand:IMODE 1 "memory_operand" "m")] - UNSPEC_BUILTIN_LOAD)))] - "" - "ld%I1%U1 %M1,%0" - [(set_attr "length" "4") - (set_attr "type" "gload")]) - -;; The store part of a __builtin_write* function. -(define_insn "builtin_write_" - [(set (match_operand:IMODE 0 "memory_operand" "=m") - (unspec:IMODE [(match_operand:IMODE 1 "reg_or_0_operand" "dO")] - UNSPEC_BUILTIN_STORE))] - "" - "st%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_" [(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")]) -- cgit v1.2.1