darwin: Write errors in choosing the pixel format to the crash log

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
darwin: Guard Core Profile usage behind a testing envvar

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
i965/cfg: Make DO instruction begin a basic block.

The DO instruction doesn't exist on Gen6+. Since before this commit, DO
always ended a basic block, if it also happened to start one (e.g., a
while loop inside an if statement) the block containing only the DO
would actually contain no hardware instructions.

Pre-Gen6's WHILE instructions jumps to the instruction following the DO,
so strictly speaking we won't be modeling that properly, but I claim
there is actually no functional difference.

This will simplify an upcoming change where we want to mark the first
hardware instruction in the loop as beginning a block, and the last
instruction before the loop as ending one.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Delete unused brw_blorp_blit_test_compile().
i965: Pass in start_offset to brw_compact_instructions().

Let's us avoid recompacting the SIMD8 instructions when we compact the
SIMD16 program.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/fs: Don't hardcode DEBUG_WM in generic fs code.

Similar to Paul's commit e9fa3a944 except brw_fs_generator's debug_flag
is for DEBUG_WM and DEBUG_BLORP.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/fs+blorp: Remove left over dump_file arguments.

Were used by the blorp unit test programs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
i965: Add annotation data structure and support code.

Will be used to print disassembly after jump targets are set and
instructions are compacted, while still retaining higher-level IR
annotations and basic block information.

An array of 'struct annotation' will live along side the generated
assembly. The generators will populate the array with their IR
annotations, and basic block pointers if the instructions began or ended
a basic block pointer.

We'll then update the instruction offset when we compact instructions
and then using the annotations print the disassembly.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/fs: Make patch_discard_jumps_to_fb_writes return bool.

... to tell us whether it emitted any code. Will be used to determine
whether we need to skip an annotation for it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
i965: Print disassembly after compaction.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Rename next_ip() -> next_offset().

That we were comparing its return value with offsets should have been a
clue. :)

Make it take a void *store in preparation for making the function useful
elsewhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Move next_offset() to brw_eu.h for use elsewhere.

Also perform arithmetic on char* rather than void* since the latter is a
GNU C extension not available in C++.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Use next_offset() in instruction compaction code.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Support compacted instructions with immediate sources.

Note the weirdness with src1 subregs. The compacted immediate fields are
uncompacted to bits [127:96] and the high five bits of the subreg
mapping maps to bits [100:96].

Number of compacted instructions: 790085 -> 817752 (3.50%)

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Emit ARF:UD for non-present src1 on Gen6+.

Enables the next commits to compact more instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
i965: Emit 0.0:F sources with type VF instead.

Number of compacted instructions: 817752 -> 827404 (1.18%)

Reviewed-by: Eric Anholt <eric@anholt.net>
i965/fs: Use next_insn_offset rather than nr_insn.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Move brw_land_fwd_jump() to compilation unit of its use.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Remove useless typo'd debugging messages.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Revert "i965/vec4: Change vec4_visitor::emit_lrp to use MAC for gen<6"

This reverts commit 2dfbbeca50b95ccdd714d9baa4411c779f6a20d9 with the
comment about MAC and implicit accumulator removed.

Why this code didn't work in all circumstances is unknown and without a
working Ironlake simulator (which uses a different AUB format) we'll
probably never know, short of a lot of experimentation, and spending a
bunch of time to try to optimize a few instructions on Ironlake is not
time well spent.

Moreover, for mix(vec4, vec4, vec4) using the accumulator introduces a
dependence between the otherwise independent per-component calculations.
Not using the accumulator, even if it means an extra instruction per
component might be preferable. We don't know, we don't have data, and
we don't have the necessary register on Ironlake for shader_time to tell
us.

Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77703
Acked-by: Kenneth Graunke <kenneth@whitecape.org>