(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))]
+ (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);
+ UNSPEC_BNDMK_ADDR);
})
(define_insn "*<mode>_mk"
[(set (match_operand:BND 0 "register_operand" "=w")
- (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))]
+ (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"))]
+ (match_operand:BND 1 "general_operand"))]
"TARGET_MPX"
-{
- ix86_expand_move (<MODE>mode, operands);DONE;
-})
+ "ix86_expand_move (<MODE>mode, operands); DONE;")
(define_insn "*mov<mode>_internal_mpx"
[(set (match_operand:BND 0 "nonimmediate_operand" "=w,m")
- (match_operand:BND 1 "general_operand" "wm,w"))]
+ (match_operand:BND 1 "general_operand" "wm,w"))]
"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))])]
+ [(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]);
})
(define_insn "*<mode>_<bndcheck>"
- [(parallel [(unspec [(match_operand:BND 0 "register_operand" "w")
- (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))])]
+ [(unspec
+ [(match_operand:BND 0 "register_operand" "w")
+ (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 (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)))])]
+ [(parallel
+ [(set (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"
{
- /* Avoid registers which connot be used as index. */
+ /* Avoid registers which cannot be used as index. */
if (!index_register_operand (operands[2], Pmode))
- {
- rtx temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, operands[2]);
- operands[2] = temp;
- }
-
- /* If it was a register originally then it may have
- mode other than Pmode. We need to extend in such
- case because bndldx may work only with Pmode regs. */
- if (GET_MODE (operands[2]) != Pmode)
- operands[2] = ix86_zero_extend_to_Pmode (operands[2]);
+ operands[2] = copy_addr_to_reg (operands[2]);
operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[1],
- operands[2]),
+ operands[2]),
UNSPEC_BNDLDX_ADDR);
})
(define_insn "*<mode>_ldx"
- [(parallel [(set (match_operand:BND 0 "register_operand" "=w")
- (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)))])]
+ [(set (match_operand:BND 0 "register_operand" "=w")
+ (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))])]
+ [(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"
{
- /* Avoid registers which connot be used as index. */
+ /* Avoid registers which cannot be used as index. */
if (!index_register_operand (operands[1], Pmode))
- {
- rtx temp = gen_reg_rtx (Pmode);
- emit_move_insn (temp, operands[1]);
- operands[1] = temp;
- }
-
- /* If it was a register originally then it may have
- mode other than Pmode. We need to extend in such
- case because bndstx may work only with Pmode regs. */
- if (GET_MODE (operands[1]) != Pmode)
- operands[1] = ix86_zero_extend_to_Pmode (operands[1]);
+ operands[1] = copy_addr_to_reg (operands[1]);
operands[3] = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, operands[0],
- operands[1]),
+ 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" "w")] UNSPEC_BNDSTX)
- (set (match_operand:BLK 4 "bnd_mem_operator")
- (unspec:BLK [(match_dup 4)] UNSPEC_MPX_FENCE))])]
+ [(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" "w")]
+ 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")])
(define_insn "move_size_reloc_<mode>"
[(set (match_operand:SWI48 0 "register_operand" "=r")
- (unspec:SWI48
- [(match_operand:SWI48 1 "symbol_operand")]
- UNSPEC_SIZEOF))]
+ (unspec:SWI48
+ [(match_operand:SWI48 1 "symbol_operand")]
+ UNSPEC_SIZEOF))]
"TARGET_MPX"
{
if (x86_64_immediate_size_operand (operands[1], VOIDmode))