Index: lib/Headers/altivec.h
===================================================================
--- lib/Headers/altivec.h	(revision 111116)
+++ lib/Headers/altivec.h	(working copy)
@@ -123,36 +123,108 @@
   return a + b;
 }
 
+static vector signed char __ATTRS_o_ai
+vec_add(vector bool char a, vector signed char b)
+{
+  return (vector signed char)a + b;
+}
+
+static vector signed char __ATTRS_o_ai
+vec_add(vector signed char a, vector bool char b)
+{
+  return a + (vector signed char)b;
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_add(vector unsigned char a, vector unsigned char b)
 {
   return a + b;
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_add(vector bool char a, vector unsigned char b)
+{
+  return (vector unsigned char)a + b;
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_add(vector unsigned char a, vector bool char b)
+{
+  return a + (vector unsigned char)b;
+}
+
 static vector short __ATTRS_o_ai
 vec_add(vector short a, vector short b)
 {
   return a + b;
 }
 
+static vector short __ATTRS_o_ai
+vec_add(vector bool short a, vector short b)
+{
+  return (vector short)a + b;
+}
+
+static vector short __ATTRS_o_ai
+vec_add(vector short a, vector bool short b)
+{
+  return a + (vector short)b;
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_add(vector unsigned short a, vector unsigned short b)
 {
   return a + b;
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_add(vector bool short a, vector unsigned short b)
+{
+  return (vector unsigned short)a + b;
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_add(vector unsigned short a, vector bool short b)
+{
+  return a + (vector unsigned short)b;
+}
+
 static vector int __ATTRS_o_ai
 vec_add(vector int a, vector int b)
 {
   return a + b;
 }
 
+static vector int __ATTRS_o_ai
+vec_add(vector bool int a, vector int b)
+{
+  return (vector int)a + b;
+}
+
+static vector int __ATTRS_o_ai
+vec_add(vector int a, vector bool int b)
+{
+  return a + (vector int)b;
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_add(vector unsigned int a, vector unsigned int b)
 {
   return a + b;
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_add(vector bool int a, vector unsigned int b)
+{
+  return (vector unsigned int)a + b;
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_add(vector unsigned int a, vector bool int b)
+{
+  return a + (vector unsigned int)b;
+}
+
 static vector float __ATTRS_o_ai
 vec_add(vector float a, vector float b)
 {
@@ -169,12 +241,36 @@
   return a + b;
 }
 
+static vector signed char __ATTRS_o_ai
+vec_vaddubm(vector bool char a, vector signed char b)
+{
+  return (vector signed char)a + b;
+}
+
+static vector signed char __ATTRS_o_ai
+vec_vaddubm(vector signed char a, vector bool char b)
+{
+  return a + (vector signed char)b;
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_vaddubm(vector unsigned char a, vector unsigned char b)
 {
   return a + b;
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_vaddubm(vector bool char a, vector unsigned char b)
+{
+  return (vector unsigned char)a + b;
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_vaddubm(vector unsigned char a, vector bool char b)
+{
+  return a + (vector unsigned char)b;
+}
+
 /* vec_vadduhm */
 
 #define __builtin_altivec_vadduhm vec_vadduhm
@@ -185,12 +281,36 @@
   return a + b;
 }
 
+static vector short __ATTRS_o_ai
+vec_vadduhm(vector bool short a, vector short b)
+{
+  return (vector short)a + b;
+}
+
+static vector short __ATTRS_o_ai
+vec_vadduhm(vector short a, vector bool short b)
+{
+  return a + (vector short)b;
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_vadduhm(vector unsigned short a, vector unsigned short b)
 {
   return a + b;
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_vadduhm(vector bool short a, vector unsigned short b)
+{
+  return (vector unsigned short)a + b;
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_vadduhm(vector unsigned short a, vector bool short b)
+{
+  return a + (vector unsigned short)b;
+}
+
 /* vec_vadduwm */
 
 #define __builtin_altivec_vadduwm vec_vadduwm
@@ -201,12 +321,36 @@
   return a + b;
 }
 
+static vector int __ATTRS_o_ai
+vec_vadduwm(vector bool int a, vector int b)
+{
+  return (vector int)a + b;
+}
+
+static vector int __ATTRS_o_ai
+vec_vadduwm(vector int a, vector bool int b)
+{
+  return a + (vector int)b;
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_vadduwm(vector unsigned int a, vector unsigned int b)
 {
   return a + b;
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_vadduwm(vector bool int a, vector unsigned int b)
+{
+  return (vector unsigned int)a + b;
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_vadduwm(vector unsigned int a, vector bool int b)
+{
+  return a + (vector unsigned int)b;
+}
+
 /* vec_vaddfp */
 
 #define __builtin_altivec_vaddfp  vec_vaddfp
@@ -241,84 +385,228 @@
   return __builtin_altivec_vaddsbs(a, b);
 }
 
+static vector signed char __ATTRS_o_ai
+vec_adds(vector bool char a, vector signed char b)
+{
+  return __builtin_altivec_vaddsbs((vector signed char)a, b);
+}
+
+static vector signed char __ATTRS_o_ai
+vec_adds(vector signed char a, vector bool char b)
+{
+  return __builtin_altivec_vaddsbs(a, (vector signed char)b);
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_adds(vector unsigned char a, vector unsigned char b)
 {
   return __builtin_altivec_vaddubs(a, b);
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_adds(vector bool char a, vector unsigned char b)
+{
+  return __builtin_altivec_vaddubs((vector unsigned char)a, b);
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_adds(vector unsigned char a, vector bool char b)
+{
+  return __builtin_altivec_vaddubs(a, (vector unsigned char)b);
+}
+
 static vector short __ATTRS_o_ai
 vec_adds(vector short a, vector short b)
 {
   return __builtin_altivec_vaddshs(a, b);
 }
 
+static vector short __ATTRS_o_ai
+vec_adds(vector bool short a, vector short b)
+{
+  return __builtin_altivec_vaddshs((vector short)a, b);
+}
+
+static vector short __ATTRS_o_ai
+vec_adds(vector short a, vector bool short b)
+{
+  return __builtin_altivec_vaddshs(a, (vector short)b);
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_adds(vector unsigned short a, vector unsigned short b)
 {
   return __builtin_altivec_vadduhs(a, b);
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_adds(vector bool short a, vector unsigned short b)
+{
+  return __builtin_altivec_vadduhs((vector unsigned short)a, b);
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_adds(vector unsigned short a, vector bool short b)
+{
+  return __builtin_altivec_vadduhs(a, (vector unsigned short)b);
+}
+
 static vector int __ATTRS_o_ai
 vec_adds(vector int a, vector int b)
 {
   return __builtin_altivec_vaddsws(a, b);
 }
 
+static vector int __ATTRS_o_ai
+vec_adds(vector bool int a, vector int b)
+{
+  return __builtin_altivec_vaddsws((vector int)a, b);
+}
+
+static vector int __ATTRS_o_ai
+vec_adds(vector int a, vector bool int b)
+{
+  return __builtin_altivec_vaddsws(a, (vector int)b);
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_adds(vector unsigned int a, vector unsigned int b)
 {
   return __builtin_altivec_vadduws(a, b);
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_adds(vector bool int a, vector unsigned int b)
+{
+  return __builtin_altivec_vadduws((vector unsigned int)a, b);
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_adds(vector unsigned int a, vector bool int b)
+{
+  return __builtin_altivec_vadduws(a, (vector unsigned int)b);
+}
+
 /* vec_vaddsbs */
 
-static vector signed char __attribute__((__always_inline__))
+static vector signed char __ATTRS_o_ai
 vec_vaddsbs(vector signed char a, vector signed char b)
 {
   return __builtin_altivec_vaddsbs(a, b);
 }
 
+static vector signed char __ATTRS_o_ai
+vec_vaddsbs(vector bool char a, vector signed char b)
+{
+  return __builtin_altivec_vaddsbs((vector signed char)a, b);
+}
+
+static vector signed char __ATTRS_o_ai
+vec_vaddsbs(vector signed char a, vector bool char b)
+{
+  return __builtin_altivec_vaddsbs(a, (vector signed char)b);
+}
+
 /* vec_vaddubs */
 
-static vector unsigned char __attribute__((__always_inline__))
+static vector unsigned char __ATTRS_o_ai
 vec_vaddubs(vector unsigned char a, vector unsigned char b)
 {
   return __builtin_altivec_vaddubs(a, b);
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_vaddubs(vector bool char a, vector unsigned char b)
+{
+  return __builtin_altivec_vaddubs((vector unsigned char)a, b);
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_vaddubs(vector unsigned char a, vector bool char b)
+{
+  return __builtin_altivec_vaddubs(a, (vector unsigned char)b);
+}
+
 /* vec_vaddshs */
 
-static vector short __attribute__((__always_inline__))
+static vector short __ATTRS_o_ai
 vec_vaddshs(vector short a, vector short b)
 {
   return __builtin_altivec_vaddshs(a, b);
 }
 
+static vector short __ATTRS_o_ai
+vec_vaddshs(vector bool short a, vector short b)
+{
+  return __builtin_altivec_vaddshs((vector short)a, b);
+}
+
+static vector short __ATTRS_o_ai
+vec_vaddshs(vector short a, vector bool short b)
+{
+  return __builtin_altivec_vaddshs(a, (vector short)b);
+}
+
 /* vec_vadduhs */
 
-static vector unsigned short __attribute__((__always_inline__))
+static vector unsigned short __ATTRS_o_ai
 vec_vadduhs(vector unsigned short a, vector unsigned short b)
 {
   return __builtin_altivec_vadduhs(a, b);
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_vadduhs(vector bool short a, vector unsigned short b)
+{
+  return __builtin_altivec_vadduhs((vector unsigned short)a, b);
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_vadduhs(vector unsigned short a, vector bool short b)
+{
+  return __builtin_altivec_vadduhs(a, (vector unsigned short)b);
+}
+
 /* vec_vaddsws */
 
-static vector int __attribute__((__always_inline__))
+static vector int __ATTRS_o_ai
 vec_vaddsws(vector int a, vector int b)
 {
   return __builtin_altivec_vaddsws(a, b);
 }
 
+static vector int __ATTRS_o_ai
+vec_vaddsws(vector bool int a, vector int b)
+{
+  return __builtin_altivec_vaddsws((vector int)a, b);
+}
+
+static vector int __ATTRS_o_ai
+vec_vaddsws(vector int a, vector bool int b)
+{
+  return __builtin_altivec_vaddsws(a, (vector int)b);
+}
+
 /* vec_vadduws */
 
-static vector unsigned int __attribute__((__always_inline__))
+static vector unsigned int __ATTRS_o_ai
 vec_vadduws(vector unsigned int a, vector unsigned int b)
 {
   return __builtin_altivec_vadduws(a, b);
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_vadduws(vector bool int a, vector unsigned int b)
+{
+  return __builtin_altivec_vadduws((vector unsigned int)a, b);
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_vadduws(vector unsigned int a, vector bool int b)
+{
+  return __builtin_altivec_vadduws(a, (vector unsigned int)b);
+}
+
 /* vec_and */
 
 #define __builtin_altivec_vand vec_and
@@ -329,36 +617,126 @@
   return a & b;
 }
 
+static vector signed char __ATTRS_o_ai
+vec_and(vector bool char a, vector signed char b)
+{
+  return (vector signed char)a & b;
+}
+
+static vector signed char __ATTRS_o_ai
+vec_and(vector signed char a, vector bool char b)
+{
+  return a & (vector signed char)b;
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_and(vector unsigned char a, vector unsigned char b)
 {
   return a & b;
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_and(vector bool char a, vector unsigned char b)
+{
+  return (vector unsigned char)a & b;
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_and(vector unsigned char a, vector bool char b)
+{
+  return a & (vector unsigned char)b;
+}
+
+static vector bool char __ATTRS_o_ai
+vec_and(vector bool char a, vector bool char b)
+{
+  return a & b;
+}
+
 static vector short __ATTRS_o_ai
 vec_and(vector short a, vector short b)
 {
   return a & b;
 }
 
+static vector short __ATTRS_o_ai
+vec_and(vector bool short a, vector short b)
+{
+  return (vector short)a & b;
+}
+
+static vector short __ATTRS_o_ai
+vec_and(vector short a, vector bool short b)
+{
+  return a & (vector short)b;
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_and(vector unsigned short a, vector unsigned short b)
 {
   return a & b;
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_and(vector bool short a, vector unsigned short b)
+{
+  return (vector unsigned short)a & b;
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_and(vector unsigned short a, vector bool short b)
+{
+  return a & (vector unsigned short)b;
+}
+
+static vector bool short __ATTRS_o_ai
+vec_and(vector bool short a, vector bool short b)
+{
+  return a & b;
+}
+
 static vector int __ATTRS_o_ai
 vec_and(vector int a, vector int b)
 {
   return a & b;
 }
 
+static vector int __ATTRS_o_ai
+vec_and(vector bool int a, vector int b)
+{
+  return (vector int)a & b;
+}
+
+static vector int __ATTRS_o_ai
+vec_and(vector int a, vector bool int b)
+{
+  return a & (vector int)b;
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_and(vector unsigned int a, vector unsigned int b)
 {
   return a & b;
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_and(vector bool int a, vector unsigned int b)
+{
+  return (vector unsigned int)a & b;
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_and(vector unsigned int a, vector bool int b)
+{
+  return a & (vector unsigned int)b;
+}
+
+static vector bool int __ATTRS_o_ai
+vec_and(vector bool int a, vector bool int b)
+{
+  return a & b;
+}
+
 static vector float __ATTRS_o_ai
 vec_and(vector float a, vector float b)
 {
@@ -366,6 +744,20 @@
   return (vector float)res;
 }
 
+static vector float __ATTRS_o_ai
+vec_and(vector bool int a, vector float b)
+{
+  vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b;
+  return (vector float)res;
+}
+
+static vector float __ATTRS_o_ai
+vec_and(vector float a, vector bool int b)
+{
+  vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b;
+  return (vector float)res;
+}
+
 /* vec_vand */
 
 static vector signed char __ATTRS_o_ai
@@ -374,36 +766,126 @@
   return a & b;
 }
 
+static vector signed char __ATTRS_o_ai
+vec_vand(vector bool char a, vector signed char b)
+{
+  return (vector signed char)a & b;
+}
+
+static vector signed char __ATTRS_o_ai
+vec_vand(vector signed char a, vector bool char b)
+{
+  return a & (vector signed char)b;
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_vand(vector unsigned char a, vector unsigned char b)
 {
   return a & b;
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_vand(vector bool char a, vector unsigned char b)
+{
+  return (vector unsigned char)a & b;
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_vand(vector unsigned char a, vector bool char b)
+{
+  return a & (vector unsigned char)b;
+}
+
+static vector bool char __ATTRS_o_ai
+vec_vand(vector bool char a, vector bool char b)
+{
+  return a & b;
+}
+
 static vector short __ATTRS_o_ai
 vec_vand(vector short a, vector short b)
 {
   return a & b;
 }
 
+static vector short __ATTRS_o_ai
+vec_vand(vector bool short a, vector short b)
+{
+  return (vector short)a & b;
+}
+
+static vector short __ATTRS_o_ai
+vec_vand(vector short a, vector bool short b)
+{
+  return a & (vector short)b;
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_vand(vector unsigned short a, vector unsigned short b)
 {
   return a & b;
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_vand(vector bool short a, vector unsigned short b)
+{
+  return (vector unsigned short)a & b;
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_vand(vector unsigned short a, vector bool short b)
+{
+  return a & (vector unsigned short)b;
+}
+
+static vector bool short __ATTRS_o_ai
+vec_vand(vector bool short a, vector bool short b)
+{
+  return a & b;
+}
+
 static vector int __ATTRS_o_ai
 vec_vand(vector int a, vector int b)
 {
   return a & b;
 }
 
+static vector int __ATTRS_o_ai
+vec_vand(vector bool int a, vector int b)
+{
+  return (vector int)a & b;
+}
+
+static vector int __ATTRS_o_ai
+vec_vand(vector int a, vector bool int b)
+{
+  return a & (vector int)b;
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_vand(vector unsigned int a, vector unsigned int b)
 {
   return a & b;
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_vand(vector bool int a, vector unsigned int b)
+{
+  return (vector unsigned int)a & b;
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_vand(vector unsigned int a, vector bool int b)
+{
+  return a & (vector unsigned int)b;
+}
+
+static vector bool int __ATTRS_o_ai
+vec_vand(vector bool int a, vector bool int b)
+{
+  return a & b;
+}
+
 static vector float __ATTRS_o_ai
 vec_vand(vector float a, vector float b)
 {
@@ -411,6 +893,20 @@
   return (vector float)res;
 }
 
+static vector float __ATTRS_o_ai
+vec_vand(vector bool int a, vector float b)
+{
+  vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b;
+  return (vector float)res;
+}
+
+static vector float __ATTRS_o_ai
+vec_vand(vector float a, vector bool int b)
+{
+  vector unsigned int res = (vector unsigned int)a & (vector unsigned int)b;
+  return (vector float)res;
+}
+
 /* vec_andc */
 
 #define __builtin_altivec_vandc vec_andc
@@ -421,36 +917,126 @@
   return a & ~b;
 }
 
+static vector signed char __ATTRS_o_ai
+vec_andc(vector bool char a, vector signed char b)
+{
+  return (vector signed char)a & ~b;
+}
+
+static vector signed char __ATTRS_o_ai
+vec_andc(vector signed char a, vector bool char b)
+{
+  return a & ~(vector signed char)b;
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_andc(vector unsigned char a, vector unsigned char b)
 {
   return a & ~b;
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_andc(vector bool char a, vector unsigned char b)
+{
+  return (vector unsigned char)a & ~b;
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_andc(vector unsigned char a, vector bool char b)
+{
+  return a & ~(vector unsigned char)b;
+}
+
+static vector bool char __ATTRS_o_ai
+vec_andc(vector bool char a, vector bool char b)
+{
+  return a & ~b;
+}
+
 static vector short __ATTRS_o_ai
 vec_andc(vector short a, vector short b)
 {
   return a & ~b;
 }
 
+static vector short __ATTRS_o_ai
+vec_andc(vector bool short a, vector short b)
+{
+  return (vector short)a & ~b;
+}
+
+static vector short __ATTRS_o_ai
+vec_andc(vector short a, vector bool short b)
+{
+  return a & ~(vector short)b;
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_andc(vector unsigned short a, vector unsigned short b)
 {
   return a & ~b;
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_andc(vector bool short a, vector unsigned short b)
+{
+  return (vector unsigned short)a & ~b;
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_andc(vector unsigned short a, vector bool short b)
+{
+  return a & ~(vector unsigned short)b;
+}
+
+static vector bool short __ATTRS_o_ai
+vec_andc(vector bool short a, vector bool short b)
+{
+  return a & ~b;
+}
+
 static vector int __ATTRS_o_ai
 vec_andc(vector int a, vector int b)
 {
   return a & ~b;
 }
 
+static vector int __ATTRS_o_ai
+vec_andc(vector bool int a, vector int b)
+{
+  return (vector int)a & ~b;
+}
+
+static vector int __ATTRS_o_ai
+vec_andc(vector int a, vector bool int b)
+{
+  return a & ~(vector int)b;
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_andc(vector unsigned int a, vector unsigned int b)
 {
   return a & ~b;
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_andc(vector bool int a, vector unsigned int b)
+{
+  return (vector unsigned int)a & ~b;
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_andc(vector unsigned int a, vector bool int b)
+{
+  return a & ~(vector unsigned int)b;
+}
+
+static vector bool int __ATTRS_o_ai
+vec_andc(vector bool int a, vector bool int b)
+{
+  return a & ~b;
+}
+
 static vector float __ATTRS_o_ai
 vec_andc(vector float a, vector float b)
 {
@@ -458,6 +1044,20 @@
   return (vector float)res;
 }
 
+static vector float __ATTRS_o_ai
+vec_andc(vector bool int a, vector float b)
+{
+  vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b;
+  return (vector float)res;
+}
+
+static vector float __ATTRS_o_ai
+vec_andc(vector float a, vector bool int b)
+{
+  vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b;
+  return (vector float)res;
+}
+
 /* vec_vandc */
 
 static vector signed char __ATTRS_o_ai
@@ -466,36 +1066,126 @@
   return a & ~b;
 }
 
+static vector signed char __ATTRS_o_ai
+vec_vandc(vector bool char a, vector signed char b)
+{
+  return (vector signed char)a & ~b;
+}
+
+static vector signed char __ATTRS_o_ai
+vec_vandc(vector signed char a, vector bool char b)
+{
+  return a & ~(vector signed char)b;
+}
+
 static vector unsigned char __ATTRS_o_ai
 vec_vandc(vector unsigned char a, vector unsigned char b)
 {
   return a & ~b;
 }
 
+static vector unsigned char __ATTRS_o_ai
+vec_vandc(vector bool char a, vector unsigned char b)
+{
+  return (vector unsigned char)a & ~b;
+}
+
+static vector unsigned char __ATTRS_o_ai
+vec_vandc(vector unsigned char a, vector bool char b)
+{
+  return a & ~(vector unsigned char)b;
+}
+
+static vector bool char __ATTRS_o_ai
+vec_vandc(vector bool char a, vector bool char b)
+{
+  return a & ~b;
+}
+
 static vector short __ATTRS_o_ai
 vec_vandc(vector short a, vector short b)
 {
   return a & ~b;
 }
 
+static vector short __ATTRS_o_ai
+vec_vandc(vector bool short a, vector short b)
+{
+  return (vector short)a & ~b;
+}
+
+static vector short __ATTRS_o_ai
+vec_vandc(vector short a, vector bool short b)
+{
+  return a & ~(vector short)b;
+}
+
 static vector unsigned short __ATTRS_o_ai
 vec_vandc(vector unsigned short a, vector unsigned short b)
 {
   return a & ~b;
 }
 
+static vector unsigned short __ATTRS_o_ai
+vec_vandc(vector bool short a, vector unsigned short b)
+{
+  return (vector unsigned short)a & ~b;
+}
+
+static vector unsigned short __ATTRS_o_ai
+vec_vandc(vector unsigned short a, vector bool short b)
+{
+  return a & ~(vector unsigned short)b;
+}
+
+static vector bool short __ATTRS_o_ai
+vec_vandc(vector bool short a, vector bool short b)
+{
+  return a & ~b;
+}
+
 static vector int __ATTRS_o_ai
 vec_vandc(vector int a, vector int b)
 {
   return a & ~b;
 }
 
+static vector int __ATTRS_o_ai
+vec_vandc(vector bool int a, vector int b)
+{
+  return (vector int)a & ~b;
+}
+
+static vector int __ATTRS_o_ai
+vec_vandc(vector int a, vector bool int b)
+{
+  return a & ~(vector int)b;
+}
+
 static vector unsigned int __ATTRS_o_ai
 vec_vandc(vector unsigned int a, vector unsigned int b)
 {
   return a & ~b;
 }
 
+static vector unsigned int __ATTRS_o_ai
+vec_vandc(vector bool int a, vector unsigned int b)
+{
+  return (vector unsigned int)a & ~b;
+}
+
+static vector unsigned int __ATTRS_o_ai
+vec_vandc(vector unsigned int a, vector bool int b)
+{
+  return a & ~(vector unsigned int)b;
+}
+
+static vector bool int __ATTRS_o_ai
+vec_vandc(vector bool int a, vector bool int b)
+{
+  return a & ~b;
+}
+
 static vector float __ATTRS_o_ai
 vec_vandc(vector float a, vector float b)
 {
@@ -503,6 +1193,20 @@
   return (vector float)res;
 }
 
+static vector float __ATTRS_o_ai
+vec_vandc(vector bool int a, vector float b)
+{
+  vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b;
+  return (vector float)res;
+}
+
+static vector float __ATTRS_o_ai
+vec_vandc(vector float a, vector bool int b)
+{
+  vector unsigned int res = (vector unsigned int)a & ~(vector unsigned int)b;
+  return (vector float)res;
+}
+
 /* vec_avg */
 
 static vector signed char __ATTRS_o_ai
Index: test/CodeGen/builtins-ppc-altivec.c
===================================================================
--- test/CodeGen/builtins-ppc-altivec.c	(revision 111116)
+++ test/CodeGen/builtins-ppc-altivec.c	(working copy)
@@ -1,31 +1,24 @@
 // RUN: %clang_cc1 -faltivec -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
 
-// TODO: uncomment
-/*  vector bool char vbc = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; */
+vector bool char vbc = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 };
 vector signed char vsc = { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10, 11, -12, 13, -14, 15, -16 };
 vector unsigned char vuc = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
-// TODO: uncomment
-/*  vector bool short vbs = { 1, 0, 1, 0, 1, 0, 1, 0 }; */
+vector bool short vbs = { 1, 0, 1, 0, 1, 0, 1, 0 };
 vector short vs = { -1, 2, -3, 4, -5, 6, -7, 8 };
 vector unsigned short vus = { 1, 2, 3, 4, 5, 6, 7, 8 };
-// TODO: uncomment
-/*  vector bool int vbi = { 1, 0, 1, 0 }; */
+vector bool int vbi = { 1, 0, 1, 0 };
 vector int vi = { -1, 2, -3, 4 };
 vector unsigned int vui = { 1, 2, 3, 4 };
 vector float vf = { -1.5, 2.5, -3.5, 4.5 };
 
-// TODO: uncomment
-/*  vector bool char res_vbc; */
+vector bool char res_vbc;
 vector signed char res_vsc;
 vector unsigned char res_vuc;
-// TODO: uncomment
-/*  vector bool short res_vbs; */
+vector bool short res_vbs;
 vector short res_vs;
 vector unsigned short res_vus;
-// TODO: uncomment
 vector pixel res_vp;
-// TODO: uncomment
-/*  vector bool int res_vbi; */
+vector bool int res_vbi;
 vector int res_vi;
 vector unsigned int res_vui;
 vector float res_vf;
@@ -40,8 +33,8 @@
 
 int res_i;
 
-int test1() {
-// CHECK: define i32 @test1
+// CHECK: define void @test1
+void test1() {
 
   /* vec_abs */
   vsc = vec_abs(vsc);                           // CHECK: sub nsw <16 x i8> zeroinitializer
@@ -67,18 +60,42 @@
 
   /*  vec_add */
   res_vsc = vec_add(vsc, vsc);                  // CHECK: add nsw <16 x i8>
+  res_vsc = vec_add(vbc, vsc);                  // CHECK: add nsw <16 x i8>
+  res_vsc = vec_add(vsc, vbc);                  // CHECK: add nsw <16 x i8>
   res_vuc = vec_add(vuc, vuc);                  // CHECK: add <16 x i8>
+  res_vuc = vec_add(vbc, vuc);                  // CHECK: add <16 x i8>
+  res_vuc = vec_add(vuc, vbc);                  // CHECK: add <16 x i8>
   res_vs  = vec_add(vs, vs);                    // CHECK: add nsw <8 x i16>
+  res_vs  = vec_add(vbs, vs);                   // CHECK: add nsw <8 x i16>
+  res_vs  = vec_add(vs, vbs);                   // CHECK: add nsw <8 x i16>
   res_vus = vec_add(vus, vus);                  // CHECK: add <8 x i16>
+  res_vus = vec_add(vbs, vus);                  // CHECK: add <8 x i16>
+  res_vus = vec_add(vus, vbs);                  // CHECK: add <8 x i16>
   res_vi  = vec_add(vi, vi);                    // CHECK: add nsw <4 x i32>
+  res_vi  = vec_add(vbi, vi);                   // CHECK: add nsw <4 x i32>
+  res_vi  = vec_add(vi, vbi);                   // CHECK: add nsw <4 x i32>
   res_vui = vec_add(vui, vui);                  // CHECK: add <4 x i32>
+  res_vui = vec_add(vbi, vui);                  // CHECK: add <4 x i32>
+  res_vui = vec_add(vui, vbi);                  // CHECK: add <4 x i32>
   res_vf  = vec_add(vf, vf);                    // CHECK: fadd <4 x float>
   res_vsc = vec_vaddubm(vsc, vsc);              // CHECK: add nsw <16 x i8>
+  res_vsc = vec_vaddubm(vbc, vsc);              // CHECK: add nsw <16 x i8>
+  res_vsc = vec_vaddubm(vsc, vbc);              // CHECK: add nsw <16 x i8>
   res_vuc = vec_vaddubm(vuc, vuc);              // CHECK: add <16 x i8>
+  res_vuc = vec_vaddubm(vbc, vuc);              // CHECK: add <16 x i8>
+  res_vuc = vec_vaddubm(vuc, vbc);              // CHECK: add <16 x i8>
   res_vs  = vec_vadduhm(vs, vs);                // CHECK: add nsw <8 x i16>
+  res_vs  = vec_vadduhm(vbs, vs);               // CHECK: add nsw <8 x i16>
+  res_vs  = vec_vadduhm(vs, vbs);               // CHECK: add nsw <8 x i16>
   res_vus = vec_vadduhm(vus, vus);              // CHECK: add <8 x i16>
+  res_vus = vec_vadduhm(vbs, vus);              // CHECK: add <8 x i16>
+  res_vus = vec_vadduhm(vus, vbs);              // CHECK: add <8 x i16>
   res_vi  = vec_vadduwm(vi, vi);                // CHECK: add nsw <4 x i32>
+  res_vi  = vec_vadduwm(vbi, vi);               // CHECK: add nsw <4 x i32>
+  res_vi  = vec_vadduwm(vi, vbi);               // CHECK: add nsw <4 x i32>
   res_vui = vec_vadduwm(vui, vui);              // CHECK: add <4 x i32>
+  res_vui = vec_vadduwm(vbi, vui);              // CHECK: add <4 x i32>
+  res_vui = vec_vadduwm(vui, vbi);              // CHECK: add <4 x i32>
   res_vf  = vec_vaddfp(vf, vf);                 // CHECK: fadd <4 x float>
 
   /* vec_addc */
@@ -87,74 +104,224 @@
 
   /* vec_adds */
   res_vsc = vec_adds(vsc, vsc);                 // CHECK: @llvm.ppc.altivec.vaddsbs
+  res_vsc = vec_adds(vbc, vsc);                 // CHECK: @llvm.ppc.altivec.vaddsbs
+  res_vsc = vec_adds(vsc, vbc);                 // CHECK: @llvm.ppc.altivec.vaddsbs
   res_vuc = vec_adds(vuc, vuc);                 // CHECK: @llvm.ppc.altivec.vaddubs
+  res_vuc = vec_adds(vbc, vuc);                 // CHECK: @llvm.ppc.altivec.vaddubs
+  res_vuc = vec_adds(vuc, vbc);                 // CHECK: @llvm.ppc.altivec.vaddubs
   res_vs  = vec_adds(vs, vs);                   // CHECK: @llvm.ppc.altivec.vaddshs
+  res_vs  = vec_adds(vbs, vs);                  // CHECK: @llvm.ppc.altivec.vaddshs
+  res_vs  = vec_adds(vs, vbs);                  // CHECK: @llvm.ppc.altivec.vaddshs
   res_vus = vec_adds(vus, vus);                 // CHECK: @llvm.ppc.altivec.vadduhs
+  res_vus = vec_adds(vbs, vus);                 // CHECK: @llvm.ppc.altivec.vadduhs
+  res_vus = vec_adds(vus, vbs);                 // CHECK: @llvm.ppc.altivec.vadduhs
   res_vi  = vec_adds(vi, vi);                   // CHECK: @llvm.ppc.altivec.vaddsws
+  res_vi  = vec_adds(vbi, vi);                  // CHECK: @llvm.ppc.altivec.vaddsws
+  res_vi  = vec_adds(vi, vbi);                  // CHECK: @llvm.ppc.altivec.vaddsws
   res_vui = vec_adds(vui, vui);                 // CHECK: @llvm.ppc.altivec.vadduws
+  res_vui = vec_adds(vbi, vui);                 // CHECK: @llvm.ppc.altivec.vadduws
+  res_vui = vec_adds(vui, vbi);                 // CHECK: @llvm.ppc.altivec.vadduws
   res_vsc = vec_vaddsbs(vsc, vsc);              // CHECK: @llvm.ppc.altivec.vaddsbs
+  res_vsc = vec_vaddsbs(vbc, vsc);              // CHECK: @llvm.ppc.altivec.vaddsbs
+  res_vsc = vec_vaddsbs(vsc, vbc);              // CHECK: @llvm.ppc.altivec.vaddsbs
   res_vuc = vec_vaddubs(vuc, vuc);              // CHECK: @llvm.ppc.altivec.vaddubs
+  res_vuc = vec_vaddubs(vbc, vuc);              // CHECK: @llvm.ppc.altivec.vaddubs
+  res_vuc = vec_vaddubs(vuc, vbc);              // CHECK: @llvm.ppc.altivec.vaddubs
   res_vs  = vec_vaddshs(vs, vs);                // CHECK: @llvm.ppc.altivec.vaddshs
+  res_vs  = vec_vaddshs(vbs, vs);               // CHECK: @llvm.ppc.altivec.vaddshs
+  res_vs  = vec_vaddshs(vs, vbs);               // CHECK: @llvm.ppc.altivec.vaddshs
   res_vus = vec_vadduhs(vus, vus);              // CHECK: @llvm.ppc.altivec.vadduhs
+  res_vus = vec_vadduhs(vbs, vus);              // CHECK: @llvm.ppc.altivec.vadduhs
+  res_vus = vec_vadduhs(vus, vbs);              // CHECK: @llvm.ppc.altivec.vadduhs
   res_vi  = vec_vaddsws(vi, vi);                // CHECK: @llvm.ppc.altivec.vaddsws
+  res_vi  = vec_vaddsws(vbi, vi);               // CHECK: @llvm.ppc.altivec.vaddsws
+  res_vi  = vec_vaddsws(vi, vbi);               // CHECK: @llvm.ppc.altivec.vaddsws
   res_vui = vec_vadduws(vui, vui);              // CHECK: @llvm.ppc.altivec.vadduws
+  res_vui = vec_vadduws(vbi, vui);              // CHECK: @llvm.ppc.altivec.vadduws
+  res_vui = vec_vadduws(vui, vbi);              // CHECK: @llvm.ppc.altivec.vadduws
 
   /* vec_and */
   res_vsc = vec_and(vsc, vsc);                  // CHECK: and <16 x i8>
+  res_vsc = vec_and(vbc, vsc);                  // CHECK: and <16 x i8>
+  res_vsc = vec_and(vsc, vbc);                  // CHECK: and <16 x i8>
   res_vuc = vec_and(vuc, vuc);                  // CHECK: and <16 x i8>
+  res_vuc = vec_and(vbc, vuc);                  // CHECK: and <16 x i8>
+  res_vuc = vec_and(vuc, vbc);                  // CHECK: and <16 x i8>
+  res_vbc = vec_and(vbc, vbc);                  // CHECK: and <16 x i8>
   res_vs  = vec_and(vs, vs);                    // CHECK: and <8 x i16>
+  res_vs  = vec_and(vbs, vs);                   // CHECK: and <8 x i16>
+  res_vs  = vec_and(vs, vbs);                   // CHECK: and <8 x i16>
   res_vus = vec_and(vus, vus);                  // CHECK: and <8 x i16>
+  res_vus = vec_and(vbs, vus);                  // CHECK: and <8 x i16>
+  res_vus = vec_and(vus, vbs);                  // CHECK: and <8 x i16>
+  res_vbs = vec_and(vbs, vbs);                  // CHECK: and <8 x i16>
   res_vi  = vec_and(vi, vi);                    // CHECK: and <4 x i32>
+  res_vi  = vec_and(vbi, vi);                   // CHECK: and <4 x i32>
+  res_vi  = vec_and(vi, vbi);                   // CHECK: and <4 x i32>
   res_vui = vec_and(vui, vui);                  // CHECK: and <4 x i32>
+  res_vui = vec_and(vbi, vui);                  // CHECK: and <4 x i32>
+  res_vui = vec_and(vui, vbi);                  // CHECK: and <4 x i32>
+  res_vbi = vec_and(vbi, vbi);                  // CHECK: and <4 x i32>
   res_vsc = vec_vand(vsc, vsc);                 // CHECK: and <16 x i8>
+  res_vsc = vec_vand(vbc, vsc);                 // CHECK: and <16 x i8>
+  res_vsc = vec_vand(vsc, vbc);                 // CHECK: and <16 x i8>
   res_vuc = vec_vand(vuc, vuc);                 // CHECK: and <16 x i8>
+  res_vuc = vec_vand(vbc, vuc);                 // CHECK: and <16 x i8>
+  res_vuc = vec_vand(vuc, vbc);                 // CHECK: and <16 x i8>
+  res_vbc = vec_vand(vbc, vbc);                 // CHECK: and <16 x i8>
   res_vs  = vec_vand(vs, vs);                   // CHECK: and <8 x i16>
+  res_vs  = vec_vand(vbs, vs);                  // CHECK: and <8 x i16>
+  res_vs  = vec_vand(vs, vbs);                  // CHECK: and <8 x i16>
   res_vus = vec_vand(vus, vus);                 // CHECK: and <8 x i16>
+  res_vus = vec_vand(vbs, vus);                 // CHECK: and <8 x i16>
+  res_vus = vec_vand(vus, vbs);                 // CHECK: and <8 x i16>
+  res_vbs = vec_vand(vbs, vbs);                 // CHECK: and <8 x i16>
   res_vi  = vec_vand(vi, vi);                   // CHECK: and <4 x i32>
+  res_vi  = vec_vand(vbi, vi);                  // CHECK: and <4 x i32>
+  res_vi  = vec_vand(vi, vbi);                  // CHECK: and <4 x i32>
   res_vui = vec_vand(vui, vui);                 // CHECK: and <4 x i32>
+  res_vui = vec_vand(vbi, vui);                 // CHECK: and <4 x i32>
+  res_vui = vec_vand(vui, vbi);                 // CHECK: and <4 x i32>
+  res_vbi = vec_vand(vbi, vbi);                 // CHECK: and <4 x i32>
 
   /* vec_andc */
   res_vsc = vec_andc(vsc, vsc);                 // CHECK: xor <16 x i8>
                                                 // CHECK: and <16 x i8>
 
+  res_vsc = vec_andc(vbc, vsc);                 // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
+  res_vsc = vec_andc(vsc, vbc);                 // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
   res_vuc = vec_andc(vuc, vuc);                 // CHECK: xor <16 x i8>
                                                 // CHECK: and <16 x i8>
 
+  res_vuc = vec_andc(vbc, vuc);                 // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
+  res_vuc = vec_andc(vuc, vbc);                 // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
+  res_vbc = vec_andc(vbc, vbc);                 // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
   res_vs  = vec_andc(vs, vs);                   // CHECK: xor <8 x i16>
                                                 // CHECK: and <8 x i16>
 
+  res_vs  = vec_andc(vbs, vs);                  // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
+  res_vs  = vec_andc(vs, vbs);                  // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
   res_vus = vec_andc(vus, vus);                 // CHECK: xor <8 x i16>
                                                 // CHECK: and <8 x i16>
 
+  res_vus = vec_andc(vbs, vus);                 // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
+  res_vus = vec_andc(vus, vbs);                 // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
+  res_vbs = vec_andc(vbs, vbs);                 // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
   res_vi  = vec_andc(vi, vi);                   // CHECK: xor <4 x i32>
                                                 // CHECK: and <4 x i32>
 
+  res_vi  = vec_andc(vbi, vi);                  // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
+  res_vi  = vec_andc(vi, vbi);                  // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
   res_vui = vec_andc(vui, vui);                 // CHECK: xor <4 x i32>
                                                 // CHECK: and <4 x i32>
 
+  res_vui = vec_andc(vbi, vui);                 // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
+  res_vui = vec_andc(vui, vbi);                 // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
   res_vf = vec_andc(vf, vf);                    // CHECK: xor <4 x i32>
                                                 // CHECK: and <4 x i32>
 
+  res_vf = vec_andc(vbi, vf);                   // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
+  res_vf = vec_andc(vf, vbi);                   // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
   res_vsc = vec_vandc(vsc, vsc);                // CHECK: xor <16 x i8>
                                                 // CHECK: and <16 x i8>
 
+  res_vsc = vec_vandc(vbc, vsc);                // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
+  res_vsc = vec_vandc(vsc, vbc);                // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
   res_vuc = vec_vandc(vuc, vuc);                // CHECK: xor <16 x i8>
                                                 // CHECK: and <16 x i8>
 
+  res_vuc = vec_vandc(vbc, vuc);                // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
+  res_vuc = vec_vandc(vuc, vbc);                // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
+  res_vbc = vec_vandc(vbc, vbc);                // CHECK: xor <16 x i8>
+                                                // CHECK: and <16 x i8>
+
   res_vs  = vec_vandc(vs, vs);                  // CHECK: xor <8 x i16>
                                                 // CHECK: and <8 x i16>
 
+  res_vs  = vec_vandc(vbs, vs);                 // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
+  res_vs  = vec_vandc(vs, vbs);                 // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
   res_vus = vec_vandc(vus, vus);                // CHECK: xor <8 x i16>
                                                 // CHECK: and <8 x i16>
 
+  res_vus = vec_vandc(vbs, vus);                // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
+  res_vus = vec_vandc(vus, vbs);                // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
+  res_vbs = vec_vandc(vbs, vbs);                // CHECK: xor <8 x i16>
+                                                // CHECK: and <8 x i16>
+
   res_vi  = vec_vandc(vi, vi);                  // CHECK: xor <4 x i32>
                                                 // CHECK: and <4 x i32>
 
+  res_vi  = vec_vandc(vbi, vi);                 // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
+  res_vi  = vec_vandc(vi, vbi);                 // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
   res_vui = vec_vandc(vui, vui);                // CHECK: xor <4 x i32>
                                                 // CHECK: and <4 x i32>
 
+  res_vui = vec_vandc(vbi, vui);                // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
+  res_vui = vec_vandc(vui, vbi);                // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
   res_vf = vec_vandc(vf, vf);                   // CHECK: xor <4 x i32>
                                                 // CHECK: and <4 x i32>
+
+  res_vf = vec_vandc(vbi, vf);                  // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
+
+  res_vf = vec_vandc(vf, vbi);                  // CHECK: xor <4 x i32>
+                                                // CHECK: and <4 x i32>
 }
 
 // CHECK: i32 @test2
