From 6905698fc21710c18722295dedceb96ef5d5923b Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 8 Oct 2013 15:11:02 -0400 Subject: gallium: Add support for 32x32 muls with 64 bit results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code introduces two new 32bit integer multiplication opcodes which can be used to produce correct 64 bit results. GLSL, OpenCL and D3D10+ require them. We use two seperate opcodes, because they match the behavior of GLSL and OpenCL, are a lot easier to add than a single opcode with multiple destinations and because there's not much (any) difference wrt code-generation. Signed-off-by: Zack Rusin Reviewed-by: José Fonseca Reviewed-by: Roland Scheidegger Reviewed-by: Brian Paul --- src/gallium/docs/source/tgsi.rst | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/gallium/docs/source/tgsi.rst') diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst index 41f2798d704..f80c08d3175 100644 --- a/src/gallium/docs/source/tgsi.rst +++ b/src/gallium/docs/source/tgsi.rst @@ -1103,6 +1103,36 @@ Support for these opcodes indicated by PIPE_SHADER_CAP_INTEGERS (all of them?) dst.w = src0.w \times src1.w +.. opcode:: IMUL_HI - Signed Integer Multiply High Bits + + The high 32bits of the multiplication of 2 signed integers are returned. + +.. math:: + + dst.x = (src0.x \times src1.x) >> 32 + + dst.y = (src0.y \times src1.y) >> 32 + + dst.z = (src0.z \times src1.z) >> 32 + + dst.w = (src0.w \times src1.w) >> 32 + + +.. opcode:: UMUL_HI - Unsigned Integer Multiply High Bits + + The high 32bits of the multiplication of 2 unsigned integers are returned. + +.. math:: + + dst.x = (src0.x \times src1.x) >> 32 + + dst.y = (src0.y \times src1.y) >> 32 + + dst.z = (src0.z \times src1.z) >> 32 + + dst.w = (src0.w \times src1.w) >> 32 + + .. opcode:: IDIV - Signed Integer Division TBD: behavior for division by zero. -- cgit v1.2.3