[PATCH] D26271: [PPC} add extract significand/ extract exponent/test data class for vector float and vector double -- clang portion

Sean Fertile via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 06:02:40 PDT 2016

sfertile added inline comments.

Comment at: lib/Headers/altivec.h:15629
+#define vec_test_data_class(__a, __b)                                      \
+        _Generic((__a),                                                    \
+           vector float:                                                   \
nemanjai wrote:
> I don't know what happens if the type of the first argument is neither of the two types, but I think we should verify that something sane happens. Namely, some sort of overload resolution error message. 
We do get a decent error diagnostic:

test_data_class_bad.c:9:26: error: controlling expression type '__vector unsigned char' (vector of 16 'unsigned char' values) not compatible with any generic association type
        vector bool int res_f = vec_test_data_class(vfa, 4);
/home/sfertile/LLVM/publish/assert/bin/../lib/clang/4.0.0/include/altivec.h:15629:18: note: expanded from macro 'vec_test_data_class'
        _Generic((__a),                                                    \
1 error generated.



More information about the cfe-commits mailing list