aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorHongyu Wang <hongyu.wang@intel.com>2024-03-27 10:13:06 +0800
committerHongyu Wang <hongyu.wang@intel.com>2024-06-06 15:29:47 +0800
commitc989e59fc99d994159114304d4e715c72bedff0a (patch)
tree553ff405899e51cfced83dddde5b1fa6ab48ed04 /libgfortran
parentf46d54a2a76acb94356989fb187853e5b58c3098 (diff)
downloadgcc-c989e59fc99d994159114304d4e715c72bedff0a.zip
gcc-c989e59fc99d994159114304d4e715c72bedff0a.tar.gz
gcc-c989e59fc99d994159114304d4e715c72bedff0a.tar.bz2
[APX CCMP] Support APX CCMP
APX CCMP feature implements conditional compare which executes compare when EFLAGS matches certain condition. CCMP introduces default flags value (dfv), when conditional compare does not execute, it will directly set the flags according to dfv. The instruction goes like ccmpeq {dfv=sf,of,cf,zf} %rax, %r16 For this instruction, it will test EFLAGS regs if it matches conditional code EQ, if yes, compare %rax and %r16 like legacy cmp. If no, the EFLAGS will be updated according to dfv, which means SF,OF,CF,ZF are set. PF will be set according to CF in dfv, and AF will always be cleared. The dfv part can be a combination of sf,of,cf,zf, like {dfv=cf,zf} which sets CF and ZF only and clear others, or {dfv=} which clears all EFLAGS. To enable CCMP, we implemented the target hook TARGET_GEN_CCMP_FIRST and TARGET_GEN_CCMP_NEXT to reuse the current ccmp infrastructure. Also we extended the cstorem4 optab to support storing different CCmode to fit current ccmp infrasturcture. gcc/ChangeLog: * config/i386/i386-expand.cc (ix86_gen_ccmp_first): New function that test if the first compare can be generated. (ix86_gen_ccmp_next): New function to emit a simgle compare and ccmp sequence. * config/i386/i386-opts.h (enum apx_features): Add apx_ccmp. * config/i386/i386-protos.h (ix86_gen_ccmp_first): New proto declare. (ix86_gen_ccmp_next): Likewise. (ix86_get_flags_cc): Likewise. * config/i386/i386.cc (ix86_flags_cc): New enum. (ix86_ccmp_dfv_mapping): New string array to map conditional code to dfv. (ix86_print_operand): Handle special dfv flag for CCMP. (ix86_get_flags_cc): New function to return x86 CC enum. (TARGET_GEN_CCMP_FIRST): Define. (TARGET_GEN_CCMP_NEXT): Likewise. * config/i386/i386.h (TARGET_APX_CCMP): Define. * config/i386/i386.md (@ccmp<mode>): New define_insn to support ccmp. (UNSPEC_APX_DFV): New unspec for ccmp dfv. (ALL_CC): New mode iterator. (cstorecc4): Change to ... (cstore<mode>4) ... this, use ALL_CC to loop through all available CCmodes. * config/i386/i386.opt (apx_ccmp): Add enum value for ccmp. gcc/testsuite/ChangeLog: * gcc.target/i386/apx-ccmp-1.c: New compile test. * gcc.target/i386/apx-ccmp-2.c: New runtime test.
Diffstat (limited to 'libgfortran')
0 files changed, 0 insertions, 0 deletions