mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-10 06:54:54 +00:00
- Add appropriate TableGen patterns for fadd, fsub, fmul. - Add .f32 as the PTX type for the LLVM float type. - Allow parameters, return values, and global variable declarations to accept the float type. - Add appropriate test cases. Patch by Justin Holewinski git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126636 91177308-0d34-0410-b5e6-96231b3b80d8
30 lines
558 B
LLVM
30 lines
558 B
LLVM
; RUN: llc < %s -march=ptx | FileCheck %s
|
|
|
|
define ptx_device i32 @t1(i32 %x, i32 %y) {
|
|
; CHECK: add.s32 r0, r1, r2;
|
|
%z = add i32 %x, %y
|
|
; CHECK: ret;
|
|
ret i32 %z
|
|
}
|
|
|
|
define ptx_device i32 @t2(i32 %x) {
|
|
; CHECK: add.s32 r0, r1, 1;
|
|
%z = add i32 %x, 1
|
|
; CHECK: ret;
|
|
ret i32 %z
|
|
}
|
|
|
|
define ptx_device float @t3(float %x, float %y) {
|
|
; CHECK: add.f32 f0, f1, f2
|
|
; CHECK-NEXT: ret;
|
|
%z = fadd float %x, %y
|
|
ret float %z
|
|
}
|
|
|
|
define ptx_device float @t4(float %x) {
|
|
; CHECK: add.f32 f0, f1, 0F3F800000;
|
|
; CHECK-NEXT: ret;
|
|
%z = fadd float %x, 1.0
|
|
ret float %z
|
|
}
|