Refactor the libbcc runtime for x86 platform

This patch is merged/rebased from AOSP, where it was initially submitted to
frameworks/compile/libbcc by Jun Tian <jun.j.tian@intel.com>. All conflicts
have been resolved.

This patch refactors the libbcc runtime code to support x86 platform.
It removed the redundant x86 code and added the missing functions in
libclcore_x86.bc.
It resolved the RenderScript failures on the x86 platform.

Bug: 9961583
Change-Id: I2c8be0f710960ee5e0614721f5edfbaf028c67e1
diff --git a/driver/runtime/Android.mk b/driver/runtime/Android.mk
index d2ced77..80fbb1c 100755
--- a/driver/runtime/Android.mk
+++ b/driver/runtime/Android.mk
@@ -34,31 +34,24 @@
 clcore_files := \
     $(clcore_base_files) \
     math.ll \
-    arch/generic.c \
-    arch/sqrt.c \
-    arch/dot_length.c
+    arch/generic.c
 
 clcore_neon_files := \
     $(clcore_base_files) \
     math.ll \
     arch/neon.ll \
-    arch/sqrt.c \
-    arch/dot_length.c \
     arch/clamp.c
 
 ifeq ($(ARCH_X86_HAVE_SSE2), true)
     clcore_x86_files := \
     $(clcore_base_files) \
-    arch/x86_generic.c \
-    arch/x86_clamp.ll \
-    arch/x86_math.ll
+    arch/generic.c \
+    arch/x86_sse2.ll
 
+    # FIXME: without SSE3, it is still able to get better code through PSHUFD. But,
+    # so far, there is no such device with SSE2 only.
     ifeq ($(ARCH_X86_HAVE_SSE3), true)
-        clcore_x86_files += arch/x86_dot_length.ll
-    else
-        # FIXME: without SSE3, it is still able to get better code through PSHUFD. But,
-        # so far, there is no such device with SSE2 only.
-        clcore_x86_files += arch/dot_length.c
+        clcore_x86_files += arch/x86_sse3.ll
     endif
 endif