Commit bb8b0096 by Richard Earnshaw Committed by Richard Earnshaw

Arm - add speculation_barrier pattern

This patch defines a speculation barrier for AArch32.

	* config/arm/unspecs.md (unspecv): Add VUNSPEC_SPECULATION_BARRIER.
	* config/arm/arm.md (speculation_barrier): New expand.
	(speculation_barrier_insn): New pattern.

From-SVN: r263169
parent 425fc685
2018-07-31 Richard Earnshaw <rearnsha@arm.com> 2018-07-31 Richard Earnshaw <rearnsha@arm.com>
* config/arm/unspecs.md (unspecv): Add VUNSPEC_SPECULATION_BARRIER.
* config/arm/arm.md (speculation_barrier): New expand.
(speculation_barrier_insn): New pattern.
2018-07-31 Richard Earnshaw <rearnsha@arm.com>
* builtin-types.def (BT_FN_PTR_PTR_VAR): New function type. * builtin-types.def (BT_FN_PTR_PTR_VAR): New function type.
(BT_FN_I1_I1_VAR, BT_FN_I2_I2_VAR, BT_FN_I4_I4_VAR): Likewise. (BT_FN_I1_I1_VAR, BT_FN_I2_I2_VAR, BT_FN_I4_I4_VAR): Likewise.
(BT_FN_I8_I8_VAR, BT_FN_I16_I16_VAR): Likewise. (BT_FN_I8_I8_VAR, BT_FN_I16_I16_VAR): Likewise.
......
...@@ -12012,6 +12012,27 @@ ...@@ -12012,6 +12012,27 @@
[(set_attr "length" "4") [(set_attr "length" "4")
(set_attr "type" "coproc")]) (set_attr "type" "coproc")])
(define_expand "speculation_barrier"
[(unspec_volatile [(const_int 0)] VUNSPEC_SPECULATION_BARRIER)]
"TARGET_EITHER"
"
/* Don't emit anything for Thumb1 and suppress the warning from the
generic expansion. */
if (!TARGET_32BIT)
DONE;
"
)
;; Generate a hard speculation barrier when we have not enabled speculation
;; tracking.
(define_insn "*speculation_barrier_insn"
[(unspec_volatile [(const_int 0)] VUNSPEC_SPECULATION_BARRIER)]
"TARGET_32BIT"
"isb\;dsb\\tsy"
[(set_attr "type" "block")
(set_attr "length" "8")]
)
;; Vector bits common to IWMMXT and Neon ;; Vector bits common to IWMMXT and Neon
(include "vec-common.md") (include "vec-common.md")
;; Load the Intel Wireless Multimedia Extension patterns ;; Load the Intel Wireless Multimedia Extension patterns
......
...@@ -168,6 +168,7 @@ ...@@ -168,6 +168,7 @@
VUNSPEC_MCRR2 ; Represent the coprocessor mcrr2 instruction. VUNSPEC_MCRR2 ; Represent the coprocessor mcrr2 instruction.
VUNSPEC_MRRC ; Represent the coprocessor mrrc instruction. VUNSPEC_MRRC ; Represent the coprocessor mrrc instruction.
VUNSPEC_MRRC2 ; Represent the coprocessor mrrc2 instruction. VUNSPEC_MRRC2 ; Represent the coprocessor mrrc2 instruction.
VUNSPEC_SPECULATION_BARRIER ; Represents an unconditional speculation barrier.
]) ])
;; Enumerators for NEON unspecs. ;; Enumerators for NEON unspecs.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment