mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
R600: Add mul24 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
621299806c
commit
5049ca67c2
@ -699,6 +699,14 @@ SDValue AMDGPUTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
|
||||
return DAG.getNode(AMDGPUISD::UMIN, DL, VT, Op.getOperand(1),
|
||||
Op.getOperand(2));
|
||||
|
||||
case AMDGPUIntrinsic::AMDGPU_umul24:
|
||||
return DAG.getNode(AMDGPUISD::MUL_U24, DL, VT,
|
||||
Op.getOperand(1), Op.getOperand(2));
|
||||
|
||||
case AMDGPUIntrinsic::AMDGPU_imul24:
|
||||
return DAG.getNode(AMDGPUISD::MUL_I24, DL, VT,
|
||||
Op.getOperand(1), Op.getOperand(2));
|
||||
|
||||
case AMDGPUIntrinsic::AMDGPU_bfe_i32:
|
||||
return DAG.getNode(AMDGPUISD::BFE_I32, DL, VT,
|
||||
Op.getOperand(1),
|
||||
|
@ -49,6 +49,8 @@ let TargetPrefix = "AMDGPU", isTarget = 1 in {
|
||||
def int_AMDGPU_imin : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_umax : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_umin : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_umul24 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_imul24 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_cube : Intrinsic<[llvm_v4f32_ty], [llvm_v4f32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_bfi : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
def int_AMDGPU_bfe_i32 : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty, llvm_i32_ty], [IntrNoMem]>;
|
||||
|
@ -92,10 +92,6 @@ let TargetPrefix = "AMDIL", isTarget = 1 in {
|
||||
BinaryIntInt;
|
||||
def int_AMDIL_mulhi_u32 : GCCBuiltin<"__amdil_umul_high">,
|
||||
BinaryIntInt;
|
||||
def int_AMDIL_mul24_i32 : GCCBuiltin<"__amdil_imul24">,
|
||||
BinaryIntInt;
|
||||
def int_AMDIL_mul24_u32 : GCCBuiltin<"__amdil_umul24">,
|
||||
BinaryIntInt;
|
||||
def int_AMDIL_mulhi24_i32 : GCCBuiltin<"__amdil_imul24_high">,
|
||||
BinaryIntInt;
|
||||
def int_AMDIL_mulhi24_u32 : GCCBuiltin<"__amdil_umul24_high">,
|
||||
|
14
test/CodeGen/R600/llvm.AMDGPU.imul24.ll
Normal file
14
test/CodeGen/R600/llvm.AMDGPU.imul24.ll
Normal file
@ -0,0 +1,14 @@
|
||||
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
||||
; RUN: llc -march=r600 -mcpu=cayman -verify-machineinstrs < %s | FileCheck -check-prefix=CM -check-prefix=FUNC %s
|
||||
|
||||
declare i32 @llvm.AMDGPU.imul24(i32, i32) nounwind readnone
|
||||
|
||||
; FUNC-LABEL: @test_imul24
|
||||
; SI: V_MUL_I32_I24
|
||||
; CM: MUL_INT24
|
||||
define void @test_imul24(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind {
|
||||
%mul = call i32 @llvm.AMDGPU.imul24(i32 %src0, i32 %src1) nounwind readnone
|
||||
store i32 %mul, i32 addrspace(1)* %out, align 4
|
||||
ret void
|
||||
}
|
||||
|
11
test/CodeGen/R600/llvm.AMDGPU.umul24.ll
Normal file
11
test/CodeGen/R600/llvm.AMDGPU.umul24.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI %s
|
||||
|
||||
declare i32 @llvm.AMDGPU.umul24(i32, i32) nounwind readnone
|
||||
|
||||
; SI-LABEL: @test_umul24
|
||||
define void @test_umul24(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind {
|
||||
%mul = call i32 @llvm.AMDGPU.umul24(i32 %src0, i32 %src1) nounwind readnone
|
||||
store i32 %mul, i32 addrspace(1)* %out, align 4
|
||||
ret void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user