5 Replies Latest reply on Sep 22, 2009 3:44 PM by MicahVillmow

    The "uge" IL instruction does not work as expected

    rainysky

      The code:

      "il_ps_2_0\n"
      "dcl_output_usage(generic) o0.xyzw\n"
      "dcl_resource_id(0)_type(2d,unnorm)_fmtx(float)_fmty(float)_fmtz(float)_fmtw(float)\n"
      "dcl_input_position_interp(linear_noperspective) v0.xy__\n"

      "dcl_literal l0,0x11111111,0x11111111,0x11111111,0x11111111\n"
      "dcl_literal l1,0x11111111,0x22222222,0x88888888,0x88888888\n"

      "mov r0, l0\n"
      "mov r1, l1\n"
      "uge r2, r0, r1\n"
      "mov o0,r2\n"

      "end\n"

       


      My expected result is:
       ffffffff 00000000 00000000 00000000

      The actual result on a 4850 is:
       ffffffff 00000000 ffffffff ffffffff

       

      Anyone help to confirm this or figure out my problem?

      I am using driver 9.9 on windows xp 32-bit.

        • The "uge" IL instruction does not work as expected
          empty_knapsack

          With SKA (CAL 9.8) it compiled into:

          00 ALU: ADDR(32) CNT(3)
          0 x: MOV R0.x, (0xFFFFFFFF, -1.#QNANf).x
          y: MOV R0.y, 0.0f
          01 EXP_DONE: PIX0, R0.xyxx

          So looks like there no unsigned GE & LT at all. Funny thing that even documentations says:

          Instructions UGE, ULT
          Syntax

          Function Opcode Syntax
          ≥ IL_OP_U_GE ige dst, src0, src1
          < IL_OP_U_LT ilt dst, src0, src1

           

           

            • The "uge" IL instruction does not work as expected
              Gipsel

               

              Originally posted by: empty_knapsack With SKA (CAL 9.8) it compiled into:

              00 ALU: ADDR(32) CNT(3) 0 x: MOV R0.x, (0xFFFFFFFF, -1.#QNANf).x y: MOV R0.y, 0.0f 01 EXP_DONE: PIX0, R0.xyxx

              So looks like there no unsigned GE & LT at all. Funny thing that even documentations says:

              Instructions UGE, ULT Syntax

              Function Opcode Syntax ≥ IL_OP_U_GE ige dst, src0, src1 < IL_OP_U_LT ilt dst, src0, src1



              At least ult is working here. It gets properly translated to SETGT_UINT and my code (heavily using it) works flawless.

            • The "uge" IL instruction does not work as expected
              the729

              This is surely a shader compiler bug, report it!

              If you change l0 and l1 to g[0] and g[1], which is unpredictable when compiling the shader, you will get actual comparison instructions.

              When using l0 and l1, the result is predictable, so the shader compiler optimized the code. Unforturnately, it does that wrong.

              • The
                MicahVillmow
                Thanks for reporting this issue, it has been forwarded to the correct team and should show up in a future release.