ahatanak created this revision. ahatanak added reviewers: nemanjai, ayartsev. ahatanak added a project: clang. Herald added subscribers: ributzka, dexonsmith, jkorous. ahatanak requested review of this revision.
Guard the AltiVec vector variables with `#ifdef __VEC__` and remove the last line, which doesn't compile. rdar://problem/34411929 Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88863 Files: clang/docs/LanguageExtensions.rst Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -452,12 +452,13 @@ v4si vsi = (v4si){1, 2, 3, 4}; float4 vf = (float4)(1.0f, 2.0f, 3.0f, 4.0f); + #ifdef __VEC__ vector int vi1 = (vector int)(1); // vi1 will be (1, 1, 1, 1). vector int vi2 = (vector int){1}; // vi2 will be (1, 0, 0, 0). vector int vi3 = (vector int)(1, 2); // error vector int vi4 = (vector int){1, 2}; // vi4 will be (1, 2, 0, 0). vector int vi5 = (vector int)(1, 2, 3, 4); - float4 vf = (float4)((float2)(1.0f, 2.0f), (float2)(3.0f, 4.0f)); + #endif Vector Operations -----------------
Index: clang/docs/LanguageExtensions.rst =================================================================== --- clang/docs/LanguageExtensions.rst +++ clang/docs/LanguageExtensions.rst @@ -452,12 +452,13 @@ v4si vsi = (v4si){1, 2, 3, 4}; float4 vf = (float4)(1.0f, 2.0f, 3.0f, 4.0f); + #ifdef __VEC__ vector int vi1 = (vector int)(1); // vi1 will be (1, 1, 1, 1). vector int vi2 = (vector int){1}; // vi2 will be (1, 0, 0, 0). vector int vi3 = (vector int)(1, 2); // error vector int vi4 = (vector int){1, 2}; // vi4 will be (1, 2, 0, 0). vector int vi5 = (vector int)(1, 2, 3, 4); - float4 vf = (float4)((float2)(1.0f, 2.0f), (float2)(3.0f, 4.0f)); + #endif Vector Operations -----------------
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits