\newabbreviationstyle{pf-long-short}{
  \glsxtrAccSuppAbbrSetFirstLongAttrs\glscategorylabel
  \renewcommand*{\CustomAbbreviationFields}{%
    name={\glsxtrlongshortname},
    sort={\the\glsshorttok},
    first={\protect\glsfirstlongemfont{\the\glslongtok}%
     \protect\glsxtrfullsep{\the\glslabeltok}%
     \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshorttok}}},%
    firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}%
     \protect\glsxtrfullsep{\the\glslabeltok}%
     \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshortpltok}}},%
    text={\protect\glsabbrvfont{\the\glsshorttok}},%
    plural={\protect\glsabbrvfont{\the\glsshortpltok}},%
    description={\protect\glslongfont{\the\glslongtok}},
    user1={\protect\index{\the\glslongtok\space(\the\glsshorttok)%
      @\makefirstuc{\the\glslongtok}\space(\the\glsshorttok)}},%
    user2={\protect\index{\the\glslongtok\space(\the\glsshorttok)%
      @\makefirstuc{\the\glslongtok}\space[\the\glsshorttok]}},%
    user3={\protect\index{\the\glslongtok\space(\the\glsshorttok)%
      @\makefirstuc{\the\glslongtok}\space<\the\glsshorttok>}}%
  }%
  \renewcommand*{\GlsXtrPostNewAbbreviation}{%
    \glshasattribute{\the\glslabeltok}{regular}%
    {%
      \glssetattribute{\the\glslabeltok}{regular}{false}%
    }%
    {}%
  }%
}%
{%
%  \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbvpluralsuffix}%
%  \renewcommand*{\glsabbrvfont}[1]{\glsabbrvemfont{##1}}%
%  \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}%
  \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}%
%  \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}%
  \renewcommand*{\glsxtrfullformat}[2]{%
    \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi
    \glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}%
  }%
  \renewcommand*{\glsxtrfullplformat}[2]{%
    \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}%
  }%
  \renewcommand*{\Glsxtrfullformat}[2]{%
    \glsfirstlongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}%
  }%
  \renewcommand*{\Glsxtrfullplformat}[2]{%
    \glsfirstlongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}%
  }%
  \renewcommand{\glsxtrprelocation}{,\space}%
}

\newabbreviationstyle{pf-long-short-mod}{
  \glsxtrAccSuppAbbrSetFirstLongAttrs\glscategorylabel
  \renewcommand*{\CustomAbbreviationFields}{%
    name={\glsxtrlongshortname},
    sort={\the\glsshorttok},
    first={\protect\glsfirstlongemfont{\the\glslongtok}%
     \protect\glsxtrfullsep{\the\glslabeltok}%
     \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshorttok}}},%
    firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}%
     \protect\glsxtrfullsep{\the\glslabeltok}%
     \glsxtrparen{\protect\glsfirstabbrvfont{\the\glsshortpltok}}},%
    text={\protect\glsabbrvfont{\the\glsshorttok}},%
    plural={\protect\glsabbrvfont{\the\glsshortpltok}},%
    description={\protect\glslongfont{\the\glslongtok}}
  }%
  \renewcommand*{\GlsXtrPostNewAbbreviation}{%
    \glshasattribute{\the\glslabeltok}{regular}%
    {%
      \glssetattribute{\the\glslabeltok}{regular}{false}%
    }%
    {}%
  }%
}%
{%
%  \renewcommand*{\abbrvpluralsuffix}{\glsxtrabbvpluralsuffix}%
%  \renewcommand*{\glsabbrvfont}[1]{\glsabbrvemfont{##1}}%
%  \renewcommand*{\glsfirstabbrvfont}[1]{\glsfirstabbrvemfont{##1}}%
  \renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}%
%  \renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}%
  \renewcommand*{\glsxtrfullformat}[2]{%
    \glsfirstlongfont{\glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi
    \glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}%
  }%
  \renewcommand*{\glsxtrfullplformat}[2]{%
    \glsfirstlongfont{\glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}%
  }%
  \renewcommand*{\Glsxtrfullformat}[2]{%
    \glsfirstlongfont{\Glsaccesslong{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshort{##1}}}%
  }%
  \renewcommand*{\Glsxtrfullplformat}[2]{%
    \glsfirstlongfont{\Glsaccesslongpl{##1}\ifglsxtrinsertinside##2\fi}%
    \ifglsxtrinsertinside\else##2\fi\glsxtrfullsep{##1}%
    \glsxtrparen{\glsfirstabbrvfont{\glsaccessshortpl{##1}}}%
  }%
  \renewcommand{\glsxtrprelocation}{,\space}%
}

\setabbreviationstyle[acronym]{pf-long-short}
\setabbreviationstyle{pf-long-short-mod}

\IfIndexOn{
\newcommand{\acr}[1]{\gls{#1}} % print acronym via dictionary
\newcommand{\acrpl}[1]{\glspl{#1}} % print acronym via dictionary (plural)
\newcommand{\Acr}[1]{\Gls{#1}} % print acronym via dictionary (upper case)
\newcommand{\Acrpl}[1]{\Glspl{#1}} % print acronym via dictionary (upper case, plural)
\newcommand{\acrl}[1]{\glsxtrlong{#1}} % print acronym via dictionary (long form)
\newcommand{\acrlpl}[1]{\glsxtrlongpl{#1}} % print acronym via dictionary (long form, plural)
\newcommand{\Acrl}[1]{\Glsxtrlong{#1}} % print acronym via dictionary (long form, upper case)
\newcommand{\Acrlpl}[1]{\Glsxtrlongpl{#1}} % print acronym via dictionary (long form, upper case, plural)
\newcommand{\acrf}[1]{\glsxtrlong{#1} (\glsxtrshort{#1})} % print acronym via dictionary (full form)
\newcommand{\acrfpl}[1]{\glsxtrlongpl{#1} (\glsxtrshortpl{#1})} % print acronym via dictionary (full form, plural)
\newcommand{\Acrf}[1]{\Glsxtrlong{#1} (\glsxtrshort{#1})} % print acronym via dictionary (full form, upper case)
\newcommand{\Acrfpl}[1]{\Glsxtrlongpl{#1} (\glsxtrshortpl{#1})} % print acronym via dictionary (full form, upper case, plural)
\newcommand{\acrfst}[1]{\glsreset{#1}\gls{#1}} % print acronym via dictionary (first form)
\newcommand{\acrfstpl}[1]{\glsreset{#1}\glspl{#1}} % print acronym via dictionary (first form, plural)
\newcommand{\Acrfst}[1]{\glsreset{#1}\Gls{#1}} % print acronym via dictionary (first form, upper case)
\newcommand{\Acrfstpl}[1]{\glsreset{#1}\Glspl{#1}} % print acronym via dictionary (first form, upper case, plural)
\newcommand{\acrm}[1]{\gls{#1}} % print acronym via dictionary
\newcommand{\acrmpl}[1]{\glspl{#1}} % print acronym via dictionary (plural)
\newcommand{\Acrm}[1]{\Gls{#1}} % print acronym via dictionary (upper case)
\newcommand{\Acrmpl}[1]{\Glspl{#1}} % print acronym via dictionary (upper case, prural)
\newcommand{\acrml}[1]{\glsxtrlong*{#1:m}} % print acronym via dictionary (long form)
\newcommand{\acrmlpl}[1]{\glsxtrlongpl*{#1:m}} % print acronym via dictionary (long form, plural)
\newcommand{\Acrml}[1]{\Glsxtrlong*{#1:m}} % print acronym via dictionary (long form, upper case)
\newcommand{\Acrmlpl}[1]{\Glsxtrlongpl*{#1:m}} % print acronym via dictionary (long form, upper case, plural)
\newcommand{\acrmf}[1]{\glsxtrlong*{#1:m} (\glsxtrshort{#1})} % print acronym via dictionary (full form)
\newcommand{\acrmfpl}[1]{\glsxtrlongpl*{#1:m} (\glsxtrshortpl{#1})} % print acronym via dictionary (full form, plural)
\newcommand{\Acrmf}[1]{\Glsxtrlong*{#1:m} (\glsxtrshort{#1})} % print acronym via dictionary (full form, upper case)
\newcommand{\Acrmfpl}[1]{\Glsxtrlongpl*{#1:m} (\glsxtrshortpl{#1})} % print acronym via dictionary (full form, upper case, plural)
\newcommand{\acrmfst}[1]{\emph{\glsxtrlong*{#1:m}} (\glsxtrshort{#1})} % print acronym via dictionary (first form)
\newcommand{\acrmfstpl}[1]{\emph{\glsxtrlongpl*{#1:m}} (\glsxtrshort{#1})} % print acronym via dictionary (first form, plural)
\newcommand{\Acrmfst}[1]{\emph{\Glsxtrlong*{#1:m}} (\glsxtrshort{#1})} % print acronym via dictionary (first form, upper case)
\newcommand{\Acrmfstpl}[1]{\emph{\Glsxtrlongpl*{#1:m}} (\glsxtrshort{#1})} % print acronym via dictionary (first form, upper case, plural)
}{
\newcommand{\acr}[1]{\gls*{#1}} % print acronym via dictionary
\newcommand{\acrpl}[1]{\glspl*{#1}} % print acronym via dictionary (plural)
\newcommand{\Acr}[1]{\Gls*{#1}} % print acronym via dictionary (upper case)
\newcommand{\Acrpl}[1]{\Glspl*{#1}} % print acronym via dictionary (upper case, prural)
\newcommand{\acrl}[1]{\glsxtrlong*{#1}} % print acronym via dictionary (long form)
\newcommand{\acrlpl}[1]{\glsxtrlongpl*{#1}} % print acronym via dictionary (long form, plural)
\newcommand{\Acrl}[1]{\Glsxtrlong*{#1}} % print acronym via dictionary (long form, upper case)
\newcommand{\Acrlpl}[1]{\Glsxtrlongpl*{#1}} % print acronym via dictionary (long form, upper case, plural)
\newcommand{\acrf}[1]{\glsxtrlong*{#1} (\glsxtrshort*{#1})} % print acronym via dictionary (full form)
\newcommand{\acrfpl}[1]{\glsxtrlongpl*{#1} (\glsxtrshortpl*{#1})} % print acronym via dictionary (full form, plural)
\newcommand{\Acrf}[1]{\Glsxtrlong*{#1} (\glsxtrshort*{#1})} % print acronym via dictionary (full form, upper case)
\newcommand{\Acrfpl}[1]{\Glsxtrlongpl*{#1} (\glsxtrshortpl*{#1})} % print acronym via dictionary (full form, upper case, plural)
\newcommand{\acrfst}[1]{\glsreset{#1}\gls*{#1}} % print acronym via dictionary (first form)
\newcommand{\acrfstpl}[1]{\glsreset{#1}\glspl*{#1}} % print acronym via dictionary (first form, plural)
\newcommand{\Acrfst}[1]{\glsreset{#1}\Gls*{#1}} % print acronym via dictionary (first form, upper case)
\newcommand{\Acrfstpl}[1]{\glsreset{#1}\Glspl*{#1}} % print acronym via dictionary (first form, upper case, plural)
\newcommand{\acrm}[1]{\acr{#1}} % print acronym via dictionary
\newcommand{\acrmpl}[1]{\acrpl{#1}} % print acronym via dictionary (plural)
\newcommand{\Acrm}[1]{\Acr{#1}} % print acronym via dictionary (upper case)
\newcommand{\Acrmpl}[1]{\Acrpl{#1}} % print acronym via dictionary (upper case, prural)
\newcommand{\acrml}[1]{\acrl{#1:m}} % print acronym via dictionary (long form)
\newcommand{\acrmlpl}[1]{\acrlpl{#1:m}} % print acronym via dictionary (long form, plural)
\newcommand{\Acrml}[1]{\Acrl{#1:m}} % print acronym via dictionary (long form, upper case)
\newcommand{\Acrmlpl}[1]{\Acrlpl{#1:m}} % print acronym via dictionary (long form, upper case, plural)
\newcommand{\acrmf}[1]{\acrf{#1:m}} % print acronym via dictionary (full form)
\newcommand{\acrmfpl}[1]{\acrfpl{#1:m}} % print acronym via dictionary (full form, plural)
\newcommand{\Acrmf}[1]{\Acrf{#1:m}} % print acronym via dictionary (full form, upper case)
\newcommand{\Acrmfpl}[1]{\Acrfpl{#1:m}} % print acronym via dictionary (full form, upper case, plural)
\newcommand{\acrmfst}[1]{\acrfst{#1:m}} % print acronym via dictionary (first form)
\newcommand{\acrmfstpl}[1]{\acrfstpl{#1:m}} % print acronym via dictionary (first form, plural)
\newcommand{\Acrmfst}[1]{\Acrfst{#1:m}} % print acronym via dictionary (first form, upper case)
\newcommand{\Acrmfstpl}[1]{\Acrfstpl{#1:m}} % print acronym via dictionary (first form, upper case, plural)
}

\newcommand{\IXacr}[1]{\glsuseri{#1}\acr{#1}} % put index via acronym dictionary
\newcommand{\IXBacr}[1]{\glsuserii{#1}\acr{#1}} % put index via acronym dictionary
\newcommand{\IXGacr}[1]{\glsuseriii{#1}\acr{#1}} % put index via acronym dictionary
\newcommand{\IXacrpl}[1]{\glsuseri{#1}\acrpl{#1}} % put index via acronym dictionary (plural)
\newcommand{\IXAcr}[1]{\glsuseri{#1}\Acr{#1}} % put index via acronym dictionary (upper case)
\newcommand{\IXAcrpl}[1]{\glsuseri{#1}\Acrpl{#1}} % put index via acronym dictionary (upper case, plural)
\newcommand{\IXacrl}[1]{\glsuseri{#1}\acrl{#1}} % put index via acronym dictionary (long form)
\newcommand{\IXacrlpl}[1]{\glsuseri{#1}\acrlpl{#1}} % put index via acronym dictionary (long form, plural, plural)
\newcommand{\IXAcrl}[1]{\glsuseri{#1}\Acrl{#1}} % put index via acronym dictionary (long form, upper case)
\newcommand{\IXAcrlpl}[1]{\glsuseri{#1}\Acrlpl{#1}} % put index via acronym dictionary (long form, upper case, plural)
\newcommand{\IXacrf}[1]{\glsuseri{#1}\acrf{#1}} % put index via acronym dictionary (full form)
\newcommand{\IXacrfpl}[1]{\glsuseri{#1}\acrfpl{#1}} % put index via acronym dictionary (full form, plural)
\newcommand{\IXAcrf}[1]{\glsuseri{#1}\Acrf{#1}} % put index via acronym dictionary (full form, upper case)
\newcommand{\IXAcrfpl}[1]{\glsuseri{#1}\Acrfpl{#1}} % put index via acronym dictionary (full form, upper case, plural)
\newcommand{\IXacrfst}[1]{\glsuseri{#1}\acrfst{#1}} % put index via acronym dictionary (first form)
\newcommand{\IXBacrfst}[1]{\glsuserii{#1}\acrfst{#1}} % put index via acronym dictionary (first form)
\newcommand{\IXGacrfst}[1]{\glsuseriii{#1}\acrfst{#1}} % put index via acronym dictionary (first form)
\newcommand{\IXacrfstpl}[1]{\glsuseri{#1}\acrfstpl{#1}} % put index via acronym dictionary (first form, plural)
\newcommand{\IXAcrfst}[1]{\glsuseri{#1}\Acrfst{#1}} % put index via acronym dictionary (first form, upper case)
\newcommand{\IXAcrfstpl}[1]{\glsuseri{#1}\Acrfstpl{#1}} % put index via acronym dictionary (first form, upper case, plural)
\newcommand{\IXacrm}[1]{\glsuseri{#1}\acrm{#1}} % put index via acronym dictionary
\newcommand{\IXacrmpl}[1]{\glsuseri{#1}\acrmpl{#1}} % put index via acronym dictionary (plural)
\newcommand{\IXAcrm}[1]{\glsuseri{#1}\Acrm{#1}} % put index via acronym dictionary (upper case)
\newcommand{\IXAcrmpl}[1]{\glsuseri{#1}\Acrmpl{#1}} % put index via acronym dictionary (upper case, plural)
\newcommand{\IXacrml}[1]{\glsuseri{#1}\acrml{#1}} % put index via acronym dictionary (long form)
\newcommand{\IXacrmlpl}[1]{\glsuseri{#1}\acrmlpl{#1}} % put index via acronym dictionary (long form, plural, plural)
\newcommand{\IXAcrml}[1]{\glsuseri{#1}\Acrml{#1}} % put index via acronym dictionary (long form, upper case)
\newcommand{\IXAcrmlpl}[1]{\glsuseri{#1}\Acrmlpl{#1}} % put index via acronym dictionary (long form, upper case, plural)
\newcommand{\IXacrmf}[1]{\glsuseri{#1}\acrmf{#1}} % put index via acronym dictionary (full form)
\newcommand{\IXacrmfpl}[1]{\glsuseri{#1}\acrmfpl{#1}} % put index via acronym dictionary (full form, plural)
\newcommand{\IXAcrmf}[1]{\glsuseri{#1}\Acrmf{#1}} % put index via acronym dictionary (full form, upper case)
\newcommand{\IXAcrmfpl}[1]{\glsuseri{#1}\Acrmfpl{#1}} % put index via acronym dictionary (full form, upper case, plural)
\newcommand{\IXacrmfst}[1]{\glsuseri{#1}\acrmfst{#1}} % put index via acronym dictionary (first form)
\newcommand{\IXacrmfstpl}[1]{\glsuseri{#1}\acrmfstpl{#1}} % put index via acronym dictionary (first form, plural)
\newcommand{\IXAcrmfst}[1]{\glsuseri{#1}\Acrmfst{#1}} % put index via acronym dictionary (first form, upper case)
\newcommand{\IXAcrmfstpl}[1]{\glsuseri{#1}\Acrmfstpl{#1}} % put index via acronym dictionary (first form, upper case, plural)
\newcommand{\IXaltacr}[2]{\glsuseri{#2}\hlindex{#1}} % put index of acronym #2 to alternative string (#1)

\newacronym{cas}{CAS}{compare and swap}
\newabbreviation{cas:m}{CAS}{compare-and-swap}
\newacronym{cbmc}{CBMC}{C~bounded model checker}
\newacronym{dcas}{DCAS}{double compare-and-swap}
\newabbreviation{dcas:m}{DCAS}{double-compare-and-swap}
\newacronym{dsp}{DSP}{digital signal processor}
\newacronym{ebr}{EBR}{epoch-based reclamation}
\newacronym{fpga}{FPGA}{field\-/programmable gate array}
\newacronym{gpgpu}{GPGPU}{general\-/purpose graphical processing unit}
\newacronym{irq}{IRQ}{interrupt request}
\newacronym{ipi}{IPI}{inter\-/processor interrupt}
\newacronym{kcsan}{KCSAN}{kernel concurrency sanitizer}
\newacronym{lkmm}{LKMM}{Linux kernel memory consistency model}
\newacronym{mpi}{MPI}{Message Passing Interface}
\newacronym{nbs}{NBS}{non-blocking synchronization}
\newacronym{nmi}{NMI}{non-maskable interrupt}
\newacronym{nuca}{NUCA}{non-uniform cache architecture}
\newacronym{numa}{NUMA}{non-uniform memory architecture}
\newacronym{qsbr}{QSBR}{quiescent-state-based reclamation}
\newabbreviation{qsbr:m}{QSBR}{quiescent-state-based-reclamation}
\newacronym{raii}{RAII}{resource acquisition is initialization}
\newabbreviation{raii:m}{RAII}{resource-acquisition-is-initialization}
\newacronym{rcu}{RCU}{read-copy update}
\newacronym{smp}{SMP}{symmetric multiprocessing}
\newabbreviation{smp:m}{SMP}{symmetric-multiprocessing}
\newacronym{sql}{SQL}{Structured Query Language}
\newacronym{tle}{TLE}{transactional lock elision}
\newacronym{tm}{TM}{transactional memory}
\newacronym{htm}{HTM}{hardware transactional memory}
\newacronym{stm}{STM}{software transactional memory}
\newacronym{upc}{UPC}{Universal Parallel~C}
\newacronym{utm}{UTM}{unbounded transactional memory}
\newabbreviation{utm:m}{UTM}{unbounded-transactional-memory}

\glsunsetall

\makeglossaries
