;; Instruction suffix for integer modes.
(define_mode_attr imodesuffix [(QI "b") (HI "w") (SI "l") (DI "q")])
+;; Instruction suffix for masks.
+(define_mode_attr mskmodesuffix [(QI "b") (HI "w") (SI "d") (DI "q")])
+
;; Pointer size prefix for integer modes (Intel asm dialect)
(define_mode_attr iptrsize [(QI "BYTE")
(HI "WORD")
(define_insn "*movdi_internal"
[(set (match_operand:DI 0 "nonimmediate_operand"
- "=r ,o ,r,r ,r,m ,*y,*y,?*y,?m,?r ,?*Ym,*v,*v,*v,m ,?r ,?r,?*Yi,?*Ym,?*Yi")
+ "=r ,o ,r,r ,r,m ,*y,*y,?*y,?m,?r ,?*Ym,*v,*v,*v,m ,?r ,?r,?*Yi,?*Ym,?*Yi,*k,*k ,*r ,*m")
(match_operand:DI 1 "general_operand"
- "riFo,riF,Z,rem,i,re,C ,*y,m ,*y,*Yn,r ,C ,*v,m ,*v,*Yj,*v,r ,*Yj ,*Yn"))]
+ "riFo,riF,Z,rem,i,re,C ,*y,m ,*y,*Yn,r ,C ,*v,m ,*v,*Yj,*v,r ,*Yj ,*Yn ,*r ,*km,*k,*k"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (get_attr_type (insn))
{
+ case TYPE_MSKMOV:
+ return "kmovq\t{%1, %0|%0, %1}";
+
case TYPE_MULTI:
return "#";
[(set (attr "isa")
(cond [(eq_attr "alternative" "0,1")
(const_string "nox64")
- (eq_attr "alternative" "2,3,4,5,10,11,16,18")
+ (eq_attr "alternative" "2,3,4,5,10,11,16,18,21,23")
(const_string "x64")
(eq_attr "alternative" "17")
(const_string "x64_sse4")
(const_string "ssemov")
(eq_attr "alternative" "19,20")
(const_string "ssecvt")
+ (eq_attr "alternative" "21,22,23,24")
+ (const_string "mskmov")
(match_operand 1 "pic_32bit_operand")
(const_string "lea")
]
[(set (match_operand:DI 0 "nonimmediate_operand")
(match_operand:DI 1 "general_operand"))]
"!TARGET_64BIT && reload_completed
- && !(MMX_REG_P (operands[0]) || SSE_REG_P (operands[0]))
- && !(MMX_REG_P (operands[1]) || SSE_REG_P (operands[1]))"
+ && !(MMX_REG_P (operands[0])
+ || SSE_REG_P (operands[0])
+ || MASK_REG_P (operands[0]))
+ && !(MMX_REG_P (operands[1])
+ || SSE_REG_P (operands[1])
+ || MASK_REG_P (operands[1]))"
[(const_int 0)]
"ix86_split_long_move (operands); DONE;")
(define_insn "*movsi_internal"
[(set (match_operand:SI 0 "nonimmediate_operand"
- "=r,m ,*y,*y,?rm,?*y,*v,*v,*v,m ,?r ,?r,?*Yi")
+ "=r,m ,*y,*y,?rm,?*y,*v,*v,*v,m ,?r ,?r,?*Yi,*k ,*rm")
(match_operand:SI 1 "general_operand"
- "g ,re,C ,*y,*y ,rm ,C ,*v,m ,*v,*Yj,*v,r"))]
+ "g ,re,C ,*y,*y ,rm ,C ,*v,m ,*v,*Yj,*v,r ,*krm,*k"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (get_attr_type (insn))
return standard_sse_constant_opcode (insn, operands[1]);
+ case TYPE_MSKMOV:
+ return "kmovd\t{%1, %0|%0, %1}";
+
case TYPE_SSEMOV:
switch (get_attr_mode (insn))
{
(const_string "sselog1")
(eq_attr "alternative" "7,8,9,10,12")
(const_string "ssemov")
+ (eq_attr "alternative" "13,14")
+ (const_string "mskmov")
(match_operand 1 "pic_32bit_operand")
(const_string "lea")
]
case TYPE_MSKMOV:
switch (which_alternative)
{
- case 7: return "kmovw\t{%k1, %0|%0, %k1}";
- case 8: return "kmovw\t{%1, %0|%0, %1}";
- case 9: return "kmovw\t{%1, %k0|%k0, %1}";
+ case 7: return TARGET_AVX512BW ? "kmovb\t{%k1, %0|%0, %k1}"
+ : "kmovw\t{%k1, %0|%0, %k1}";
+ case 8: return TARGET_AVX512BW ? "kmovb\t{%1, %0|%0, %1}"
+ : "kmovw\t{%1, %0|%0, %1}";
+ case 9: return TARGET_AVX512BW ? "kmovb\t{%1, %k0|%k0, %1}"
+ : "kmovw\t{%1, %k0|%k0, %1}";
default: gcc_unreachable ();
}