2020-02-18 07:16:59 +08:00
|
|
|
;RUN: llc -march=r600 -mcpu=redwood -amdgpu-bypass-slow-div=0 < %s | FileCheck -check-prefix=EG %s
|
2015-01-23 07:42:43 +08:00
|
|
|
|
2020-01-19 05:51:43 +08:00
|
|
|
;EG-LABEL: {{^}}s_test_sdiv:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: RECIP_UINT
|
|
|
|
;EG: LSHL {{.*}}, 1,
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_test_sdiv(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
2015-01-23 07:42:43 +08:00
|
|
|
%result = sdiv i64 %x, %y
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-01-19 05:51:43 +08:00
|
|
|
;EG-LABEL: {{^}}s_test_srem:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: RECIP_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: BFE_UINT
|
|
|
|
;EG: AND_INT {{.*}}, 1,
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @s_test_srem(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
2015-01-23 07:42:43 +08:00
|
|
|
%result = urem i64 %x, %y
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-01-19 05:51:43 +08:00
|
|
|
;EG-LABEL: {{^}}test_sdiv3264:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test_sdiv3264(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
2015-01-23 07:42:43 +08:00
|
|
|
%1 = ashr i64 %x, 33
|
|
|
|
%2 = ashr i64 %y, 33
|
|
|
|
%result = sdiv i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-01-19 05:51:43 +08:00
|
|
|
;EG-LABEL: {{^}}test_srem3264:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test_srem3264(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
2015-01-23 07:42:43 +08:00
|
|
|
%1 = ashr i64 %x, 33
|
|
|
|
%2 = ashr i64 %y, 33
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-01-19 05:51:43 +08:00
|
|
|
;EG-LABEL: {{^}}test_sdiv2464:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: INT_TO_FLT
|
|
|
|
;EG: INT_TO_FLT
|
|
|
|
;EG: FLT_TO_INT
|
|
|
|
;EG-NOT: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test_sdiv2464(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
2015-01-23 07:42:43 +08:00
|
|
|
%1 = ashr i64 %x, 40
|
|
|
|
%2 = ashr i64 %y, 40
|
|
|
|
%result = sdiv i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-01-19 05:51:43 +08:00
|
|
|
;EG-LABEL: {{^}}test_srem2464:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: INT_TO_FLT
|
|
|
|
;EG: INT_TO_FLT
|
|
|
|
;EG: FLT_TO_INT
|
|
|
|
;EG-NOT: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test_srem2464(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
2015-01-23 07:42:43 +08:00
|
|
|
%1 = ashr i64 %x, 40
|
|
|
|
%2 = ashr i64 %y, 40
|
|
|
|
%result = srem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|