2016-05-21 09:53:33 +08:00
|
|
|
;RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck --check-prefix=SI --check-prefix=GCN --check-prefix=FUNC %s
|
2015-02-11 22:26:46 +08:00
|
|
|
;RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck --check-prefix=VI --check-prefix=GCN --check-prefix=FUNC %s
|
2015-01-23 07:42:43 +08:00
|
|
|
;RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck --check-prefix=EG --check-prefix=FUNC %s
|
2014-04-30 07:12:46 +08:00
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
;FUNC-LABEL: {{^}}test_udiv:
|
2014-04-30 07:12:46 +08:00
|
|
|
;EG: RECIP_UINT
|
2014-05-23 02:09:12 +08:00
|
|
|
;EG: LSHL {{.*}}, 1,
|
2014-04-30 07:12:46 +08:00
|
|
|
;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
|
2015-01-23 07:42:43 +08:00
|
|
|
|
2015-02-11 22:26:46 +08:00
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN-NOT: v_mad_f32
|
|
|
|
;SI-NOT: v_lshr_b64
|
|
|
|
;VI-NOT: v_lshrrev_b64
|
|
|
|
;GCN: s_endpgm
|
2014-04-30 07:12:46 +08:00
|
|
|
define void @test_udiv(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
%result = udiv i64 %x, %y
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
;FUNC-LABEL: {{^}}test_urem:
|
2014-04-30 07:12:46 +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
|
2014-05-23 02:09:12 +08:00
|
|
|
;EG: AND_INT {{.*}}, 1,
|
2015-01-23 07:42:43 +08:00
|
|
|
|
2015-02-11 22:26:46 +08:00
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN: s_bfe_u32
|
|
|
|
;GCN-NOT: v_mad_f32
|
|
|
|
;SI-NOT: v_lshr_b64
|
|
|
|
;VI-NOT: v_lshrrev_b64
|
|
|
|
;GCN: s_endpgm
|
2014-04-30 07:12:46 +08:00
|
|
|
define void @test_urem(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
%result = urem i64 %x, %y
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
2015-01-23 07:42:43 +08:00
|
|
|
|
|
|
|
;FUNC-LABEL: {{^}}test_udiv3264:
|
|
|
|
;EG: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
|
|
|
|
2015-02-11 22:26:46 +08:00
|
|
|
;GCN-NOT: s_bfe_u32
|
|
|
|
;GCN-NOT: v_mad_f32
|
|
|
|
;SI-NOT: v_lshr_b64
|
|
|
|
;VI-NOT: v_lshrrev_b64
|
|
|
|
;GCN: s_endpgm
|
2015-01-23 07:42:43 +08:00
|
|
|
define void @test_udiv3264(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
%1 = lshr i64 %x, 33
|
|
|
|
%2 = lshr i64 %y, 33
|
|
|
|
%result = udiv i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
;FUNC-LABEL: {{^}}test_urem3264:
|
|
|
|
;EG: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
|
|
|
|
2015-02-11 22:26:46 +08:00
|
|
|
;GCN-NOT: s_bfe_u32
|
|
|
|
;GCN-NOT: v_mad_f32
|
|
|
|
;SI-NOT: v_lshr_b64
|
|
|
|
;VI-NOT: v_lshrrev_b64
|
|
|
|
;GCN: s_endpgm
|
2015-01-23 07:42:43 +08:00
|
|
|
define void @test_urem3264(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
%1 = lshr i64 %x, 33
|
|
|
|
%2 = lshr i64 %y, 33
|
|
|
|
%result = urem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-05-21 09:53:33 +08:00
|
|
|
;FUNC-LABEL: {{^}}test_udiv2364:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: UINT_TO_FLT
|
|
|
|
;EG: UINT_TO_FLT
|
|
|
|
;EG: FLT_TO_UINT
|
|
|
|
;EG-NOT: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
|
|
|
|
2015-02-11 22:26:46 +08:00
|
|
|
;SI-NOT: v_lshr_b64
|
|
|
|
;VI-NOT: v_lshrrev_b64
|
|
|
|
;GCN: v_mad_f32
|
|
|
|
;GCN: s_endpgm
|
2016-05-21 09:53:33 +08:00
|
|
|
define void @test_udiv2364(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
%1 = lshr i64 %x, 41
|
|
|
|
%2 = lshr i64 %y, 41
|
2015-01-23 07:42:43 +08:00
|
|
|
%result = udiv i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2016-05-21 09:53:33 +08:00
|
|
|
;FUNC-LABEL: {{^}}test_urem2364:
|
2015-01-23 07:42:43 +08:00
|
|
|
;EG: UINT_TO_FLT
|
|
|
|
;EG: UINT_TO_FLT
|
|
|
|
;EG: FLT_TO_UINT
|
|
|
|
;EG-NOT: RECIP_UINT
|
|
|
|
;EG-NOT: BFE_UINT
|
|
|
|
|
2015-02-11 22:26:46 +08:00
|
|
|
;SI-NOT: v_lshr_b64
|
|
|
|
;VI-NOT: v_lshrrev_b64
|
|
|
|
;GCN: v_mad_f32
|
|
|
|
;GCN: s_endpgm
|
2016-05-21 09:53:33 +08:00
|
|
|
define void @test_urem2364(i64 addrspace(1)* %out, i64 %x, i64 %y) {
|
|
|
|
%1 = lshr i64 %x, 41
|
|
|
|
%2 = lshr i64 %y, 41
|
2015-01-23 07:42:43 +08:00
|
|
|
%result = urem i64 %1, %2
|
|
|
|
store i64 %result, i64 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|