2012-12-12 05:25:42 +08:00
|
|
|
; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
|
|
|
|
|
|
|
|
; Test using an integer literal constant.
|
|
|
|
; Generated ASM should be:
|
2013-07-23 09:48:18 +08:00
|
|
|
; ADD_INT KC0[2].Z literal.x, 5
|
2012-12-12 05:25:42 +08:00
|
|
|
; or
|
2013-07-23 09:48:18 +08:00
|
|
|
; ADD_INT literal.x KC0[2].Z, 5
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2013-03-10 02:25:40 +08:00
|
|
|
; CHECK: @i32_literal
|
2013-08-01 04:43:27 +08:00
|
|
|
; CHECK: ADD_INT * T{{[0-9]\.[XYZW]}}, KC0[2].Z, literal.x
|
2013-05-03 05:52:30 +08:00
|
|
|
; CHECK-NEXT: 5
|
2012-12-12 05:25:42 +08:00
|
|
|
define void @i32_literal(i32 addrspace(1)* %out, i32 %in) {
|
|
|
|
entry:
|
|
|
|
%0 = add i32 5, %in
|
|
|
|
store i32 %0, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Test using a float literal constant.
|
|
|
|
; Generated ASM should be:
|
2013-07-23 09:48:18 +08:00
|
|
|
; ADD KC0[2].Z literal.x, 5.0
|
2012-12-12 05:25:42 +08:00
|
|
|
; or
|
2013-07-23 09:48:18 +08:00
|
|
|
; ADD literal.x KC0[2].Z, 5.0
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2013-02-06 01:09:11 +08:00
|
|
|
; CHECK: @float_literal
|
2013-08-01 04:43:27 +08:00
|
|
|
; CHECK: ADD * T{{[0-9]\.[XYZW]}}, KC0[2].Z, literal.x
|
2013-05-03 05:52:30 +08:00
|
|
|
; CHECK-NEXT: 1084227584(5.0
|
2012-12-12 05:25:42 +08:00
|
|
|
define void @float_literal(float addrspace(1)* %out, float %in) {
|
|
|
|
entry:
|
|
|
|
%0 = fadd float 5.0, %in
|
|
|
|
store float %0, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|