diff options
author | José Fonseca <[email protected]> | 2009-08-17 08:10:38 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-08-29 09:21:33 +0100 |
commit | c5abcac7ef7ebd0167093285b5fc9cf3829c1feb (patch) | |
tree | 3bdcc1143123dbbe258b72053285f3efbd377d62 /src | |
parent | 09a7b011acb3957725bb7e1bc4125f0939a295e7 (diff) |
llvmpipe: Implement LIT.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index 000b7d01985..b7b1df9aded 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -470,15 +470,11 @@ emit_instruction( if( IS_DST0_CHANNEL_ENABLED( *inst, CHAN_X ) ) { STORE( bld, *inst, 0, CHAN_X, bld->base.one); } - if( IS_DST0_CHANNEL_ENABLED( *inst, CHAN_W ) ) { - STORE( bld, *inst, 0, CHAN_W, bld->base.one); - } if( IS_DST0_CHANNEL_ENABLED( *inst, CHAN_Y ) ) { - tmp0 = FETCH( bld, *inst, 0, CHAN_X ); - tmp0 = lp_build_max( &bld->base, tmp0, bld->base.one); - STORE( bld, *inst, 0, CHAN_Y, tmp0); + src0 = FETCH( bld, *inst, 0, CHAN_X ); + dst0 = lp_build_max( &bld->base, src0, bld->base.zero); + STORE( bld, *inst, 0, CHAN_Y, dst0); } -#if 0 if( IS_DST0_CHANNEL_ENABLED( *inst, CHAN_Z ) ) { /* XMM[1] = SrcReg[0].yyyy */ tmp1 = FETCH( bld, *inst, 0, CHAN_Y ); @@ -488,22 +484,14 @@ emit_instruction( tmp2 = FETCH( bld, *inst, 0, CHAN_W ); tmp1 = lp_build_pow( &bld->base, tmp1, tmp2); tmp0 = FETCH( bld, *inst, 0, CHAN_X ); - tmp2 = bld->base.zero; - sse_cmpps( - bld, - make_xmm( 2 ), - make_xmm( 0 ), - cc_LessThan ); - sse_andps( - bld, - make_xmm( 2 ), - make_xmm( 1 ) ); - STORE( bld, *inst, 0, CHAN_Z, tmp2); - } - break; -#else - return 0; -#endif + tmp2 = lp_build_cmp(&bld->base, PIPE_FUNC_GREATER, tmp0, bld->base.zero); + dst0 = lp_build_select(&bld->base, tmp2, tmp1, bld->base.zero); + STORE( bld, *inst, 0, CHAN_Z, dst0); + } + if( IS_DST0_CHANNEL_ENABLED( *inst, CHAN_W ) ) { + STORE( bld, *inst, 0, CHAN_W, bld->base.one); + } + break; case TGSI_OPCODE_RCP: /* TGSI_OPCODE_RECIP */ |