summaryrefslogtreecommitdiff
path: root/gcc/config/i386/i386.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r--gcc/config/i386/i386.md215
1 files changed, 20 insertions, 195 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 8178f9b9ab0..6976124d4a8 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -63,7 +63,6 @@
;; ~ -- print "i" if TARGET_AVX2, "f" otherwise.
;; @ -- print a segment register of thread base pointer load
;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
-;; ! -- print MPX prefix for jxx/call/ret instructions if required.
(define_c_enum "unspec" [
;; Relocation specifiers
@@ -179,16 +178,6 @@
;; For BMI2 support
UNSPEC_PDEP
UNSPEC_PEXT
-
- UNSPEC_BNDMK
- UNSPEC_BNDMK_ADDR
- UNSPEC_BNDSTX
- UNSPEC_BNDLDX
- UNSPEC_BNDLDX_ADDR
- UNSPEC_BNDCL
- UNSPEC_BNDCU
- UNSPEC_BNDCN
- UNSPEC_MPX_FENCE
])
(define_c_enum "unspecv" [
@@ -353,8 +342,6 @@
(MASK5_REG 74)
(MASK6_REG 75)
(MASK7_REG 76)
- (BND0_REG 77)
- (BND1_REG 78)
])
;; Insns whose names begin with "x86_" are emitted by gen_FOO calls
@@ -389,8 +376,7 @@
ssecvt,ssecvt1,sseicvt,sseins,
sseshuf,sseshuf1,ssemuladd,sse4arg,
lwp,mskmov,msklog,
- mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft,
- mpxmov,mpxmk,mpxchk,mpxld,mpxst"
+ mmx,mmxmov,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft"
(const_string "other"))
;; Main data type used by the insn
@@ -419,8 +405,7 @@
;; The (bounding maximum) length of an instruction immediate.
(define_attr "length_immediate" ""
(cond [(eq_attr "type" "incdec,setcc,icmov,str,lea,other,multi,idiv,leave,
- bitmanip,imulx,msklog,mskmov,mpxmk,mpxmov,mpxchk,
- mpxld,mpxst")
+ bitmanip,imulx,msklog,mskmov")
(const_int 0)
(eq_attr "unit" "i387,sse,mmx")
(const_int 0)
@@ -475,17 +460,13 @@
(const_int 0)
(and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF"))
(const_int 1)
- (and (eq_attr "type" "ibr,call,callv")
- (match_test "ix86_bnd_prefixed_insn_p (insn)"))
- (const_int 1)
]
(const_int 0)))
;; Set when 0f opcode prefix is used.
(define_attr "prefix_0f" ""
(if_then_else
- (ior (eq_attr "type" "imovx,setcc,icmov,bitmanip,msklog,mskmov,
- mpxmk,mpxmov,mpxchk,mpxld,mpxst")
+ (ior (eq_attr "type" "imovx,setcc,icmov,bitmanip,msklog,mskmov")
(eq_attr "unit" "sse,mmx"))
(const_int 1)
(const_int 0)))
@@ -588,19 +569,12 @@
]
(const_int 1)))
-;; When this attribute is set, calculate total insn length from
-;; length_nobnd attribute, prefixed with eventual bnd prefix byte
-(define_attr "length_nobnd" "" (const_int 0))
-
;; The (bounding maximum) length of an instruction in bytes.
;; ??? fistp and frndint are in fact fldcw/{fistp,frndint}/fldcw sequences.
;; Later we may want to split them and compute proper length as for
;; other insns.
(define_attr "length" ""
- (cond [(eq_attr "length_nobnd" "!0")
- (plus (symbol_ref ("ix86_bnd_prefixed_insn_p (insn)"))
- (attr "length_nobnd"))
- (eq_attr "type" "other,multi,fistp,frndint")
+ (cond [(eq_attr "type" "other,multi,fistp,frndint")
(const_int 16)
(eq_attr "type" "fcmp")
(const_int 4)
@@ -641,16 +615,12 @@
(define_attr "memory" "none,load,store,both,unknown"
(cond [(eq_attr "type" "other,multi,str,lwp")
(const_string "unknown")
- (eq_attr "type" "lea,fcmov,fpspc,mpxmk,mpxchk")
+ (eq_attr "type" "lea,fcmov,fpspc")
(const_string "none")
(eq_attr "type" "fistp,leave")
(const_string "both")
(eq_attr "type" "frndint")
(const_string "load")
- (eq_attr "type" "mpxld")
- (const_string "load")
- (eq_attr "type" "mpxst")
- (const_string "store")
(eq_attr "type" "push")
(if_then_else (match_operand 1 "memory_operand")
(const_string "both")
@@ -696,7 +666,7 @@
fmov,fcmp,fsgn,
sse,ssemov,ssecmp,ssecomi,ssecvt,ssecvt1,sseicvt,
sselog1,sseshuf1,sseadd1,sseiadd1,sseishft1,
- mmx,mmxmov,mmxcmp,mmxcvt,mskmov,msklog,mpxmov")
+ mmx,mmxmov,mmxcmp,mmxcvt,mskmov,msklog")
(match_operand 2 "memory_operand"))
(const_string "load")
(and (eq_attr "type" "icmov,ssemuladd,sse4arg")
@@ -935,21 +905,6 @@
(define_mode_iterator DWIH [(SI "!TARGET_64BIT")
(DI "TARGET_64BIT")])
-;; Bound modes.
-(define_mode_iterator BND [(BND32 "!TARGET_LP64")
- (BND64 "TARGET_LP64")])
-
-;; Pointer mode corresponding to bound mode.
-(define_mode_attr bnd_ptr [(BND32 "SI") (BND64 "DI")])
-
-;; MPX check types
-(define_int_iterator BNDCHECK [UNSPEC_BNDCL UNSPEC_BNDCU UNSPEC_BNDCN])
-
-;; Check name
-(define_int_attr bndcheck [(UNSPEC_BNDCL "cl")
- (UNSPEC_BNDCU "cu")
- (UNSPEC_BNDCN "cn")])
-
;; Instruction suffix for integer modes.
(define_mode_attr imodesuffix [(QI "b") (HI "w") (SI "l") (DI "q")])
@@ -10799,10 +10754,10 @@
(label_ref (match_operand 0))
(pc)))]
""
- "%!%+j%C1\t%l0"
+ "%+j%C1\t%l0"
[(set_attr "type" "ibr")
(set_attr "modrm" "0")
- (set (attr "length_nobnd")
+ (set (attr "length")
(if_then_else (and (ge (minus (match_dup 0) (pc))
(const_int -126))
(lt (minus (match_dup 0) (pc))
@@ -10817,10 +10772,10 @@
(pc)
(label_ref (match_operand 0))))]
""
- "%!%+j%c1\t%l0"
+ "%+j%c1\t%l0"
[(set_attr "type" "ibr")
(set_attr "modrm" "0")
- (set (attr "length_nobnd")
+ (set (attr "length")
(if_then_else (and (ge (minus (match_dup 0) (pc))
(const_int -126))
(lt (minus (match_dup 0) (pc))
@@ -11283,9 +11238,9 @@
[(set (pc)
(label_ref (match_operand 0)))]
""
- "%!jmp\t%l0"
+ "jmp\t%l0"
[(set_attr "type" "ibr")
- (set (attr "length_nobnd")
+ (set (attr "length")
(if_then_else (and (ge (minus (match_dup 0) (pc))
(const_int -126))
(lt (minus (match_dup 0) (pc))
@@ -11305,7 +11260,7 @@
(define_insn "*indirect_jump"
[(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))]
""
- "%!jmp\t%A0"
+ "jmp\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -11354,7 +11309,7 @@
[(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))
(use (label_ref (match_operand 1)))]
""
- "%!jmp\t%A0"
+ "jmp\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -11741,8 +11696,8 @@
(define_insn "simple_return_internal"
[(simple_return)]
"reload_completed"
- "%!ret"
- [(set_attr "length_nobnd" "1")
+ "ret"
+ [(set_attr "length" "1")
(set_attr "atom_unit" "jeu")
(set_attr "length_immediate" "0")
(set_attr "modrm" "0")])
@@ -11754,12 +11709,7 @@
[(simple_return)
(unspec [(const_int 0)] UNSPEC_REP)]
"reload_completed"
-{
- if (ix86_bnd_prefixed_insn_p (insn))
- return "%!ret";
-
- return "rep%; ret";
-}
+ "rep%; ret"
[(set_attr "length" "2")
(set_attr "atom_unit" "jeu")
(set_attr "length_immediate" "0")
@@ -11770,8 +11720,8 @@
[(simple_return)
(use (match_operand:SI 0 "const_int_operand"))]
"reload_completed"
- "%!ret\t%0"
- [(set_attr "length_nobnd" "3")
+ "ret\t%0"
+ [(set_attr "length" "3")
(set_attr "atom_unit" "jeu")
(set_attr "length_immediate" "2")
(set_attr "modrm" "0")])
@@ -11780,7 +11730,7 @@
[(simple_return)
(use (match_operand:SI 0 "register_operand" "r"))]
"reload_completed"
- "%!jmp\t%A0"
+ "jmp\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -18333,131 +18283,6 @@
[(set_attr "type" "other")
(set_attr "length" "3")])
-;; MPX instructions
-
-(define_expand "<mode>_mk"
- [(set (match_operand:BND 0 "register_operand")
- (unspec:BND
- [(mem:<bnd_ptr>
- (match_par_dup 3
- [(match_operand:<bnd_ptr> 1 "register_operand")
- (match_operand:<bnd_ptr> 2 "address_mpx_no_base_operand")]))]
- UNSPEC_BNDMK))]
- "TARGET_MPX"
-{
- operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[1],
- operands[2]),
- UNSPEC_BNDMK_ADDR);
-})
-
-(define_insn "*<mode>_mk"
- [(set (match_operand:BND 0 "register_operand" "=B")
- (unspec:BND
- [(match_operator:<bnd_ptr> 3 "bnd_mem_operator"
- [(unspec:<bnd_ptr>
- [(match_operand:<bnd_ptr> 1 "register_operand" "r")
- (match_operand:<bnd_ptr> 2 "address_mpx_no_base_operand" "Tb")]
- UNSPEC_BNDMK_ADDR)])]
- UNSPEC_BNDMK))]
- "TARGET_MPX"
- "bndmk\t{%3, %0|%0, %3}"
- [(set_attr "type" "mpxmk")])
-
-(define_expand "mov<mode>"
- [(set (match_operand:BND 0 "general_operand")
- (match_operand:BND 1 "general_operand"))]
- "TARGET_MPX"
-{
- ix86_expand_move (<MODE>mode, operands);DONE;
-})
-
-(define_insn "*mov<mode>_internal_mpx"
- [(set (match_operand:BND 0 "nonimmediate_operand" "=B,m")
- (match_operand:BND 1 "general_operand" "Bm,B"))]
- "TARGET_MPX"
- "bndmov\t{%1, %0|%0, %1}"
- [(set_attr "type" "mpxmov")])
-
-(define_expand "<mode>_<bndcheck>"
- [(parallel [(unspec [(match_operand:BND 0 "register_operand")
- (match_operand:<bnd_ptr> 1 "address_no_seg_operand")] BNDCHECK)
- (set (match_dup 2)
- (unspec:BLK [(match_dup 2)] UNSPEC_MPX_FENCE))])]
- "TARGET_MPX"
-{
- operands[2] = gen_rtx_MEM (BLKmode, operands[1]);
- MEM_VOLATILE_P (operands[2]) = 1;
-})
-
-(define_insn "*<mode>_<bndcheck>"
- [(parallel [(unspec [(match_operand:BND 0 "register_operand" "B")
- (match_operand:<bnd_ptr> 1 "address_no_seg_operand" "Ts")] BNDCHECK)
- (set (match_operand:BLK 2 "bnd_mem_operator")
- (unspec:BLK [(match_dup 2)] UNSPEC_MPX_FENCE))])]
- "TARGET_MPX"
- "bnd<bndcheck>\t{%a1, %0|%0, %a1}"
- [(set_attr "type" "mpxchk")])
-
-(define_expand "<mode>_ldx"
- [(parallel [(set:BND (match_operand:BND 0 "register_operand")
- (unspec:BND
- [(mem:<bnd_ptr>
- (match_par_dup 3
- [(match_operand:<bnd_ptr> 1 "address_mpx_no_index_operand")
- (match_operand:<bnd_ptr> 2 "register_operand")]))]
- UNSPEC_BNDLDX))
- (use (mem:BLK (match_dup 1)))])]
- "TARGET_MPX"
-{
- operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[1],
- operands[2]),
- UNSPEC_BNDLDX_ADDR);
-})
-
-(define_insn "*<mode>_ldx"
- [(parallel [(set:BND (match_operand:BND 0 "register_operand" "=B")
- (unspec:BND
- [(match_operator:<bnd_ptr> 3 "bnd_mem_operator"
- [(unspec:<bnd_ptr>
- [(match_operand:<bnd_ptr> 1 "address_mpx_no_index_operand" "Ti")
- (match_operand:<bnd_ptr> 2 "register_operand" "l")]
- UNSPEC_BNDLDX_ADDR)])]
- UNSPEC_BNDLDX))
- (use (mem:BLK (match_dup 1)))])]
- "TARGET_MPX"
- "bndldx\t{%3, %0|%0, %3}"
- [(set_attr "type" "mpxld")])
-
-(define_expand "<mode>_stx"
- [(parallel [(unspec [(mem:<bnd_ptr>
- (match_par_dup 3
- [(match_operand:<bnd_ptr> 0 "address_mpx_no_index_operand")
- (match_operand:<bnd_ptr> 1 "register_operand")]))
- (match_operand:BND 2 "register_operand")] UNSPEC_BNDSTX)
- (set (match_dup 4)
- (unspec:BLK [(match_dup 4)] UNSPEC_MPX_FENCE))])]
- "TARGET_MPX"
-{
- operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[0],
- operands[1]),
- UNSPEC_BNDLDX_ADDR);
- operands[4] = gen_rtx_MEM (BLKmode, operands[0]);
- MEM_VOLATILE_P (operands[4]) = 1;
-})
-
-(define_insn "*<mode>_stx"
- [(parallel [(unspec [(match_operator:<bnd_ptr> 3 "bnd_mem_operator"
- [(unspec:<bnd_ptr>
- [(match_operand:<bnd_ptr> 0 "address_mpx_no_index_operand" "Ti")
- (match_operand:<bnd_ptr> 1 "register_operand" "l")]
- UNSPEC_BNDLDX_ADDR)])
- (match_operand:BND 2 "register_operand" "B")] UNSPEC_BNDSTX)
- (set (match_operand:BLK 4 "bnd_mem_operator")
- (unspec:BLK [(match_dup 4)] UNSPEC_MPX_FENCE))])]
- "TARGET_MPX"
- "bndstx\t{%2, %3|%3, %2}"
- [(set_attr "type" "mpxst")])
-
(include "mmx.md")
(include "sse.md")
(include "sync.md")