Module: Mesa
Branch: gallium-0.2
Commit: b06d0720194dfecaf45dc97cbd178411aed5205f
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b06d0720194dfecaf45dc97cbd178411aed5205f
Author: Brian Paul <[EMAIL PROTECTED]>
Date: Wed Oct 22 14:48:33 2008 -0600
gallium: added ppc_vload_float(), for limited cases
---
src/gallium/auxiliary/rtasm/rtasm_ppc.c | 18 ++++++++++++++++++
src/gallium/auxiliary/rtasm/rtasm_ppc.h | 4 ++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc.c
b/src/gallium/auxiliary/rtasm/rtasm_ppc.c
index 2d9f4e0..65df676 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc.c
@@ -603,6 +603,24 @@ ppc_lvewx(struct ppc_function *p, uint vr, uint ra, uint
rb)
emit_x(p, 31, vr, ra, rb, 71);
}
+/** vector load float: vr = splats(imm) */
+void
+ppc_vload_float(struct ppc_function *p, uint vr, float imm)
+{
+ if (imm == 0.0f) {
+ ppc_vxor(p, vr, vr, vr);
+ }
+ else if (imm == 1.0f) {
+ /* use 2^0=1 to get 1.0 */
+ ppc_vxor(p, vr, vr, vr); /* vr = {0,0,0,0} */
+ ppc_vexptefp(p, vr, vr); /* vr = 0^0 */
+ }
+ else {
+ assert(0);
+ }
+}
+
+
/**
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc.h
b/src/gallium/auxiliary/rtasm/rtasm_ppc.h
index 85679b4..9f1e3fc 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc.h
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc.h
@@ -158,6 +158,10 @@ ppc_lvx(struct ppc_function *p, uint vR, uint vA, uint vB);
extern void
ppc_lvewx(struct ppc_function *p, uint vR, uint vA, uint vB);
+/** vector load float: vr = splats(imm) */
+extern void
+ppc_vload_float(struct ppc_function *p, uint vr, float imm);
+
/**
_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit