Commit Graph

168 Commits

Author SHA1 Message Date
Marek Olšák 999b7f6665 r600g: fix relative addressing on RS780 and RS880
They should be treated like RV670.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2012-08-28 18:27:03 +02:00
Vincent Lejeune 72f7632c6b r600g: Fix instruction group merge when there are predicated insts.
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune 56227f875b radeon/llvm: Do not use PV/PS if PRED_SEL does not match
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Vincent Lejeune da676eab93 r600g: Add support for predicates
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-08-15 21:07:13 +00:00
Tom Stellard 39323e8f79 r600g: Update number of gprs when adding a vertex instruction 2012-07-09 13:42:24 +00:00
Vadim Girlin 482041a538 r600g: add RECIP_INT, PRED_SETE_INT to r600_bytecode_get_num_operands
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=50315

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-25 17:22:12 +04:00
Tom Stellard 5187948bc2 r600g: Handle MUL_IEEE in r600_bytecode_get_num_operands 2012-05-17 14:48:09 -04:00
Christoph Bumiller 6ae12bac59 gallium/drivers: handle TGSI_OPCODE_CEIL 2012-05-09 17:09:30 +02:00
Tom Stellard a2e08a40f5 r600g: Print integer values of literal constants in shader dumps 2012-05-03 09:20:23 -04:00
Tom Stellard 18617d7423 r600g: Add support for reading BREAK_LOGICALZ_i32 from bytestream 2012-05-03 09:20:23 -04:00
Adam Rak 4731f1f52d r600g: fixed the bug with VTX fetches in TEX clauses for evergreen
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:10 -04:00
Tom Stellard 94a6a36379 r600g: Add FC_NATIVE instruction
This is a pseudo instruction that enables the LLVM backend to encode
instructions and pass it through r600_bytecode_build()

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-05-02 09:39:09 -04:00
Marek Olšák 0a6120244e winsys/radeon: simplify buffer map/unmap functions
The idea is not to use pb_map and pb_unmap wrappers, calling straight
into the winsys.
2012-04-29 14:46:52 +02:00
Vadim Girlin 65b35b63d3 r600g: fix gpr number calculation
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2012-04-23 08:53:47 -04:00
Marek Olšák 5c03d1fa0f r600g: kill off the fallback for crazy src_offset values
st/mesa doesn't allow src_offset to be greater than stride and the maximum
stride r600 supports is 2047.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-04-04 13:09:47 +02:00
Marek Olšák 330b6c85c9 r600g: cleanup includes 2012-03-05 15:57:32 +01:00
Marek Olšák 370c8b5ee7 r600g: remove obsolete todo comments
Also use XXX in the other ones, because it's the most used word for that
purpose in Mesa.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2012-03-05 14:22:19 +01:00
Marek Olšák e4340c1908 r600g: merge r600_context with r600_pipe_context
The split made no sense.
2012-01-31 23:12:30 +01:00
Marek Olšák 78293b99b2 r600g: remove u8,u16,u32,u64 types 2012-01-31 23:12:30 +01:00
Vadim Girlin 738334e80c r600g: fix inconsistency with INTERP* opcode definitions
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:31 -05:00
Vadim Girlin 65c0f77bcc r600g: replace raw opcodes with names in the is_alu_trans/vector
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-01-24 09:38:28 -05:00
Dave Airlie b9c706c8c5 r600g: shift integer ops are trans unit only on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:25:38 +00:00
Vadim Girlin 9733a89f6d r600g: replace trans/vector-only instruction lists with ranges (v2)
airlied : assert on cayman cases to keep compiler happy

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 17:13:00 +00:00
Dave Airlie 38ffc23e7b Revert "r600g: replace trans/vector-only instruction lists with ranges"
This reverts commit 946309067c.

Until we check the cayman bits out properly
2012-01-22 17:09:54 +00:00
Vadim Girlin 840a342cd0 r600g: take into account kcache banks for bank swizzle check
Due to the changes for multiple kcache banks support, now we are assigning
final SRCx_SEL values for kcache access at the later stage, when building the
bytecode. So we need to take into account kcache banks to distinguish
the constants with the same address but different bank index.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:50 +00:00
Vadim Girlin 946309067c r600g: replace trans/vector-only instruction lists with ranges
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-22 07:22:49 +00:00
Vadim Girlin d649bf51ec r600g: improve kcache line sets handling v2
Add support for multiple kcache banks (constant buffers).
Lock the required lines only.
Allow up to 4 kcache line sets in the alu clause by using ALU_EXTENDED on eg+.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 12:43:14 +00:00
Vadim Girlin 8b1471f8ca r600g: make INTERP_LOAD_P0 vector-only
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-21 11:07:22 +00:00
Dave Airlie c96b983403 r600g: fixup AR handling (v5)
So it appears R600s (except rv670) do AR handling different using a different
opcode. This patch fixes up r600g to work properly on r600.

This fixes ~100 piglit tests here (in GLSL1.30 mode) on rv610.

v3: add index_mode as per the docs.

This still fails any dst relative tests for some reason I can't quite see yet,
but it passes a lot more tests than without.

v4: add a nop after dst.rel this could be improved using a second pass,
where we only insert nops if two instructions are sure to collide.
The docs say r600, rv610, rv630 needs this, and not rv670, rs780, rs880,
need AMD to confirm rv620, rv635.

v5: add is_nop_inst.

NOTE: This is a candidate for stable branches.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-20 17:58:53 +00:00
Dave Airlie ba59a1a0d8 r600g: fix recip_uint on r600.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-18 06:53:02 +10:00
Vadim Girlin 4ba4853c0a r600g: rework IDIV/UDIV and implement MOD/UMOD (v2)
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-17 19:53:20 +00:00
Vadim Girlin d84ab821c5 r600g: add support for ISHR/USHR/SHL on r600-evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:59 +00:00
Vadim Girlin 5d97c5033b r600g: add FLT_TO_UINT opcode for evergreen
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2012-01-15 16:04:57 +00:00
Dave Airlie faa90abfe0 r600g: add r600 version of UINT_TO_FLT conversion.
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 22:03:28 +00:00
Dave Airlie 55bd1c8365 r600g: add missing case for uint->flt conversion.
fixes some piglits like vs-decrement-uint.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-14 18:50:43 +00:00
Marek Olšák 543b2331d7 r600g: implement transform feedback
r600: DONE.
r700: MOSTLY (done but locks up).
Evergreen: MOSTLY (done but doesn't work for an unknown reason).

The kernel support will come soon.
2011-12-17 14:56:21 +01:00
Vadim Girlin 0cddea37b2 r600g: don't change the order of writes in merge_inst_group
Merge may produce incorrect order of operations for r600-eg:

	x: inst1 R0.x, ... ;  //from current group
	...
	t: inst0 R0.x, ... ;  //from previous group, same destination

Result of inst1 will be lost.

So compare destinations and don't allow this.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-17 09:10:37 -05:00
Marek Olšák 4f7c21899a r600g: fix the representation of control-flow instructions
We need something that looks like a compiler and not like some hacker
put some functions together. /rant

This is a band-aid for these two problems:
- The R600 and EG control-flow instructions appear in switch statements
  next to each other, causing conflicts when adding new instructions.
- The ALU control-flow instructions are bitshifted by 3 (from CF_INST 26:29
  to CF_INST 23:29, as is defined by r600 ISA) even for EG, where CF_INST
  is 22:29.

To fix this mess, the 'inst' field is bitshifted to the left either by 22, 23,
or 26 (directly in the definitions), such that it can be just or'd when making
bytecode without any shifting. All switch statements have been divided into
two, one for R600 and the other for EG.

Of course, there is a better way to do this, but that is left for future
work.

Tested on RV730 and REDWOOD with no regressions.

v2: minor cleanup as per Alex's comment.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-15 00:04:43 +01:00
Vadim Girlin dcdc062dda r600g: fix op3 & write in merge_inst_groups 2011-11-14 11:11:31 -05:00
Alex Deucher ebecbbc2e6 r600g: set max max tex/vtx instructions count to 16 for cayman
Cayman is 16 as well.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-14 11:01:00 -05:00
Vadim Girlin c32ca6d9c1 r600g: set max tex/vtx instructions count to 16 for evergreen
According to evergreen-isa doc 16 is max value for evergreen.
More than 16 doesn't work for me.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-14 10:59:53 -05:00
Alex Deucher 579c04e42e r600g: properly handle cayman in is_alu_vec_unit_inst()
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2011-11-13 17:46:01 -05:00
Vadim Girlin 8e366dc365 r600g: lazy load for AR register
Emit MOVA* instruction only when AR is used.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:10:02 -05:00
Vadim Girlin 88a140cd19 r600g: include INTERP_[XY|ZW] in is_alu_vec_unit_inst
This will disallow moving them to the trans slot in merge_inst_groups

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-11-13 17:09:59 -05:00
Dave Airlie c6a3026472 r600g: more integer support
just some more trivial integer changes for r600/r700.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-03 10:11:32 +00:00
Mathias Fröhlich d5bfcf73fd r600g: make r[67]00 not bail out on PRED_SETNE_INT. 2011-10-23 08:57:43 +02:00
Dave Airlie 8b36958ceb r600g: make if's use PRED_SETNE_INT no matter what.
This is more correct for TGSI if, and with native ints enabled
it fixes 25 piglit fails.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:58 +01:00
Dave Airlie d54407040b r600g: print inst in hex in dumps
since we have them as hex in the headers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-22 20:15:57 +01:00
Dave Airlie 9b34cea7e9 r600g: uarl fixes.
Not 100% sure these are correct yet
2011-10-09 16:48:45 +01:00
Dave Airlie 0110aa09e5 r600g/eg: add integer types support
adds handling for int texture/vertices to evergreen.

TODO r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:06:18 +01:00