}
})
+;; Unsigned conversion to DImode
+
+(define_insn "fixuns_trunc<mode>di2"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unsigned_fix:DI
+ (match_operand:MODEF 1 "nonimmediate_operand" "vm")))]
+ "TARGET_64BIT && TARGET_AVX512F && TARGET_SSE_MATH"
+ "vcvtt<ssemodesuffix>2usi\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "evex")
+ (set_attr "mode" "DI")])
+
;; Unsigned conversion to SImode.
(define_expand "fixuns_trunc<mode>si2"
(use (match_dup 2))
(clobber (match_scratch:<ssevecmode> 3))
(clobber (match_scratch:<ssevecmode> 4))])]
- "!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH"
+ "(!TARGET_64BIT || TARGET_AVX512F) && TARGET_SSE2 && TARGET_SSE_MATH"
{
machine_mode mode = <MODE>mode;
machine_mode vecmode = <ssevecmode>mode;
REAL_VALUE_TYPE TWO31r;
rtx two31;
+ if (TARGET_AVX512F)
+ {
+ emit_insn (gen_fixuns_trunc<mode>si2_avx512f (operands[0], operands[1]));
+ DONE;
+ }
+
if (optimize_insn_for_size_p ())
FAIL;
operands[2] = force_reg (vecmode, two31);
})
+(define_insn "fixuns_trunc<mode>si2_avx512f"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unsigned_fix:SI
+ (match_operand:MODEF 1 "nonimmediate_operand" "vm")))]
+ "TARGET_AVX512F && TARGET_SSE_MATH"
+ "vcvtt<ssemodesuffix>2usi\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "evex")
+ (set_attr "mode" "SI")])
+
+(define_insn "*fixuns_trunc<mode>si2_avx512f_zext"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI
+ (unsigned_fix:SI
+ (match_operand:MODEF 1 "nonimmediate_operand" "vm"))))]
+ "TARGET_64BIT && TARGET_AVX512F"
+ "vcvtt<ssemodesuffix>2usi\t{%1, %k0|%k0, %1}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "evex")
+ (set_attr "mode" "SI")])
+
(define_insn_and_split "*fixuns_trunc<mode>_1"
[(set (match_operand:SI 0 "register_operand" "=&x,&x")
(unsigned_fix:SI
DONE;
})
+(define_insn "*floatuns<SWI48:mode><MODEF:mode>2_avx512"
+ [(set (match_operand:MODEF 0 "register_operand" "=v")
+ (unsigned_float:MODEF
+ (match_operand:SWI48 1 "nonimmediate_operand" "rm")))]
+ "TARGET_AVX512F && TARGET_SSE_MATH"
+ "vcvtusi2<MODEF:ssemodesuffix><SWI48:rex64suffix>\t{%1, %0, %0|%0, %0, %1}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "evex")
+ (set_attr "mode" "<MODEF:MODE>")])
+
;; Avoid store forwarding (partial memory) stall penalty by extending
;; SImode value to DImode through XMM register instead of pushing two
;; SImode values to stack. Also note that fild loads from memory only.
-(define_insn_and_split "*floatunssi<mode>2_i387_with_xmm"
+(define_insn_and_split "floatunssi<mode>2_i387_with_xmm"
[(set (match_operand:X87MODEF 0 "register_operand" "=f")
(unsigned_float:X87MODEF
(match_operand:SI 1 "nonimmediate_operand" "rm")))
- (clobber (match_scratch:DI 3 "=x"))
- (clobber (match_operand:DI 2 "memory_operand" "=m"))]
+ (clobber (match_operand:DI 2 "memory_operand" "=m"))
+ (clobber (match_scratch:DI 3 "=x"))]
"!TARGET_64BIT
&& TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
&& TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_TO_VEC"
(set_attr "mode" "<MODE>")])
(define_expand "floatunssi<mode>2"
- [(parallel
- [(set (match_operand:X87MODEF 0 "register_operand")
- (unsigned_float:X87MODEF
- (match_operand:SI 1 "nonimmediate_operand")))
- (clobber (match_scratch:DI 3))
- (clobber (match_dup 2))])]
- "!TARGET_64BIT
- && ((TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
- && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_TO_VEC)
- || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))"
+ [(set (match_operand:X87MODEF 0 "register_operand")
+ (unsigned_float:X87MODEF
+ (match_operand:SI 1 "nonimmediate_operand")))]
+ "(!TARGET_64BIT
+ && TARGET_80387 && X87_ENABLE_FLOAT (<X87MODEF:MODE>mode, DImode)
+ && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES_TO_VEC)
+ || ((!TARGET_64BIT || TARGET_AVX512F)
+ && SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
{
- if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)
+ if (!(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH))
+ {
+ emit_insn (gen_floatunssi<mode>2_i387_with_xmm
+ (operands[0], operands[1],
+ assign_386_stack_local (DImode, SLOT_TEMP)));
+ DONE;
+ }
+ if (!TARGET_AVX512F)
{
ix86_expand_convert_uns_si<mode>_sse (operands[0], operands[1]);
DONE;
}
- else
- operands[2] = assign_386_stack_local (DImode, SLOT_TEMP);
})
(define_expand "floatunsdisf2"
- [(use (match_operand:SF 0 "register_operand"))
- (use (match_operand:DI 1 "nonimmediate_operand"))]
+ [(set (match_operand:SF 0 "register_operand")
+ (unsigned_float:SF
+ (match_operand:DI 1 "nonimmediate_operand")))]
"TARGET_64BIT && TARGET_SSE && TARGET_SSE_MATH"
- "x86_emit_floatuns (operands); DONE;")
+{
+ if (!TARGET_AVX512F)
+ {
+ x86_emit_floatuns (operands);
+ DONE;
+ }
+})
(define_expand "floatunsdidf2"
- [(use (match_operand:DF 0 "register_operand"))
- (use (match_operand:DI 1 "nonimmediate_operand"))]
- "(TARGET_64BIT || TARGET_KEEPS_VECTOR_ALIGNED_STACK)
+ [(set (match_operand:DF 0 "register_operand")
+ (unsigned_float:DF
+ (match_operand:DI 1 "nonimmediate_operand")))]
+ "(TARGET_KEEPS_VECTOR_ALIGNED_STACK || TARGET_AVX512F)
&& TARGET_SSE2 && TARGET_SSE_MATH"
{
- if (TARGET_64BIT)
- x86_emit_floatuns (operands);
- else
- ix86_expand_convert_uns_didf_sse (operands[0], operands[1]);
- DONE;
+ if (!TARGET_64BIT)
+ {
+ ix86_expand_convert_uns_didf_sse (operands[0], operands[1]);
+ DONE;
+ }
+ if (!TARGET_AVX512F)
+ {
+ x86_emit_floatuns (operands);
+ DONE;
+ }
})
\f
;; Load effective address instructions