1. 25 Feb, 2019 1 commit
  2. 16 Dec, 2018 2 commits
    • Jason Ekstrand's avatar
      nir: Add 1-bit Boolean opcodes · 191a1dce
      Jason Ekstrand authored
      
      
      We also have to add support for 1-bit integers while we're here so we
      get 1-bit variants of iand, ior, and inot.
      Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
      Reviewed-by: Bas Nieuwenhuizen's avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Tested-by: Bas Nieuwenhuizen's avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      191a1dce
    • Jason Ekstrand's avatar
      nir: Rename Boolean-related opcodes to include 32 in the name · 80e8dfe9
      Jason Ekstrand authored
      
      
      This is a squash of a bunch of individual changes:
      
          nir/builder: Generate 32-bit bool opcodes transparently
      
          nir/algebraic: Remap Boolean opcodes to the 32-bit variant
      
          Use 32-bit opcodes in the NIR producers and optimizations
      
              Generated with a little hand-editing and the following sed commands:
      
              sed -i 's/nir_op_ball_fequal/nir_op_b32all_fequal/g' **/*.c
              sed -i 's/nir_op_bany_fnequal/nir_op_b32any_fnequal/g' **/*.c
              sed -i 's/nir_op_ball_iequal/nir_op_b32all_iequal/g' **/*.c
              sed -i 's/nir_op_bany_inequal/nir_op_b32any_inequal/g' **/*.c
              sed -i 's/nir_op_\([fiu]lt\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fiu]ge\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fiu]ne\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fiu]eq\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fi]\)ne32g/nir_op_\1neg/g' **/*.c
              sed -i 's/nir_op_bcsel/nir_op_b32csel/g' **/*.c
      
           Use 32-bit opcodes in the NIR back-ends
      
              Generated with a little hand-editing and the following sed commands:
      
              sed -i 's/nir_op_ball_fequal/nir_op_b32all_fequal/g' **/*.c
              sed -i 's/nir_op_bany_fnequal/nir_op_b32any_fnequal/g' **/*.c
              sed -i 's/nir_op_ball_iequal/nir_op_b32all_iequal/g' **/*.c
              sed -i 's/nir_op_bany_inequal/nir_op_b32any_inequal/g' **/*.c
              sed -i 's/nir_op_\([fiu]lt\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fiu]ge\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fiu]ne\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fiu]eq\)/nir_op_\132/g' **/*.c
              sed -i 's/nir_op_\([fi]\)ne32g/nir_op_\1neg/g' **/*.c
              sed -i 's/nir_op_bcsel/nir_op_b32csel/g' **/*.c
      Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
      Reviewed-by: Bas Nieuwenhuizen's avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      Tested-by: Bas Nieuwenhuizen's avatarBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
      80e8dfe9
  3. 13 Dec, 2018 2 commits
  4. 05 Dec, 2018 3 commits
  5. 29 Aug, 2018 1 commit
  6. 24 Jul, 2018 2 commits
  7. 03 May, 2018 1 commit
    • Iago Toral's avatar
      nir: add opcodes for 16-bit packing and unpacking · c9653cc1
      Iago Toral authored
      
      
      Noitice that we don't need 'split' versions of the 64-bit to / from
      16-bit opcodes which we require during pack lowering to implement these
      operations. This is because these operations can be expressed as a
      collection of 32-bit from / to 16-bit and 64-bit to / from 32-bit
      operations, so we don't need new opcodes specifically for them.
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      c9653cc1
  8. 13 Apr, 2018 1 commit
  9. 28 Mar, 2018 1 commit
  10. 22 Mar, 2018 1 commit
  11. 07 Mar, 2018 1 commit
  12. 28 Feb, 2018 1 commit
  13. 07 Dec, 2017 1 commit
  14. 06 Dec, 2017 1 commit
    • José María Casanova Crespo's avatar
      nir: Handle fp16 rounding modes at nir_type_conversion_op · 1f440d00
      José María Casanova Crespo authored
      
      
      nir_type_conversion enables new operations to handle rounding modes to
      convert to fp16 values. Two new opcodes are enabled nir_op_f2f16_rtne
      and nir_op_f2f16_rtz.
      
      The undefined behaviour doesn't has any effect and uses the original
      nir_op_f2f16 operation.
      
      v2: Indentation fixed (Jason Ekstrand)
      
      v3: Use explicit case for undefined rounding and assert if
          rounding mode is used for non 16-bit float conversions
          (Jason Ekstrand)
      Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
      1f440d00
  15. 13 Oct, 2017 1 commit
  16. 29 Aug, 2017 1 commit
    • Matt Turner's avatar
      nir: Remove series of unnecessary conversions · 50e4099e
      Matt Turner authored
      
      
      Clang warns:
      
      warning: absolute value function 'fabsf' given an argument of type
      'const float64_t' (aka 'const double') but has parameter of type 'float'
      which may cause truncation of value [-Wabsolute-value]
      
                  float64_t dst = bit_size == 64 ? fabs(src0) : fabsf(src0);
      
      The type of the ternary expression will be the common type of fabs() and
      fabsf(): double. So fabsf(src0) will be implicitly converted to double.
      We may as well just convert src0 to double before a call to fabs() and
      remove the needless complexity, à la
      
                  float64_t dst = fabs(src0);
      Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
      Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@imgtec.com>
      50e4099e
  17. 27 Jun, 2017 1 commit
  18. 30 Mar, 2017 1 commit
  19. 21 Mar, 2017 1 commit
    • Vinson Lee's avatar
      nir: Add positional argument specifiers. · 1fa43274
      Vinson Lee authored
      Fix build with Python < 2.7.
      
        File "src/compiler/nir/nir_builder_opcodes_h.py", line 46, in <module>
          from nir_opcodes import opcodes
        File "src/compiler/nir/nir_opcodes.py", line 178, in <module>
          unop_convert("{}2{}{}".format(src_t[0], dst_t[0], bit_size),
      ValueError: zero length field name in format
      
      Fixes: 762a6333
      
       ("nir: Rework conversion opcodes")
      Signed-off-by: Vinson Lee's avatarVinson Lee <vlee@freedesktop.org>
      1fa43274
  20. 14 Mar, 2017 1 commit
    • Jason Ekstrand's avatar
      nir: Rework conversion opcodes · 762a6333
      Jason Ekstrand authored
      
      
      The NIR story on conversion opcodes is a mess.  We've had way too many
      of them, naming is inconsistent, and which ones have explicit sizes was
      sort-of random.  This commit re-organizes things and makes them all
      consistent:
      
       - All non-bool conversion opcodes now have the explicit size in the
         destination and are named <src_type>2<dst_type><size>.
      
       - Integer <-> integer conversion opcodes now only come in i2i and u2u
         forms (i2u and u2i have been removed) since the only difference
         between the different integer conversions is whether or not they
         sign-extend when up-converting.
      
       - Boolean conversion opcodes all have the explicit size on the bool and
         are named <src_type>2<dst_type>.
      
      Making things consistent also allows nir_type_conversion_op to be moved
      to nir_opcodes.c and auto-generated using mako.  This will make adding
      int8, int16, and float16 versions much easier when the time comes.
      Reviewed-by: Emma Anholt's avatarEric Anholt <eric@anholt.net>
      762a6333
  21. 10 Mar, 2017 1 commit
  22. 17 Feb, 2017 1 commit
  23. 09 Feb, 2017 1 commit
  24. 20 Jan, 2017 2 commits
    • Ian Romanick's avatar
      nir: Shift count for shift opcodes is always 32-bits · fda33e09
      Ian Romanick authored
      
      
      Previously both sources were unsized.  This caused problems when the
      thing being shifted was 64-bit but the shift count was 32-bit.  The
      expectation in NIR is that all unsized sources (and destination) will
      ultimately have the same size.
      
      The changes in nir_opt_algebraic.py are to prevent errors like:
      
       Failed to parse transformation:
      03:12:25   (('extract_i8', 'a', 'b'), ('ishr', ('ishl', 'a', ('imul', ('isub', 3, 'b'), 8)), 24), 'options->lower_extract_byte')
      03:12:25 Traceback (most recent call last):
      03:12:25   File "/home/jenkins/workspace/Leeroy_2/repos/mesa/src/compiler/nir/nir_algebraic.py", line 610, in __init__
      03:12:25     xform = SearchAndReplace(xform)
      03:12:25   File "/home/jenkins/workspace/Leeroy_2/repos/mesa/src/compiler/nir/nir_algebraic.py", line 495, in __init__
      03:12:25     BitSizeValidator(varset).validate(self.search, self.replace)
      03:12:25   File "/home/jenkins/workspace/Leeroy_2/repos/mesa/src/compiler/nir/nir_algebraic.py", line 311, in validate
      03:12:25     validate_dst_class = self._validate_bit_class_up(replace)
      03:12:25   File "/home/jenkins/workspace/Leeroy_2/repos/mesa/src/compiler/nir/nir_algebraic.py", line 414, in _validate_bit_class_up
      03:12:25     src_class = self._validate_bit_class_up(val.sources[i])
      03:12:25   File "/home/jenkins/workspace/Leeroy_2/repos/mesa/src/compiler/nir/nir_algebraic.py", line 420, in _validate_bit_class_up
      03:12:25     assert src_class == src_type_bits
      03:12:25 AssertionError
      Signed-off-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      Suggested-by: Connor Abbott's avatarConnor Abbott <cwabbott0@gmail.com>
      Reviewed-by: Connor Abbott's avatarConnor Abbott <cwabbott0@gmail.com>
      Cc: Jason Ekstrand <jason@jlekstrand.net>
      fda33e09
    • Ian Romanick's avatar
      nir: Add 64-bit integer support for conversions and bitcasts · 3460d05a
      Ian Romanick authored
      
      
      v2 (idr): "cut them down later" => Remove ir_unop_b2u64 and
      ir_unop_u642b.  Handle these with extra i2u or u2i casts just like
      uint(bool) and bool(uint) conversion is done.
      
      v3 (idr): Make the "from" type in a cast unsized.  This reduces the
      number of required cast operations at the expensive slightly more
      complex code.  However, this will be a dramatic improvement when other
      sized integer types are added.  Suggested by Connor.
      Signed-off-by: default avatarIan Romanick <ian.d.romanick@intel.com>
      Reviewed-by: Connor Abbott's avatarConnor Abbott <cwabbott0@gmail.com>
      3460d05a
  25. 07 Sep, 2016 1 commit
  26. 23 May, 2016 2 commits
  27. 15 May, 2016 1 commit
  28. 29 Apr, 2016 2 commits
  29. 13 Apr, 2016 1 commit
  30. 11 Apr, 2016 3 commits