2015-01-07 02:00:21 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
2015-01-28 01:27:15 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
2014-11-23 10:57:54 +08:00
|
|
|
; RUN: llc -march=r600 -mcpu=cypress -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
|
2014-04-16 06:28:39 +08:00
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}global_copy_i1_to_i1:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: v_and_b32_e32 v{{[0-9]+}}, 1
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI: s_endpgm
|
2014-11-23 10:57:54 +08:00
|
|
|
|
|
|
|
; EG: VTX_READ_8
|
|
|
|
; EG: AND_INT
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @global_copy_i1_to_i1(i1 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(1)* %in
|
2014-04-16 06:28:39 +08:00
|
|
|
store i1 %load, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}local_copy_i1_to_i1:
|
2014-11-23 10:57:50 +08:00
|
|
|
; SI: ds_read_u8
|
|
|
|
; SI: v_and_b32_e32 v{{[0-9]+}}, 1
|
|
|
|
; SI: ds_write_b8
|
|
|
|
; SI: s_endpgm
|
2014-11-23 10:57:54 +08:00
|
|
|
|
|
|
|
; EG: LDS_UBYTE_READ_RET
|
|
|
|
; EG: AND_INT
|
|
|
|
; EG: LDS_BYTE_WRITE
|
2014-11-23 10:57:50 +08:00
|
|
|
define void @local_copy_i1_to_i1(i1 addrspace(3)* %out, i1 addrspace(3)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(3)* %in
|
2014-11-23 10:57:50 +08:00
|
|
|
store i1 %load, i1 addrspace(3)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}constant_copy_i1_to_i1:
|
2014-11-23 10:57:50 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: v_and_b32_e32 v{{[0-9]+}}, 1
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI: s_endpgm
|
2014-11-23 10:57:54 +08:00
|
|
|
|
|
|
|
; EG: VTX_READ_8
|
|
|
|
; EG: AND_INT
|
2014-11-23 10:57:50 +08:00
|
|
|
define void @constant_copy_i1_to_i1(i1 addrspace(1)* %out, i1 addrspace(2)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(2)* %in
|
2014-11-23 10:57:50 +08:00
|
|
|
store i1 %load, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}global_sextload_i1_to_i32:
|
2014-11-23 10:57:49 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: v_bfe_i32
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_store_dword
|
|
|
|
; SI: s_endpgm
|
2014-11-23 10:57:54 +08:00
|
|
|
|
|
|
|
; EG: VTX_READ_8
|
|
|
|
; EG: BFE_INT
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @global_sextload_i1_to_i32(i32 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(1)* %in
|
2014-04-16 06:28:39 +08:00
|
|
|
%ext = sext i1 %load to i32
|
|
|
|
store i32 %ext, i32 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}global_zextload_i1_to_i32:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: buffer_store_dword
|
|
|
|
; SI: s_endpgm
|
2014-11-23 10:57:54 +08:00
|
|
|
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @global_zextload_i1_to_i32(i32 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(1)* %in
|
2014-04-16 06:28:39 +08:00
|
|
|
%ext = zext i1 %load to i32
|
|
|
|
store i32 %ext, i32 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}global_sextload_i1_to_i64:
|
2014-11-23 10:57:49 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: v_bfe_i32
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_store_dwordx2
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @global_sextload_i1_to_i64(i64 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(1)* %in
|
2014-04-16 06:28:39 +08:00
|
|
|
%ext = sext i1 %load to i64
|
|
|
|
store i64 %ext, i64 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}global_zextload_i1_to_i64:
|
2016-05-27 03:35:29 +08:00
|
|
|
; SI-DAG: buffer_load_ubyte
|
|
|
|
; SI-DAG: v_mov_b32_e32 {{v[0-9]+}}, 0
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_store_dwordx2
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @global_zextload_i1_to_i64(i64 addrspace(1)* %out, i1 addrspace(1)* %in) nounwind {
|
2015-02-28 05:17:42 +08:00
|
|
|
%load = load i1, i1 addrspace(1)* %in
|
2014-04-16 06:28:39 +08:00
|
|
|
%ext = zext i1 %load to i64
|
|
|
|
store i64 %ext, i64 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}i1_arg:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: v_and_b32_e32
|
|
|
|
; SI: buffer_store_byte
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @i1_arg(i1 addrspace(1)* %out, i1 %x) nounwind {
|
|
|
|
store i1 %x, i1 addrspace(1)* %out, align 1
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}i1_arg_zext_i32:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: buffer_store_dword
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @i1_arg_zext_i32(i32 addrspace(1)* %out, i1 %x) nounwind {
|
|
|
|
%ext = zext i1 %x to i32
|
|
|
|
store i32 %ext, i32 addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}i1_arg_zext_i64:
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: buffer_store_dwordx2
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @i1_arg_zext_i64(i64 addrspace(1)* %out, i1 %x) nounwind {
|
|
|
|
%ext = zext i1 %x to i64
|
|
|
|
store i64 %ext, i64 addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}i1_arg_sext_i32:
|
2014-11-23 10:57:49 +08:00
|
|
|
; SI: buffer_load_ubyte
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_store_dword
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @i1_arg_sext_i32(i32 addrspace(1)* %out, i1 %x) nounwind {
|
|
|
|
%ext = sext i1 %x to i32
|
|
|
|
store i32 %ext, i32addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-11-23 10:57:54 +08:00
|
|
|
; FUNC-LABEL: {{^}}i1_arg_sext_i64:
|
2014-11-23 10:57:49 +08:00
|
|
|
; SI: buffer_load_ubyte
|
|
|
|
; SI: v_bfe_i32
|
|
|
|
; SI: v_ashrrev_i32
|
2014-11-05 22:50:53 +08:00
|
|
|
; SI: buffer_store_dwordx2
|
|
|
|
; SI: s_endpgm
|
2014-04-16 06:28:39 +08:00
|
|
|
define void @i1_arg_sext_i64(i64 addrspace(1)* %out, i1 %x) nounwind {
|
|
|
|
%ext = sext i1 %x to i64
|
|
|
|
store i64 %ext, i64 addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|