Skip to content

Commit

Permalink
arb1: use MAD opcode for SRCMOD_SIGN instead of a SUB+MUL pair.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 18, 2012
1 parent 638aa90 commit ebff5a5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mojoshader.c
Expand Up @@ -3807,10 +3807,9 @@ static const char *make_ARB1_srcarg_string_in_buf(Context *ctx,
premod_str = "-";
// fall through.
case SRCMOD_SIGN:
output_line(ctx, "SUB %s, %s, { 0.5, 0.5, 0.5, 0.5 };",
regtype_str, buf);
output_line(ctx, "MUL %s, %s, { 2.0, 2.0, 2.0, 2.0 };",
regtype_str, regtype_str);
output_line(ctx,
"MAD %s, %s, { 2.0, 2.0, 2.0, 2.0 }, { -1.0, -1.0, -1.0, -1.0 };",
regtype_str, buf);
break;

case SRCMOD_COMPLEMENT:
Expand Down

0 comments on commit ebff5a5

Please sign in to comment.