From: Jason Ekstrand Date: Fri, 1 Apr 2016 21:59:38 +0000 (-0700) Subject: Merge remote-tracking branch 'public/master' into vulkan X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=95106f6bfbbb87b702e4bbba98e2eaea71924cd9;p=mesa.git Merge remote-tracking branch 'public/master' into vulkan --- 95106f6bfbbb87b702e4bbba98e2eaea71924cd9 diff --cc src/compiler/Makefile.sources index 43377f18ad8,0aee2006902..120ef2935a7 --- a/src/compiler/Makefile.sources +++ b/src/compiler/Makefile.sources @@@ -176,13 -176,12 +176,13 @@@ NIR_FILES = nir/nir_control_flow_private.h \ nir/nir_dominance.c \ nir/nir_from_ssa.c \ + nir/nir_gather_info.c \ nir/nir_gs_count_vertices.c \ nir/nir_inline_functions.c \ - nir/nir_intrinsics.c \ - nir/nir_intrinsics.h \ nir/nir_instr_set.c \ nir/nir_instr_set.h \ + nir/nir_intrinsics.c \ + nir/nir_intrinsics.h \ nir/nir_liveness.c \ nir/nir_lower_alu_to_scalar.c \ nir/nir_lower_atomics.c \ diff --cc src/compiler/nir/Makefile.sources index a876eff289a,34743024551..e6367d9c282 --- a/src/compiler/nir/Makefile.sources +++ b/src/compiler/nir/Makefile.sources @@@ -19,13 -19,12 +19,13 @@@ NIR_FILES = nir_control_flow_private.h \ nir_dominance.c \ nir_from_ssa.c \ + nir_gather_info.c \ nir_gs_count_vertices.c \ nir_inline_functions.c \ - nir_intrinsics.c \ - nir_intrinsics.h \ nir_instr_set.c \ nir_instr_set.h \ + nir_intrinsics.c \ + nir_intrinsics.h \ nir_liveness.c \ nir_lower_alu_to_scalar.c \ nir_lower_atomics.c \ diff --cc src/compiler/nir/nir_opt_algebraic.py index 2e9cd5fcc94,e72b4a791cb..ddfe94d9e73 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@@ -270,9 -270,12 +271,13 @@@ optimizations = (('fabs', ('fsub', 0.0, a)), ('fabs', a)), (('iabs', ('isub', 0, a)), ('iabs', a)), + # Propagate negation up multiplication chains + (('fmul', ('fneg', a), b), ('fneg', ('fmul', a, b))), + (('imul', ('ineg', a), b), ('ineg', ('imul', a, b))), + # Misc. lowering (('fmod', a, b), ('fsub', a, ('fmul', b, ('ffloor', ('fdiv', a, b)))), 'options->lower_fmod'), + (('frem', a, b), ('fsub', a, ('fmul', b, ('ftrunc', ('fdiv', a, b)))), 'options->lower_fmod'), (('uadd_carry', a, b), ('b2i', ('ult', ('iadd', a, b), a)), 'options->lower_uadd_carry'), (('usub_borrow', a, b), ('b2i', ('ult', a, b)), 'options->lower_usub_borrow'),