gallium: Remove ppc asm backend

The vs part hasn't been wired up since tgsi_sse2 was disabled in:

    commit 4eb3225b38
    Author: José Fonseca <jose.r.fonseca@gmail.com>
    Date:   Tue Nov 8 00:10:47 2011 +0000

	Remove tgsi_sse2.

And it would certainly not work correctly in its current state:

draw/draw_vs_ppc.c: In function ‘draw_create_vs_ppc’:
draw/draw_vs_ppc.c:190:24: warning: assignment from incompatible pointer
type [enabled by default]

As with the sse2 backend, this should be done in llvm anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson
2013-01-02 12:44:49 -05:00
parent 410b58c7bf
commit 30530ee9ac
7 changed files with 0 additions and 3077 deletions
-3
View File
@@ -36,7 +36,6 @@ C_SOURCES := \
draw/draw_vertex.c \
draw/draw_vs.c \
draw/draw_vs_exec.c \
draw/draw_vs_ppc.c \
draw/draw_vs_variant.c \
os/os_misc.c \
os/os_time.c \
@@ -64,7 +63,6 @@ C_SOURCES := \
rbug/rbug_shader.c \
rtasm/rtasm_cpu.c \
rtasm/rtasm_execmem.c \
rtasm/rtasm_ppc.c \
rtasm/rtasm_x86sse.c \
tgsi/tgsi_build.c \
tgsi/tgsi_dump.c \
@@ -72,7 +70,6 @@ C_SOURCES := \
tgsi/tgsi_info.c \
tgsi/tgsi_iterate.c \
tgsi/tgsi_parse.c \
tgsi/tgsi_ppc.c \
tgsi/tgsi_sanity.c \
tgsi/tgsi_scan.c \
tgsi/tgsi_strings.c \
-5
View File
@@ -159,11 +159,6 @@ struct draw_vertex_shader *
draw_create_vs_exec(struct draw_context *draw,
const struct pipe_shader_state *templ);
struct draw_vertex_shader *
draw_create_vs_ppc(struct draw_context *draw,
const struct pipe_shader_state *templ);
struct draw_vs_variant_key;
struct draw_vertex_shader;
-240
View File
@@ -1,240 +0,0 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/*
* Authors:
* Keith Whitwell <keith@tungstengraphics.com>
* Brian Paul
*/
#include "util/u_math.h"
#include "util/u_memory.h"
#include "pipe/p_config.h"
#include "draw_vs.h"
#if defined(PIPE_ARCH_PPC)
#include "pipe/p_shader_tokens.h"
#include "draw_private.h"
#include "draw_context.h"
#include "rtasm/rtasm_cpu.h"
#include "rtasm/rtasm_ppc.h"
#include "tgsi/tgsi_ppc.h"
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_exec.h"
typedef void (PIPE_CDECL *codegen_function) (float (*inputs)[4][4],
float (*outputs)[4][4],
float (*temps)[4][4],
float (*immeds)[4],
float (*consts)[4],
const float *builtins);
struct draw_ppc_vertex_shader {
struct draw_vertex_shader base;
struct ppc_function ppc_program;
codegen_function func;
};
static void
vs_ppc_prepare( struct draw_vertex_shader *base,
struct draw_context *draw )
{
/* nothing */
}
/**
* Simplified vertex shader interface for the pt paths. Given the
* complexity of code-generating all the above operations together,
* it's time to try doing all the other stuff separately.
*/
static void
vs_ppc_run_linear( struct draw_vertex_shader *base,
const float (*input)[4],
float (*output)[4],
const void *constants[PIPE_MAX_CONSTANT_BUFFERS],
unsigned count,
unsigned input_stride,
unsigned output_stride )
{
struct draw_ppc_vertex_shader *shader = (struct draw_ppc_vertex_shader *)base;
unsigned int i;
#define MAX_VERTICES 4
/* loop over verts */
for (i = 0; i < count; i += MAX_VERTICES) {
const uint max_vertices = MIN2(MAX_VERTICES, count - i);
PIPE_ALIGN_VAR(16) float inputs_soa[PIPE_MAX_SHADER_INPUTS][4][4];
PIPE_ALIGN_VAR(16) float outputs_soa[PIPE_MAX_SHADER_OUTPUTS][4][4];
PIPE_ALIGN_VAR(16) float temps_soa[TGSI_EXEC_NUM_TEMPS][4][4];
uint attr;
/* convert (up to) four input verts to SoA format */
for (attr = 0; attr < base->info.num_inputs; attr++) {
const float *vIn = (const float *) input;
uint vert;
for (vert = 0; vert < max_vertices; vert++) {
#if 0
if (attr==0)
printf("Input v%d a%d: %f %f %f %f\n",
vert, attr, vIn[0], vIn[1], vIn[2], vIn[3]);
#endif
inputs_soa[attr][0][vert] = vIn[attr * 4 + 0];
inputs_soa[attr][1][vert] = vIn[attr * 4 + 1];
inputs_soa[attr][2][vert] = vIn[attr * 4 + 2];
inputs_soa[attr][3][vert] = vIn[attr * 4 + 3];
vIn += input_stride / 4;
}
}
/* run compiled shader
*/
shader->func(inputs_soa, outputs_soa, temps_soa,
(float (*)[4]) shader->base.immediates,
(float (*)[4])constants[0],
ppc_builtin_constants);
/* convert (up to) four output verts from SoA back to AoS format */
for (attr = 0; attr < base->info.num_outputs; attr++) {
float *vOut = (float *) output;
uint vert;
for (vert = 0; vert < max_vertices; vert++) {
vOut[attr * 4 + 0] = outputs_soa[attr][0][vert];
vOut[attr * 4 + 1] = outputs_soa[attr][1][vert];
vOut[attr * 4 + 2] = outputs_soa[attr][2][vert];
vOut[attr * 4 + 3] = outputs_soa[attr][3][vert];
#if 0
if (attr==0)
printf("Output v%d a%d: %f %f %f %f\n",
vert, attr, vOut[0], vOut[1], vOut[2], vOut[3]);
#endif
vOut += output_stride / 4;
}
}
/* advance to next group of four input/output verts */
input = (const float (*)[4])((const char *)input + input_stride * max_vertices);
output = (float (*)[4])((char *)output + output_stride * max_vertices);
}
}
static void
vs_ppc_delete( struct draw_vertex_shader *base )
{
struct draw_ppc_vertex_shader *shader = (struct draw_ppc_vertex_shader *)base;
ppc_release_func( &shader->ppc_program );
align_free( (void *) shader->base.immediates );
FREE( (void*) shader->base.state.tokens );
FREE( shader );
}
struct draw_vertex_shader *
draw_create_vs_ppc(struct draw_context *draw,
const struct pipe_shader_state *templ)
{
struct draw_ppc_vertex_shader *vs;
vs = CALLOC_STRUCT( draw_ppc_vertex_shader );
if (vs == NULL)
return NULL;
/* we make a private copy of the tokens */
vs->base.state.tokens = tgsi_dup_tokens(templ->tokens);
if (!vs->base.state.tokens)
goto fail;
tgsi_scan_shader(templ->tokens, &vs->base.info);
vs->base.draw = draw;
vs->base.create_variant = draw_vs_create_variant_generic;
vs->base.prepare = vs_ppc_prepare;
vs->base.run_linear = vs_ppc_run_linear;
vs->base.delete = vs_ppc_delete;
vs->base.immediates = align_malloc(TGSI_EXEC_NUM_IMMEDIATES * 4 *
sizeof(float), 16);
ppc_init_func( &vs->ppc_program );
#if 0
ppc_print_code(&vs->ppc_program, TRUE);
ppc_indent(&vs->ppc_program, 8);
#endif
if (!tgsi_emit_ppc( (struct tgsi_token *) vs->base.state.tokens,
&vs->ppc_program,
(float (*)[4]) vs->base.immediates,
TRUE ))
goto fail;
vs->func = (codegen_function) ppc_get_func( &vs->ppc_program );
if (!vs->func) {
goto fail;
}
return &vs->base;
fail:
/*
debug_error("tgsi_emit_ppc() failed, falling back to interpreter\n");
*/
ppc_release_func( &vs->ppc_program );
FREE(vs);
return NULL;
}
#else /* PIPE_ARCH_PPC */
struct draw_vertex_shader *
draw_create_vs_ppc( struct draw_context *draw,
const struct pipe_shader_state *templ )
{
return (void *) 0;
}
#endif /* PIPE_ARCH_PPC */
File diff suppressed because it is too large Load Diff
-342
View File
@@ -1,342 +0,0 @@
/**************************************************************************
*
* Copyright (C) 2008 Tungsten Graphics, Inc. All Rights Reserved.
* Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
/**
* PPC code generation.
* \author Brian Paul
*/
#ifndef RTASM_PPC_H
#define RTASM_PPC_H
#include "pipe/p_compiler.h"
#define PPC_INST_SIZE 4 /**< 4 bytes / instruction */
#define PPC_NUM_REGS 32
#define PPC_NUM_FP_REGS 32
#define PPC_NUM_VEC_REGS 32
/** Stack pointer register */
#define PPC_REG_SP 1
/** Branch conditions */
#define BRANCH_COND_ALWAYS 0x14 /* binary 1z1zz (z=ignored) */
/** Branch hints */
#define BRANCH_HINT_SUB_RETURN 0x0 /* binary 00 */
struct ppc_function
{
uint32_t *store; /**< instruction buffer */
uint num_inst;
uint max_inst;
uint32_t reg_used; /** used/free general-purpose registers bitmask */
uint32_t fp_used; /** used/free floating point registers bitmask */
uint32_t vec_used; /** used/free vector registers bitmask */
int indent;
boolean print;
};
extern void ppc_init_func(struct ppc_function *p);
extern void ppc_release_func(struct ppc_function *p);
extern uint ppc_num_instructions(const struct ppc_function *p);
extern void (*ppc_get_func( struct ppc_function *p ))( void );
extern void ppc_dump_func(const struct ppc_function *p);
extern void ppc_print_code(struct ppc_function *p, boolean enable);
extern void ppc_indent(struct ppc_function *p, int spaces);
extern void ppc_comment(struct ppc_function *p, int rel_indent, const char *s);
extern int ppc_reserve_register(struct ppc_function *p, int reg);
extern int ppc_allocate_register(struct ppc_function *p);
extern void ppc_release_register(struct ppc_function *p, int reg);
extern int ppc_allocate_fp_register(struct ppc_function *p);
extern void ppc_release_fp_register(struct ppc_function *p, int reg);
extern int ppc_allocate_vec_register(struct ppc_function *p);
extern void ppc_release_vec_register(struct ppc_function *p, int reg);
/**
** float vector arithmetic
**/
/** vector float add */
extern void
ppc_vaddfp(struct ppc_function *p,uint vD, uint vA, uint vB);
/** vector float substract */
extern void
ppc_vsubfp(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector float min */
extern void
ppc_vminfp(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector float max */
extern void
ppc_vmaxfp(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector float mult add: vD = vA * vB + vC */
extern void
ppc_vmaddfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
/** vector float negative mult subtract: vD = vA - vB * vC */
extern void
ppc_vnmsubfp(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
/** vector float compare greater than */
extern void
ppc_vcmpgtfpx(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector float compare greater than or equal to */
extern void
ppc_vcmpgefpx(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector float compare equal */
extern void
ppc_vcmpeqfpx(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector float 2^x */
extern void
ppc_vexptefp(struct ppc_function *p, uint vD, uint vB);
/** vector float log2(x) */
extern void
ppc_vlogefp(struct ppc_function *p, uint vD, uint vB);
/** vector float reciprocol */
extern void
ppc_vrefp(struct ppc_function *p, uint vD, uint vB);
/** vector float reciprocol sqrt estimate */
extern void
ppc_vrsqrtefp(struct ppc_function *p, uint vD, uint vB);
/** vector float round to negative infinity */
extern void
ppc_vrfim(struct ppc_function *p, uint vD, uint vB);
/** vector float round to positive infinity */
extern void
ppc_vrfip(struct ppc_function *p, uint vD, uint vB);
/** vector float round to nearest int */
extern void
ppc_vrfin(struct ppc_function *p, uint vD, uint vB);
/** vector float round to int toward zero */
extern void
ppc_vrfiz(struct ppc_function *p, uint vD, uint vB);
/** vector store: store vR at mem[vA+vB] */
extern void
ppc_stvx(struct ppc_function *p, uint vR, uint vA, uint vB);
/** vector load: vR = mem[vA+vB] */
extern void
ppc_lvx(struct ppc_function *p, uint vR, uint vA, uint vB);
/** load vector element word: vR = mem_word[vA+vB] */
extern void
ppc_lvewx(struct ppc_function *p, uint vR, uint vA, uint vB);
/**
** vector bitwise operations
**/
/** vector and */
extern void
ppc_vand(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector and complement */
extern void
ppc_vandc(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector or */
extern void
ppc_vor(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector nor */
extern void
ppc_vnor(struct ppc_function *p, uint vD, uint vA, uint vB);
/** vector xor */
extern void
ppc_vxor(struct ppc_function *p, uint vD, uint vA, uint vB);
/** Pseudo-instruction: vector move */
extern void
ppc_vmove(struct ppc_function *p, uint vD, uint vA);
/** Set vector register to {0,0,0,0} */
extern void
ppc_vzero(struct ppc_function *p, uint vr);
/**
** Vector shuffle / select / splat / etc
**/
/** vector permute */
extern void
ppc_vperm(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
/** vector select */
extern void
ppc_vsel(struct ppc_function *p, uint vD, uint vA, uint vB, uint vC);
/** vector splat byte */
extern void
ppc_vspltb(struct ppc_function *p, uint vD, uint vB, uint imm);
/** vector splat half word */
extern void
ppc_vsplthw(struct ppc_function *p, uint vD, uint vB, uint imm);
/** vector splat word */
extern void
ppc_vspltw(struct ppc_function *p, uint vD, uint vB, uint imm);
/** vector splat signed immediate word */
extern void
ppc_vspltisw(struct ppc_function *p, uint vD, int imm);
/** vector shift left word: vD[word] = vA[word] << (vB[word] & 0x1f) */
extern void
ppc_vslw(struct ppc_function *p, uint vD, uint vA, uint vB);
/**
** scalar arithmetic
**/
extern void
ppc_add(struct ppc_function *p, uint rt, uint ra, uint rb);
extern void
ppc_addi(struct ppc_function *p, uint rt, uint ra, int imm);
extern void
ppc_addis(struct ppc_function *p, uint rt, uint ra, int imm);
extern void
ppc_and(struct ppc_function *p, uint rt, uint ra, uint rb);
extern void
ppc_andi(struct ppc_function *p, uint rt, uint ra, int imm);
extern void
ppc_or(struct ppc_function *p, uint rt, uint ra, uint rb);
extern void
ppc_ori(struct ppc_function *p, uint rt, uint ra, int imm);
extern void
ppc_xor(struct ppc_function *p, uint rt, uint ra, uint rb);
extern void
ppc_xori(struct ppc_function *p, uint rt, uint ra, int imm);
extern void
ppc_mr(struct ppc_function *p, uint rt, uint ra);
extern void
ppc_li(struct ppc_function *p, uint rt, int imm);
extern void
ppc_lis(struct ppc_function *p, uint rt, int imm);
extern void
ppc_load_int(struct ppc_function *p, uint rt, int imm);
/**
** scalar load/store
**/
extern void
ppc_stwu(struct ppc_function *p, uint rs, uint ra, int d);
extern void
ppc_stw(struct ppc_function *p, uint rs, uint ra, int d);
extern void
ppc_lwz(struct ppc_function *p, uint rs, uint ra, int d);
/**
** Float (non-vector) arithmetic
**/
extern void
ppc_fadd(struct ppc_function *p, uint frt, uint fra, uint frb);
extern void
ppc_fsub(struct ppc_function *p, uint frt, uint fra, uint frb);
extern void
ppc_fctiwz(struct ppc_function *p, uint rt, uint ra);
extern void
ppc_stfs(struct ppc_function *p, uint frs, uint ra, int offset);
extern void
ppc_stfiwx(struct ppc_function *p, uint frs, uint ra, uint rb);
extern void
ppc_lfs(struct ppc_function *p, uint frt, uint ra, int offset);
/**
** branch instructions
**/
extern void
ppc_blr(struct ppc_function *p);
void
ppc_bclr(struct ppc_function *p, uint condOp, uint branchHint, uint condReg);
extern void
ppc_return(struct ppc_function *p);
#endif /* RTASM_PPC_H */
File diff suppressed because it is too large Load Diff
-51
View File
@@ -1,51 +0,0 @@
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
**************************************************************************/
#ifndef TGSI_PPC_H
#define TGSI_PPC_H
#if defined __cplusplus
extern "C" {
#endif
struct tgsi_token;
struct ppc_function;
extern const float ppc_builtin_constants[];
boolean
tgsi_emit_ppc(const struct tgsi_token *tokens,
struct ppc_function *function,
float (*immediates)[4],
boolean do_swizzles);
#if defined __cplusplus
}
#endif
#endif /* TGSI_PPC_H */