blob: 7609dcc87afaecb2aae13328afde0148c12ee743 [file] [log] [blame]
Tom Stellard50122a52014-04-07 19:45:41 +00001; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=EG --check-prefix=FUNC
2; RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck %s --check-prefix=CM --check-prefix=FUNC
Tom Stellard49f8bfd2015-01-06 18:00:21 +00003; RUN: llc < %s -march=amdgcn -mcpu=SI -verify-machineinstrs | FileCheck %s --check-prefix=SI --check-prefix=FUNC
Marek Olsak75170772015-01-27 17:27:15 +00004; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s --check-prefix=SI --check-prefix=FUNC
Tom Stellard41fc7852013-07-23 01:48:42 +00005
Tom Stellard79243d92014-10-01 17:15:17 +00006; FUNC-LABEL: {{^}}i32_mul24:
Tom Stellard41fc7852013-07-23 01:48:42 +00007; Signed 24-bit multiply is not supported on pre-Cayman GPUs.
Tom Stellard50122a52014-04-07 19:45:41 +00008; EG: MULLO_INT
9; Make sure we are not masking the inputs
10; CM-NOT: AND
11; CM: MUL_INT24
Tom Stellard326d6ec2014-11-05 14:50:53 +000012; SI-NOT: and
13; SI: v_mul_i32_i24
Tom Stellard41fc7852013-07-23 01:48:42 +000014define void @i32_mul24(i32 addrspace(1)* %out, i32 %a, i32 %b) {
15entry:
16 %0 = shl i32 %a, 8
17 %a_24 = ashr i32 %0, 8
18 %1 = shl i32 %b, 8
19 %b_24 = ashr i32 %1, 8
20 %2 = mul i32 %a_24, %b_24
21 store i32 %2, i32 addrspace(1)* %out
22 ret void
23}