summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/rtasm/rtasm_ppc.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-10-22 14:48:33 -0600
committerBrian Paul <[email protected]>2008-10-22 14:48:33 -0600
commitb06d0720194dfecaf45dc97cbd178411aed5205f (patch)
treea472a99a768fc102d1fc0a4bbd75d4222cde46ef /src/gallium/auxiliary/rtasm/rtasm_ppc.c
parentda63edd720fc154820fcbf699e1056ac9357a03f (diff)
gallium: added ppc_vload_float(), for limited cases
Diffstat (limited to 'src/gallium/auxiliary/rtasm/rtasm_ppc.c')
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_ppc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc.c b/src/gallium/auxiliary/rtasm/rtasm_ppc.c
index 2d9f4e079ec..65df676eae6 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);
+ }
+}
+
+
/**