Commit 06bc9e41 by Alexander Ivchenko Committed by Kirill Yukhin

i386.c (ix86_print_operand): Print EVEX's RC modifiers.

        * config/i386/i386.c (ix86_print_operand): Print EVEX's RC modifiers.
        * config/i386/i386.md (define_constants): Define EVEx's RC constants.
        * gcc/config/i386/sse.md (<plusminus_insn><mode>3<mask_name>): Extend
        to support EVEX's rounding control.
        (*<plusminus_insn><mode>3<mask_name>): Ditto.
        (mul<mode>3<mask_name>): Ditto.
        (*mul<mode>3<mask_name>): Ditto.
        (<sse>_div<mode>3<mask_name>): Ditto.
        (<sse>_sqrt<mode>2<mask_name>): Ditto.
        (<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name>): Ditto.
        (avx512f_fmadd_<mode>_mask): Ditto.
        (avx512f_fmadd_<mode>_mask3): Ditto.
        (<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name>): Ditto.
        (avx512f_fmsub_<mode>_mask): Ditto.
        (avx512f_fmsub_<mode>_mask3): Ditto.
        (<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name>): Ditto.
        (avx512f_fnmadd_<mode>_mask): Ditto.
        (avx512f_fnmadd_<mode>_mask3): Ditto.
        (<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name>): Ditto.
        (avx512f_fnmsub_<mode>_mask): Ditto.
        (avx512f_fnmsub_<mode>_mask3): Ditto.
        (<sd_mask_codefor>fma_fmaddsub_<mode><sd_maskz_name>): Ditto.
        (avx512f_fmaddsub_<mode>_mask): Ditto.
        (avx512f_fmaddsub_<mode>_mask3): Ditto.
        (<sd_mask_codefor>fma_fmsubadd_<mode><sd_maskz_name>): Ditto.
        (avx512f_fmsubadd_<mode>_mask): Ditto.
        (avx512f_fmsubadd_<mode>_mask3): Ditto.
        (fmai_vmfmadd_<mode>): Ditto.
        (*fmai_fmadd_<mode>): Ditto.
        (*fmai_fmsub_<mode>): Ditto.
        (*fmai_fnmadd_<mode>): Ditto.
        (*fmai_fnmsub_<mode>): Ditto.
        (sse_cvtsi2ss): Ditto.
        (sse_cvtsi2ssq): Ditto.
        (sse_cvtss2si): Ditto.
        (sse_cvtss2siq): Ditto.
        (cvtusi2<ssescalarmodesuffix>32): Ditto.
        (cvtusi2<ssescalarmodesuffix>64): Ditto.
        (float<sseintvecmodelower><mode>2<mask_name>): Ditto.
        (ufloatv16siv16sf2<mask_name>): Ditto.
        (<mask_codefor>avx512f_fix_notruncv16sfv16si<mask_name>): Ditto.
        (<mask_codefor>avx512f_ufix_notruncv16sfv16si<mask_name>): Ditto.
        (sse2_cvtsi2sdq): Ditto.
        (avx512f_vcvtss2usi): Ditto.
        (avx512f_vcvtss2usiq): Ditto.
        (avx512f_vcvtsd2usi): Ditto.
        (avx512f_vcvtsd2usiq): Ditto.
        (sse2_cvtsd2si): Ditto.
        (sse2_cvtsd2siq): Ditto.
        (<mask_codefor>avx512f_cvtpd2dq512<mask_name>): Ditto.
        (avx512f_ufix_notruncv8dfv8si<mask_name>): Ditto.
        (<mask_codefor>avx512f_cvtpd2ps512<mask_name>): Ditto.
        (avx512f_scalef<mode><mask_name>): Ditto.
        (<code><mode>3<mask_name>): Ditto.
        (*avx2_<code><mode>3<mask_name>): Ditto.
        (avx512er_exp2<mode><mask_name): Ditto.
        (<mask_codefor>avx512er_rcp28<mode><mask_name>): Ditto.
        (<mask_codefor>avx512er_rsqrt28<mode><mask_name>): Ditto.
        (avx512f_fmadd_<mode>_maskz): New.
        * config/i386/subst.md (SUBST_A): New.
        (round_name): Ditto.
        (round_mask_operand2): Ditto.
        (round_mask_operand3): Ditto.
        (round_mask_scalar_operand3): Ditto.
        (round_sd_mask_operand4): Ditto.
        (round_op2): Ditto.
        (round_op3): Ditto.
        (round_op4): Ditto.
        (round_op5): Ditto.
        (round_op6): Ditto.
        (round_mask_op2): Ditto.
        (round_mask_op3): Ditto.
        (round_mask_scalar_op3): Ditto.
        (round_sd_mask_op4): Ditto.
        (round_constraint): Ditto.
        (round_constraint2): Ditto.
        (round_constraint3): Ditto.
        (round_nimm_predicate): Ditto.
        (round_mode512bit_condition): Ditto.
        (round_modev4sf_condition): Ditto.
        (round_codefor): Ditto.
        (round_opnum): Ditto.
        (round): Ditto.


Co-Authored-By: Andrey Turetskiy <andrey.turetskiy@intel.com>
Co-Authored-By: Anna Tikhonova <anna.tikhonova@intel.com>
Co-Authored-By: Ilya Tocar <ilya.tocar@intel.com>
Co-Authored-By: Ilya Verbin <ilya.verbin@intel.com>
Co-Authored-By: Kirill Yukhin <kirill.yukhin@intel.com>
Co-Authored-By: Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Co-Authored-By: Michael Zolotukhin <michael.v.zolotukhin@intel.com>
Co-Authored-By: Sergey Lega <sergey.s.lega@intel.com>

From-SVN: r206220
parent 4085fae0
2013-12-27 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Sergey Lega <sergey.s.lega@intel.com>
Anna Tikhonova <anna.tikhonova@intel.com>
Ilya Tocar <ilya.tocar@intel.com>
Andrey Turetskiy <andrey.turetskiy@intel.com>
Ilya Verbin <ilya.verbin@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
Michael Zolotukhin <michael.v.zolotukhin@intel.com>
* config/i386/i386.c (ix86_print_operand): Print EVEX's RC modifiers.
* config/i386/i386.md (define_constants): Define EVEx's RC constants.
* gcc/config/i386/sse.md (<plusminus_insn><mode>3<mask_name>): Extend
to support EVEX's rounding control.
(*<plusminus_insn><mode>3<mask_name>): Ditto.
(mul<mode>3<mask_name>): Ditto.
(*mul<mode>3<mask_name>): Ditto.
(<sse>_div<mode>3<mask_name>): Ditto.
(<sse>_sqrt<mode>2<mask_name>): Ditto.
(<sd_mask_codefor>fma_fmadd_<mode><sd_maskz_name>): Ditto.
(avx512f_fmadd_<mode>_mask): Ditto.
(avx512f_fmadd_<mode>_mask3): Ditto.
(<sd_mask_codefor>fma_fmsub_<mode><sd_maskz_name>): Ditto.
(avx512f_fmsub_<mode>_mask): Ditto.
(avx512f_fmsub_<mode>_mask3): Ditto.
(<sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name>): Ditto.
(avx512f_fnmadd_<mode>_mask): Ditto.
(avx512f_fnmadd_<mode>_mask3): Ditto.
(<sd_mask_codefor>fma_fnmsub_<mode><sd_maskz_name>): Ditto.
(avx512f_fnmsub_<mode>_mask): Ditto.
(avx512f_fnmsub_<mode>_mask3): Ditto.
(<sd_mask_codefor>fma_fmaddsub_<mode><sd_maskz_name>): Ditto.
(avx512f_fmaddsub_<mode>_mask): Ditto.
(avx512f_fmaddsub_<mode>_mask3): Ditto.
(<sd_mask_codefor>fma_fmsubadd_<mode><sd_maskz_name>): Ditto.
(avx512f_fmsubadd_<mode>_mask): Ditto.
(avx512f_fmsubadd_<mode>_mask3): Ditto.
(fmai_vmfmadd_<mode>): Ditto.
(*fmai_fmadd_<mode>): Ditto.
(*fmai_fmsub_<mode>): Ditto.
(*fmai_fnmadd_<mode>): Ditto.
(*fmai_fnmsub_<mode>): Ditto.
(sse_cvtsi2ss): Ditto.
(sse_cvtsi2ssq): Ditto.
(sse_cvtss2si): Ditto.
(sse_cvtss2siq): Ditto.
(cvtusi2<ssescalarmodesuffix>32): Ditto.
(cvtusi2<ssescalarmodesuffix>64): Ditto.
(float<sseintvecmodelower><mode>2<mask_name>): Ditto.
(ufloatv16siv16sf2<mask_name>): Ditto.
(<mask_codefor>avx512f_fix_notruncv16sfv16si<mask_name>): Ditto.
(<mask_codefor>avx512f_ufix_notruncv16sfv16si<mask_name>): Ditto.
(sse2_cvtsi2sdq): Ditto.
(avx512f_vcvtss2usi): Ditto.
(avx512f_vcvtss2usiq): Ditto.
(avx512f_vcvtsd2usi): Ditto.
(avx512f_vcvtsd2usiq): Ditto.
(sse2_cvtsd2si): Ditto.
(sse2_cvtsd2siq): Ditto.
(<mask_codefor>avx512f_cvtpd2dq512<mask_name>): Ditto.
(avx512f_ufix_notruncv8dfv8si<mask_name>): Ditto.
(<mask_codefor>avx512f_cvtpd2ps512<mask_name>): Ditto.
(avx512f_scalef<mode><mask_name>): Ditto.
(<code><mode>3<mask_name>): Ditto.
(*avx2_<code><mode>3<mask_name>): Ditto.
(avx512er_exp2<mode><mask_name): Ditto.
(<mask_codefor>avx512er_rcp28<mode><mask_name>): Ditto.
(<mask_codefor>avx512er_rsqrt28<mode><mask_name>): Ditto.
(avx512f_fmadd_<mode>_maskz): New.
* config/i386/subst.md (SUBST_A): New.
(round_name): Ditto.
(round_mask_operand2): Ditto.
(round_mask_operand3): Ditto.
(round_mask_scalar_operand3): Ditto.
(round_sd_mask_operand4): Ditto.
(round_op2): Ditto.
(round_op3): Ditto.
(round_op4): Ditto.
(round_op5): Ditto.
(round_op6): Ditto.
(round_mask_op2): Ditto.
(round_mask_op3): Ditto.
(round_mask_scalar_op3): Ditto.
(round_sd_mask_op4): Ditto.
(round_constraint): Ditto.
(round_constraint2): Ditto.
(round_constraint3): Ditto.
(round_nimm_predicate): Ditto.
(round_mode512bit_condition): Ditto.
(round_modev4sf_condition): Ditto.
(round_codefor): Ditto.
(round_opnum): Ditto.
(round): Ditto.
2013-12-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/59588
......@@ -14990,6 +14990,38 @@ ix86_print_operand (FILE *file, rtx x, int code)
fputs ("{z}", file);
return;
case 'R':
gcc_assert (CONST_INT_P (x));
if (ASSEMBLER_DIALECT == ASM_INTEL)
fputs (", ", file);
switch (INTVAL (x))
{
case ROUND_NEAREST_INT:
fputs ("{rn-sae}", file);
break;
case ROUND_NEG_INF:
fputs ("{rd-sae}", file);
break;
case ROUND_POS_INF:
fputs ("{ru-sae}", file);
break;
case ROUND_ZERO:
fputs ("{rz-sae}", file);
break;
case ROUND_SAE:
fputs ("{sae}", file);
break;
default:
gcc_unreachable ();
}
if (ASSEMBLER_DIALECT == ASM_ATT)
fputs (", ", file);
return;
case '*':
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('*', file);
......@@ -241,6 +241,16 @@
(ROUND_NO_EXC 0x8)
])
;; Constants to represent AVX512F embeded rounding
(define_constants
[(ROUND_NEAREST_INT 0)
(ROUND_NEG_INF 1)
(ROUND_POS_INF 2)
(ROUND_ZERO 3)
(NO_ROUND 4)
(ROUND_SAE 5)
])
;; Constants to represent pcomtrue/pcomfalse variants
(define_constants
[(PCOM_FALSE 0)
......
......@@ -30,6 +30,16 @@
(define_mode_iterator SUBST_S
[QI HI SI DI])
(define_mode_iterator SUBST_A
[V16QI
V16HI V8HI
V16SI V8SI V4SI
V8DI V4DI V2DI
V16SF V8SF V4SF
V8DF V4DF V2DF
QI HI SI DI SF DF
CCFP CCFPU])
(define_subst_attr "mask_name" "mask" "" "_mask")
(define_subst_attr "mask_applied" "mask" "false" "true")
(define_subst_attr "mask_operand2" "mask" "" "%{%3%}%N2")
......@@ -87,3 +97,35 @@
(match_operand:SUBST_V 2 "const0_operand" "C")
(match_operand:<avx512fmaskmode> 3 "register_operand" "k")))
])
(define_subst_attr "round_name" "round" "" "_round")
(define_subst_attr "round_mask_operand2" "mask" "%R2" "%R4")
(define_subst_attr "round_mask_operand3" "mask" "%R3" "%R5")
(define_subst_attr "round_mask_scalar_operand3" "mask_scalar" "%R3" "%R5")
(define_subst_attr "round_sd_mask_operand4" "sd" "%R4" "%R6")
(define_subst_attr "round_op2" "round" "" "%R2")
(define_subst_attr "round_op3" "round" "" "%R3")
(define_subst_attr "round_op4" "round" "" "%R4")
(define_subst_attr "round_op5" "round" "" "%R5")
(define_subst_attr "round_op6" "round" "" "%R6")
(define_subst_attr "round_mask_op2" "round" "" "<round_mask_operand2>")
(define_subst_attr "round_mask_op3" "round" "" "<round_mask_operand3>")
(define_subst_attr "round_mask_scalar_op3" "round" "" "<round_mask_scalar_operand3>")
(define_subst_attr "round_sd_mask_op4" "round" "" "<round_sd_mask_operand4>")
(define_subst_attr "round_constraint" "round" "vm" "v")
(define_subst_attr "round_constraint2" "round" "m" "v")
(define_subst_attr "round_constraint3" "round" "rm" "r")
(define_subst_attr "round_nimm_predicate" "round" "nonimmediate_operand" "register_operand")
(define_subst_attr "round_mode512bit_condition" "round" "1" "(GET_MODE (operands[0]) == V16SFmode || GET_MODE (operands[0]) == V8DFmode)")
(define_subst_attr "round_modev4sf_condition" "round" "1" "(GET_MODE (operands[0]) == V4SFmode)")
(define_subst_attr "round_codefor" "round" "*" "")
(define_subst_attr "round_opnum" "round" "5" "6")
(define_subst "round"
[(set (match_operand:SUBST_A 0)
(match_operand:SUBST_A 1))]
"TARGET_AVX512F"
[(parallel[
(set (match_dup 0)
(match_dup 1))
(unspec [(match_operand:SI 2 "const_0_to_4_operand")] UNSPEC_EMBEDDED_ROUNDING)])])
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