Skip to content

Commit 9038cc9

Browse files
committed
Builtins fix
Signed-off-by: Aleksander Fadeev <[email protected]>
1 parent 62db4e5 commit 9038cc9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

clang/lib/Sema/SPIRVBuiltins.td

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,12 +727,19 @@ foreach rnd = ["", "_rte", "_rtn", "_rtp", "_rtz"] in {
727727
}
728728
}
729729

730+
<<<<<<< HEAD
730731
foreach IType = TLSignedInts.List in {
731732
foreach FType = TLFloat.List in {
732733
foreach sat = ["", "_sat"] in {
733734
def : SPVBuiltin<"ConvertFToS_R" # IType.Name # sat # rnd, [IType, FType], Attr.Const>;
734735
}
735736
def : SPVBuiltin<"ConvertSToF_R" # FType.Name # rnd, [FType, IType], Attr.Const>;
737+
=======
738+
foreach InType = TLAll.List in {
739+
foreach OutType = TLUnsignedInts.List in {
740+
if !ne(OutType.ElementSize, InType.ElementSize) then {
741+
def : SPVBuiltin<"UConvert_R" # OutType.Name, [OutType, InType], Attr.Const>;
742+
>>>>>>> Builtins fix
736743
foreach v = [2, 3, 4, 8, 16] in {
737744
foreach sat = ["", "_sat"] in {
738745
def : SPVBuiltin<"ConvertFToS_R" # IType.Name # v # sat # rnd,
@@ -745,6 +752,7 @@ foreach rnd = ["", "_rte", "_rtn", "_rtp", "_rtz"] in {
745752
}
746753
}
747754
}
755+
<<<<<<< HEAD
748756

749757
foreach InType = TLFloat.List in {
750758
foreach OutType = TLFloat.List in {
@@ -755,6 +763,15 @@ foreach rnd = ["", "_rte", "_rtn", "_rtp", "_rtz"] in {
755763
[VectorType<OutType, v>, VectorType<InType, v>],
756764
Attr.Const>;
757765
}
766+
=======
767+
foreach OutType = TLSignedInts.List in {
768+
if !ne(OutType.ElementSize, InType.ElementSize) then {
769+
def : SPVBuiltin<"SConvert_R" # OutType.Name, [OutType, InType], Attr.Const>;
770+
foreach v = [2, 3, 4, 8, 16] in {
771+
def : SPVBuiltin<"SConvert_R" # OutType.Name # v,
772+
[VectorType<OutType, v>, VectorType<InType, v>],
773+
Attr.Const>;
774+
>>>>>>> Builtins fix
758775
}
759776
}
760777
}

0 commit comments

Comments
 (0)