summaryrefslogtreecommitdiff
path: root/gcc/config/frv/frv.md
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-26 15:41:49 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-26 15:41:49 +0000
commit9f3b67fe3cdb302d35aa0c865805213a3529a104 (patch)
treec953489e8663c24a0dc08d181832b0f04316ac9a /gcc/config/frv/frv.md
parent6c799a83c8fba7edb02964d6925bef201217f8a8 (diff)
downloadgcc-9f3b67fe3cdb302d35aa0c865805213a3529a104.tar.gz
* doc/extend.texi (Raw read/write Functions): New section.
* testsuite/gcc.target/frv/all-builtin-read8.c: New. * testsuite/gcc.target/frv/all-builtin-read16.c: New. * testsuite/gcc.target/frv/all-builtin-read32.c: New. * testsuite/gcc.target/frv/all-builtin-read64.c: New. * testsuite/gcc.target/frv/all-builtin-write8.c: New. * testsuite/gcc.target/frv/all-builtin-write16.c: New. * testsuite/gcc.target/frv/all-builtin-write32.c: New. * testsuite/gcc.target/frv/all-builtin-write64.c: New. * config/frv/frv.c: Add bdesc_loads global. Add bdesc_stores global. (frv_init_builtins): Add support for __builtin_{read/write}*. (frv_volatile_memref): New. (frv_expand_load_builtin): New. (frv_expand_store_builtin): New. * config/frv/frv.h (frv_builtins): Add FRV_BUILTIN_SCAN, FRV_BUILTIN_READ8, FRV_BUILTIN_READ16, FRV_BUILTIN_READ32, FRV_BUILTIN_READ64, FRV_BUILTIN_WRITE8, FRV_BUILTIN_WRITE16, FRV_BUILTIN_WRITE32, FRV_BUILTIN_WRITE64. * config/frv/frv.md (unspecs): Add UNSPEC_BUILTIN_LOAD, UNSPEC_BUILTIN_STORE, UNSPEC_OPTIONAL_MEMBAR. (builtin_read_<mode>): New. (builtin_write_<mode>): New. (builtin_write64): New. (optional_membar_<mode>): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102388 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/frv/frv.md')
-rw-r--r--gcc/config/frv/frv.md45
1 files changed, 44 insertions, 1 deletions
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index b8c37c51ed3..5b744bbc523 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -41,6 +41,9 @@
(UNSPEC_EH_RETURN_EPILOGUE 6)
(UNSPEC_GOT 7)
(UNSPEC_LDD 8)
+ (UNSPEC_BUILTIN_LOAD 9)
+ (UNSPEC_BUILTIN_STORE 10)
+ (UNSPEC_OPTIONAL_MEMBAR 11)
(UNSPEC_GETTLSOFF 200)
(UNSPEC_TLS_LOAD_GOTTLSOFF12 201)
@@ -86,7 +89,9 @@
(FDPIC_REG 15)
])
-
+(define_mode_macro IMODE [QI HI SI DI])
+(define_mode_attr IMODEsuffix [(QI "b") (HI "h") (SI "") (DI "d")])
+(define_mode_attr BREADsuffix [(QI "ub") (HI "uh") (SI "") (DI "d")])
;; ::::::::::::::::::::
;; ::
@@ -2162,7 +2167,45 @@
else
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")])
+
+(define_insn "optional_membar_<mode>"
+ [(set (match_operand:IMODE 0 "memory_operand" "=m")
+ (unspec:IMODE [(const_int 0)] UNSPEC_OPTIONAL_MEMBAR))]
+ ""
+ "membar"
+ [(set_attr "length" "4")])
;; ::::::::::::::::::::
;; ::