@@ -1853,92 +1853,201 @@ namespace IGC
1853
1853
ExecSize == EXEC_SIZE_4 || ExecSize == EXEC_SIZE_2 ||
1854
1854
ExecSize == EXEC_SIZE_1);
1855
1855
1856
- VISA_VectorOpnd* S0L = GetSourceOperand (L0, m_encoderState.m_srcOperand [0 ]);
1857
- VISA_VectorOpnd* S0H = GetSourceOperand (H0, m_encoderState.m_srcOperand [1 ]);
1858
- VISA_VectorOpnd* S1L = GetSourceOperand (L1, m_encoderState.m_srcOperand [2 ]);
1859
- VISA_VectorOpnd* L = GetDestinationOperand (Lo, m_encoderState.m_dstOperand );
1860
- VISA_VectorOpnd* H = GetDestinationOperand (Hi, m_encoderState.m_dstOperand );
1861
- VISA_PredOpnd* Pred = GetFlagOperand (m_encoderState.m_flag );
1862
-
1863
- unsigned short NumElems = visaNumLanes (ExecSize);
1864
- CVariable* Carry = m_program->GetNewVariable (NumElems, Lo->GetType (), Lo->GetAlign (), Lo->IsUniform ());
1865
- VISA_VectorOpnd* AccOut = GetDestinationOperand (Carry, m_encoderState.m_dstOperand );
1856
+ if (needsSplitting (ExecSize))
1857
+ {
1858
+ // Have to split it because `acc0` has only 8 elements for 32-bit
1859
+ // integer types.
1860
+ unsigned NumParts = 2 ;
1861
+ VISA_EMask_Ctrl ExecMask = GetAluEMask (Lo);
1862
+ VISA_Exec_Size FromExecSize = GetAluExecSize (Lo);
1863
+ VISA_Exec_Size ToExecSize = SplitExecSize (FromExecSize, NumParts);
1864
+
1865
+ VISA_PredOpnd* Pred = GetFlagOperand (m_encoderState.m_flag );
1866
+ for (unsigned ThePart = 0 ; ThePart != NumParts; ++ThePart) {
1867
+ SModifier NewDstMod = SplitVariable (FromExecSize, ToExecSize, ThePart, Lo, m_encoderState.m_dstOperand );
1868
+ SModifier NewS0LMod = SplitVariable (FromExecSize, ToExecSize, ThePart, L0, m_encoderState.m_srcOperand [0 ], true );
1869
+ SModifier NewS0HMod = SplitVariable (FromExecSize, ToExecSize, ThePart, H0, m_encoderState.m_srcOperand [1 ], true );
1870
+ SModifier NewS1LMod = SplitVariable (FromExecSize, ToExecSize, ThePart, L1, m_encoderState.m_srcOperand [2 ], true );
1871
+
1872
+ VISA_VectorOpnd* S0L = GetSourceOperand (L0, NewS0LMod);
1873
+ VISA_VectorOpnd* S0H = GetSourceOperand (H0, NewS0HMod);
1874
+ VISA_VectorOpnd* S1L = GetSourceOperand (L1, NewS1LMod);
1875
+ VISA_VectorOpnd* L = GetDestinationOperand (Lo, NewDstMod);
1876
+ VISA_VectorOpnd* H = GetDestinationOperand (Hi, NewDstMod);
1877
+ VISA_VectorOpnd* HIn = GetSourceOperand (Hi, NewDstMod);
1878
+
1879
+ unsigned NumElems = 8 ;
1880
+ CVariable* Carry = m_program->GetNewVariable ((uint16_t )NumElems, Lo->GetType (), Lo->GetAlign (), Lo->IsUniform ());
1881
+ VISA_VectorOpnd* AccOut = GetDestinationOperand (Carry, m_encoderState.m_dstOperand );
1882
+ VISA_VectorOpnd* AccIn = GetSourceOperand (Carry, m_encoderState.m_dstOperand );
1883
+
1884
+ VISA_EMask_Ctrl EMask = SplitEMask (FromExecSize, ToExecSize, ThePart, ExecMask);
1885
+ V (vKernel->AppendVISAArithmeticInst (
1886
+ ISA_ADDC, Pred, EMask, ToExecSize,
1887
+ L, AccOut, S0L, S1L));
1888
+
1889
+ if (H1)
1890
+ {
1891
+ SModifier NewS1HMod = SplitVariable (FromExecSize, ToExecSize, ThePart, H1, m_encoderState.m_srcOperand [3 ], true );
1892
+ VISA_VectorOpnd* S1H = GetSourceOperand (H1, NewS1HMod);
1893
+ V (vKernel->AppendVISAArithmeticInst (
1894
+ ISA_ADD, Pred, false , EMask, ToExecSize,
1895
+ H, S0H, S1H));
1896
+ H = GetDestinationOperand (Hi, NewDstMod);
1897
+ V (vKernel->AppendVISAArithmeticInst (
1898
+ ISA_ADD, Pred, false , EMask, ToExecSize,
1899
+ H, AccIn, HIn));
1900
+ }
1901
+ else
1902
+ {
1903
+ V (vKernel->AppendVISAArithmeticInst (
1904
+ ISA_ADD, Pred, false , EMask, ToExecSize,
1905
+ H, AccIn, S0H));
1906
+ }
1866
1907
1867
- SModifier MidMod = m_encoderState.m_dstOperand ;
1868
- if (Lo->IsUniform () && NumElems != 1 ) {
1869
- MidMod.region [0 ] = 1 ;
1870
- MidMod.region [1 ] = 1 ;
1871
- MidMod.region [2 ] = 0 ;
1872
- MidMod.specialRegion = true ;
1908
+ }
1873
1909
}
1874
- VISA_VectorOpnd* HIn = GetSourceOperand (Hi, MidMod);
1875
- VISA_VectorOpnd* AccIn = GetSourceOperand (Carry, MidMod);
1876
-
1877
- VISA_EMask_Ctrl ExecMask = GetAluEMask (Lo);
1878
- V (vKernel->AppendVISAArithmeticInst (
1879
- ISA_ADDC, Pred, ExecMask, ExecSize,
1880
- L, AccOut, S0L, S1L));
1910
+ else {
1911
+ VISA_VectorOpnd* S0L = GetSourceOperand (L0, m_encoderState.m_srcOperand [0 ]);
1912
+ VISA_VectorOpnd* S0H = GetSourceOperand (H0, m_encoderState.m_srcOperand [1 ]);
1913
+ VISA_VectorOpnd* S1L = GetSourceOperand (L1, m_encoderState.m_srcOperand [2 ]);
1914
+ VISA_VectorOpnd* L = GetDestinationOperand (Lo, m_encoderState.m_dstOperand );
1915
+ VISA_VectorOpnd* H = GetDestinationOperand (Hi, m_encoderState.m_dstOperand );
1916
+ VISA_PredOpnd* Pred = GetFlagOperand (m_encoderState.m_flag );
1917
+
1918
+ unsigned short NumElems = (ExecSize == EXEC_SIZE_1) ? 1 :
1919
+ (ExecSize == EXEC_SIZE_2) ? 2 :
1920
+ (ExecSize == EXEC_SIZE_4) ? 4 : 8 ;
1921
+ CVariable* Carry = m_program->GetNewVariable (NumElems, Lo->GetType (), Lo->GetAlign (), Lo->IsUniform ());
1922
+ VISA_VectorOpnd* AccOut = GetDestinationOperand (Carry, m_encoderState.m_dstOperand );
1923
+
1924
+ SModifier MidMod = m_encoderState.m_dstOperand ;
1925
+ if (Lo->IsUniform () && NumElems != 1 ) {
1926
+ MidMod.region [0 ] = 1 ;
1927
+ MidMod.region [1 ] = 1 ;
1928
+ MidMod.region [2 ] = 0 ;
1929
+ MidMod.specialRegion = true ;
1930
+ }
1931
+ VISA_VectorOpnd* HIn = GetSourceOperand (Hi, MidMod);
1932
+ VISA_VectorOpnd* AccIn = GetSourceOperand (Carry, MidMod);
1881
1933
1882
- if (H1)
1883
- {
1884
- VISA_VectorOpnd* S1H = GetSourceOperand (H1, m_encoderState.m_srcOperand [3 ]);
1885
- V (vKernel->AppendVISAArithmeticInst (
1886
- ISA_ADD, Pred, false , ExecMask, ExecSize,
1887
- H, S0H, S1H));
1888
- H = GetDestinationOperand (Hi, m_encoderState.m_dstOperand );
1889
- V (vKernel->AppendVISAArithmeticInst (
1890
- ISA_ADD, Pred, false , ExecMask, ExecSize,
1891
- H, AccIn, HIn));
1892
- }
1893
- else
1894
- {
1934
+ VISA_EMask_Ctrl ExecMask = GetAluEMask (Lo);
1895
1935
V (vKernel->AppendVISAArithmeticInst (
1896
- ISA_ADD, Pred, false , ExecMask, ExecSize,
1897
- H, AccIn, S0H));
1936
+ ISA_ADDC, Pred, ExecMask, ExecSize,
1937
+ L, AccOut, S0L, S1L));
1938
+
1939
+ if (H1)
1940
+ {
1941
+ VISA_VectorOpnd* S1H = GetSourceOperand (H1, m_encoderState.m_srcOperand [3 ]);
1942
+ V (vKernel->AppendVISAArithmeticInst (
1943
+ ISA_ADD, Pred, false , ExecMask, ExecSize,
1944
+ H, S0H, S1H));
1945
+ H = GetDestinationOperand (Hi, m_encoderState.m_dstOperand );
1946
+ V (vKernel->AppendVISAArithmeticInst (
1947
+ ISA_ADD, Pred, false , ExecMask, ExecSize,
1948
+ H, AccIn, HIn));
1949
+ }
1950
+ else
1951
+ {
1952
+ V (vKernel->AppendVISAArithmeticInst (
1953
+ ISA_ADD, Pred, false , ExecMask, ExecSize,
1954
+ H, AccIn, S0H));
1955
+ }
1898
1956
}
1899
1957
}
1900
1958
1901
1959
void CEncoder::SubPair (CVariable* Lo, CVariable* Hi, CVariable* L0, CVariable* H0, CVariable* L1, CVariable* H1) {
1902
- assert (m_encoderState.m_dstOperand .mod == EMOD_NONE && " subPair doesn't support saturate" );
1960
+ assert (m_encoderState.m_dstOperand .mod == EMOD_NONE && " subPair doesn't support saturate" );
1903
1961
1904
- VISA_Exec_Size ExecSize = GetAluExecSize (Lo);
1905
- assert (ExecSize == EXEC_SIZE_32 || ExecSize == EXEC_SIZE_16 || ExecSize == EXEC_SIZE_8 || ExecSize == EXEC_SIZE_1);
1962
+ VISA_Exec_Size ExecSize = GetAluExecSize (Lo);
1963
+ assert (ExecSize == EXEC_SIZE_32 || ExecSize == EXEC_SIZE_16 || ExecSize == EXEC_SIZE_8 || ExecSize == EXEC_SIZE_1);
1906
1964
1907
- if (Hi == nullptr ) {
1908
- // When Hi part is ignored, reduce 64-bit subtraction into 32-bit.
1909
- SetSrcModifier (1 , EMOD_NEG);
1910
- GenericAlu (EOPCODE_ADD, Lo, L0, L1);
1911
- return ;
1912
- }
1965
+ if (Hi == nullptr ) {
1966
+ // When Hi part is ignored, reduce 64-bit subtraction into 32-bit.
1967
+ SetSrcModifier (1 , EMOD_NEG);
1968
+ GenericAlu (EOPCODE_ADD, Lo, L0, L1);
1969
+ return ;
1970
+ }
1913
1971
1914
- if (Lo == nullptr ) {
1915
- // We cannot reduce the strength if only Lo is ignored.
1916
- Lo = m_program->GetNewVariable (Hi->GetNumberElement (), Hi->GetType (), Hi->GetAlign (), Hi->IsUniform ());
1917
- }
1972
+ if (Lo == nullptr ) {
1973
+ // We cannot reduce the strength if only Lo is ignored.
1974
+ Lo = m_program->GetNewVariable (Hi->GetNumberElement (), Hi->GetType (), Hi->GetAlign (), Hi->IsUniform ());
1975
+ }
1918
1976
1919
- // Use `UD` only.
1920
- if (Lo->GetType () != ISA_TYPE_UD && Lo->GetType () != ISA_TYPE_UV) Lo = m_program->BitCast (Lo, ISA_TYPE_UD);
1921
- if (Hi->GetType () != ISA_TYPE_UD && Hi->GetType () != ISA_TYPE_UV) Hi = m_program->BitCast (Hi, ISA_TYPE_UD);
1922
- if (L0->GetType () != ISA_TYPE_UD && L0->GetType () != ISA_TYPE_UV) L0 = m_program->BitCast (L0, ISA_TYPE_UD);
1923
- if (H0->GetType () != ISA_TYPE_UD && H0->GetType () != ISA_TYPE_UV) H0 = m_program->BitCast (H0, ISA_TYPE_UD);
1924
- if (L1->GetType () != ISA_TYPE_UD && L1->GetType () != ISA_TYPE_UV) L1 = m_program->BitCast (L1, ISA_TYPE_UD);
1925
- if (H1->GetType () != ISA_TYPE_UD && H1->GetType () != ISA_TYPE_UV) H1 = m_program->BitCast (H1, ISA_TYPE_UD);
1977
+ // Use `UD` only.
1978
+ if (Lo->GetType () != ISA_TYPE_UD && Lo->GetType () != ISA_TYPE_UV) Lo = m_program->BitCast (Lo, ISA_TYPE_UD);
1979
+ if (Hi->GetType () != ISA_TYPE_UD && Hi->GetType () != ISA_TYPE_UV) Hi = m_program->BitCast (Hi, ISA_TYPE_UD);
1980
+ if (L0->GetType () != ISA_TYPE_UD && L0->GetType () != ISA_TYPE_UV) L0 = m_program->BitCast (L0, ISA_TYPE_UD);
1981
+ if (H0->GetType () != ISA_TYPE_UD && H0->GetType () != ISA_TYPE_UV) H0 = m_program->BitCast (H0, ISA_TYPE_UD);
1982
+ if (L1->GetType () != ISA_TYPE_UD && L1->GetType () != ISA_TYPE_UV) L1 = m_program->BitCast (L1, ISA_TYPE_UD);
1983
+ if (H1->GetType () != ISA_TYPE_UD && H1->GetType () != ISA_TYPE_UV) H1 = m_program->BitCast (H1, ISA_TYPE_UD);
1926
1984
1927
- VISA_VectorOpnd* S0L = GetSourceOperand (L0, m_encoderState.m_srcOperand [0 ]);
1928
- VISA_VectorOpnd* S0H = GetSourceOperand (H0, m_encoderState.m_srcOperand [1 ]);
1929
- VISA_VectorOpnd* S1L = GetSourceOperand (L1, m_encoderState.m_srcOperand [2 ]);
1985
+ if (needsSplitting (ExecSize))
1986
+ {
1987
+ // Have to split it because `acc0` has only 8 elements for 32-bit
1988
+ // integer types.
1989
+ unsigned NumParts = 2 ;
1990
+ VISA_EMask_Ctrl ExecMask = GetAluEMask (Lo);
1991
+ VISA_Exec_Size FromExecSize = GetAluExecSize (Lo);
1992
+ VISA_Exec_Size ToExecSize = SplitExecSize (FromExecSize, NumParts);
1993
+
1994
+ // Negative `S1H`
1995
+ SModifier S1HMod = m_encoderState.m_srcOperand [1 ];
1996
+ assert (S1HMod.mod == EMOD_NONE);
1997
+ S1HMod.mod = EMOD_NEG;
1998
+ VISA_PredOpnd* Pred = GetFlagOperand (m_encoderState.m_flag );
1999
+ for (unsigned ThePart = 0 ; ThePart != NumParts; ++ThePart) {
2000
+ SModifier NewDstMod = SplitVariable (FromExecSize, ToExecSize, ThePart, Lo, m_encoderState.m_dstOperand );
2001
+ SModifier NewS0LMod = SplitVariable (FromExecSize, ToExecSize, ThePart, L0, m_encoderState.m_srcOperand [0 ], true );
2002
+ SModifier NewS0HMod = SplitVariable (FromExecSize, ToExecSize, ThePart, H0, m_encoderState.m_srcOperand [1 ], true );
2003
+ SModifier NewS1LMod = SplitVariable (FromExecSize, ToExecSize, ThePart, L1, m_encoderState.m_srcOperand [2 ], true );
2004
+ SModifier NewS1HMod = SplitVariable (FromExecSize, ToExecSize, ThePart, H1, S1HMod, true );
2005
+ VISA_VectorOpnd* S0L = GetSourceOperand (L0, NewS0LMod);
2006
+ VISA_VectorOpnd* S0H = GetSourceOperand (H0, NewS0HMod);
2007
+ VISA_VectorOpnd* S1L = GetSourceOperand (L1, NewS1LMod);
2008
+ VISA_VectorOpnd* S1H = GetSourceOperand (H1, NewS1HMod);
2009
+ VISA_VectorOpnd* L = GetDestinationOperand (Lo, NewDstMod);
2010
+ VISA_VectorOpnd* H = GetDestinationOperand (Hi, NewDstMod);
2011
+ VISA_VectorOpnd* HIn = GetSourceOperand (Hi, NewDstMod);
2012
+
2013
+ unsigned short NumElems = 8 ;
2014
+ CVariable* Carry = m_program->GetNewVariable (NumElems, Lo->GetType (), Lo->GetAlign (), Lo->IsUniform ());
2015
+ VISA_VectorOpnd* AccOut = GetDestinationOperand (Carry, m_encoderState.m_dstOperand );
2016
+ // Negative `Acc0`
2017
+ SModifier AccMod = m_encoderState.m_dstOperand ;
2018
+ assert (AccMod.mod == EMOD_NONE);
2019
+ AccMod.mod = EMOD_NEG;
2020
+ VISA_VectorOpnd* AccIn = GetSourceOperand (Carry, AccMod);
2021
+
2022
+ VISA_EMask_Ctrl EMask = SplitEMask (FromExecSize, ToExecSize, ThePart, ExecMask);
2023
+ V (vKernel->AppendVISAArithmeticInst (
2024
+ ISA_SUBB, Pred, EMask, ToExecSize,
2025
+ L, AccOut, S0L, S1L));
2026
+ V (vKernel->AppendVISAArithmeticInst (
2027
+ ISA_ADD, Pred, false , EMask, ToExecSize,
2028
+ H, S0H, S1H));
2029
+ H = GetDestinationOperand (Hi, NewDstMod);
2030
+ V (vKernel->AppendVISAArithmeticInst (
2031
+ ISA_ADD, Pred, false , EMask, ToExecSize,
2032
+ H, AccIn, HIn));
2033
+ }
2034
+ }
2035
+ else {
2036
+ VISA_VectorOpnd* S0L = GetSourceOperand (L0, m_encoderState.m_srcOperand [0 ]);
2037
+ VISA_VectorOpnd* S0H = GetSourceOperand (H0, m_encoderState.m_srcOperand [1 ]);
2038
+ VISA_VectorOpnd* S1L = GetSourceOperand (L1, m_encoderState.m_srcOperand [2 ]);
1930
2039
// Negative `S0H`
1931
2040
SModifier S1HMod = m_encoderState.m_srcOperand [1 ];
1932
2041
assert (S1HMod.mod == EMOD_NONE);
1933
2042
S1HMod.mod = EMOD_NEG;
1934
- VISA_VectorOpnd* S1H = GetSourceOperand (H1, S1HMod);
1935
- VISA_VectorOpnd* L = GetDestinationOperand (Lo, m_encoderState.m_dstOperand );
1936
- VISA_VectorOpnd* H = GetDestinationOperand (Hi, m_encoderState.m_dstOperand );
1937
- VISA_PredOpnd* Pred = GetFlagOperand (m_encoderState.m_flag );
2043
+ VISA_VectorOpnd* S1H = GetSourceOperand (H1, S1HMod);
2044
+ VISA_VectorOpnd* L = GetDestinationOperand (Lo, m_encoderState.m_dstOperand );
2045
+ VISA_VectorOpnd* H = GetDestinationOperand (Hi, m_encoderState.m_dstOperand );
2046
+ VISA_PredOpnd* Pred = GetFlagOperand (m_encoderState.m_flag );
1938
2047
1939
- unsigned short NumElems = visaNumLanes (ExecSize) ;
1940
- CVariable* Carry = m_program->GetNewVariable (NumElems, Lo->GetType (), Lo->GetAlign (), Lo->IsUniform ());
1941
- VISA_VectorOpnd* AccOut = GetDestinationOperand (Carry, m_encoderState.m_dstOperand );
2048
+ unsigned short NumElems = (ExecSize == 1 ) ? 1 : 8 ;
2049
+ CVariable* Carry = m_program->GetNewVariable (NumElems, Lo->GetType (), Lo->GetAlign (), Lo->IsUniform ());
2050
+ VISA_VectorOpnd* AccOut = GetDestinationOperand (Carry, m_encoderState.m_dstOperand );
1942
2051
1943
2052
SModifier MidMod = m_encoderState.m_dstOperand ;
1944
2053
if (Lo->IsUniform () && NumElems != 1 ) {
@@ -1947,12 +2056,12 @@ namespace IGC
1947
2056
MidMod.region [2 ] = 0 ;
1948
2057
MidMod.specialRegion = true ;
1949
2058
}
1950
- VISA_VectorOpnd* HIn = GetSourceOperand (Hi, MidMod);
2059
+ VISA_VectorOpnd* HIn = GetSourceOperand (Hi, MidMod);
1951
2060
// Negative `Acc0`
1952
2061
SModifier AccMod = MidMod;
1953
2062
assert (AccMod.mod == EMOD_NONE);
1954
2063
AccMod.mod = EMOD_NEG;
1955
- VISA_VectorOpnd* AccIn = GetSourceOperand (Carry, AccMod);
2064
+ VISA_VectorOpnd* AccIn = GetSourceOperand (Carry, AccMod);
1956
2065
1957
2066
VISA_EMask_Ctrl ExecMask = GetAluEMask (Lo);
1958
2067
V (vKernel->AppendVISAArithmeticInst (
@@ -1966,42 +2075,43 @@ namespace IGC
1966
2075
ISA_ADD, Pred, false , ExecMask, ExecSize,
1967
2076
H, AccIn, HIn));
1968
2077
}
2078
+ }
1969
2079
1970
2080
void CEncoder::CarryBorrowArith (ISA_Opcode opcode, CVariable* dst, CVariable* src0, CVariable* src1)
1971
2081
{
1972
- VISA_VectorOpnd* srcOpnd0 = GetSourceOperand (src0, m_encoderState.m_srcOperand [0 ]);
1973
- VISA_VectorOpnd* srcOpnd1 = GetSourceOperand (src1, m_encoderState.m_srcOperand [1 ]);
1974
- VISA_VectorOpnd* dstOpnd = GetDestinationOperand (dst, m_encoderState.m_dstOperand );
1975
- VISA_PredOpnd* predOpnd = GetFlagOperand (m_encoderState.m_flag );
1976
- SModifier carryOperand = m_encoderState.m_dstOperand ;
1977
- VISA_Exec_Size execSize = GetAluExecSize (dst);
1978
-
1979
- switch (execSize) {
1980
- default :
1981
- assert (false && " Unknown execution size on carry-borrow-arith!" );
1982
- break ;
1983
- case EXEC_SIZE_1:
1984
- carryOperand.subReg += 1 ;
1985
- break ;
1986
- case EXEC_SIZE_8:
1987
- carryOperand.subVar += 1 ;
1988
- break ;
1989
- case EXEC_SIZE_16:
1990
- carryOperand.subVar += 2 ;
1991
- break ;
1992
- }
1993
- VISA_VectorOpnd* carryBorrowOpnd = GetDestinationOperand (dst, carryOperand);
1994
- assert (m_encoderState.m_dstOperand .mod == EMOD_NONE && " addc/subb doesn't support saturate" );
1995
-
1996
- V (vKernel->AppendVISAArithmeticInst (
1997
- opcode,
1998
- predOpnd,
1999
- GetAluEMask (dst),
2000
- GetAluExecSize (dst),
2001
- dstOpnd,
2002
- carryBorrowOpnd,
2003
- srcOpnd0,
2004
- srcOpnd1));
2082
+ VISA_VectorOpnd* srcOpnd0 = GetSourceOperand (src0, m_encoderState.m_srcOperand [0 ]);
2083
+ VISA_VectorOpnd* srcOpnd1 = GetSourceOperand (src1, m_encoderState.m_srcOperand [1 ]);
2084
+ VISA_VectorOpnd* dstOpnd = GetDestinationOperand (dst, m_encoderState.m_dstOperand );
2085
+ VISA_PredOpnd* predOpnd = GetFlagOperand (m_encoderState.m_flag );
2086
+ SModifier carryOperand = m_encoderState.m_dstOperand ;
2087
+ VISA_Exec_Size execSize = GetAluExecSize (dst);
2088
+
2089
+ switch (execSize) {
2090
+ default :
2091
+ assert (false && " Unknown execution size on carry-borrow-arith!" );
2092
+ break ;
2093
+ case EXEC_SIZE_1:
2094
+ carryOperand.subReg += 1 ;
2095
+ break ;
2096
+ case EXEC_SIZE_8:
2097
+ carryOperand.subVar += 1 ;
2098
+ break ;
2099
+ case EXEC_SIZE_16:
2100
+ carryOperand.subVar += 2 ;
2101
+ break ;
2102
+ }
2103
+ VISA_VectorOpnd* carryBorrowOpnd = GetDestinationOperand (dst, carryOperand);
2104
+ assert (m_encoderState.m_dstOperand .mod == EMOD_NONE && " addc/subb doesn't support saturate" );
2105
+
2106
+ V (vKernel->AppendVISAArithmeticInst (
2107
+ opcode,
2108
+ predOpnd,
2109
+ GetAluEMask (dst),
2110
+ GetAluExecSize (dst),
2111
+ dstOpnd,
2112
+ carryBorrowOpnd,
2113
+ srcOpnd0,
2114
+ srcOpnd1));
2005
2115
}
2006
2116
2007
2117
void CEncoder::URBWrite (
0 commit comments