mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-14 13:07:31 +00:00
ae3a0be92e
integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
1.0 KiB
LLVM
31 lines
1.0 KiB
LLVM
; RUN: llvm-as < %s | opt -constprop | llvm-dis | not grep call
|
|
|
|
declare double @cos(double)
|
|
|
|
declare double @sin(double)
|
|
|
|
declare double @tan(double)
|
|
|
|
declare double @sqrt(double)
|
|
|
|
declare i1 @llvm.isunordered.f64(double, double)
|
|
|
|
define double @T() {
|
|
%A = call double @cos( double 0.000000e+00 ) ; <double> [#uses=1]
|
|
%B = call double @sin( double 0.000000e+00 ) ; <double> [#uses=1]
|
|
%a = fadd double %A, %B ; <double> [#uses=1]
|
|
%C = call double @tan( double 0.000000e+00 ) ; <double> [#uses=1]
|
|
%b = fadd double %a, %C ; <double> [#uses=1]
|
|
%D = call double @sqrt( double 4.000000e+00 ) ; <double> [#uses=1]
|
|
%c = fadd double %b, %D ; <double> [#uses=1]
|
|
ret double %c
|
|
}
|
|
|
|
define i1 @TNAN() {
|
|
%A = fcmp uno double 0x7FF8000000000000, 1.000000e+00 ; <i1> [#uses=1]
|
|
%B = fcmp uno double 1.230000e+02, 1.000000e+00 ; <i1> [#uses=1]
|
|
%C = or i1 %A, %B ; <i1> [#uses=1]
|
|
ret i1 %C
|
|
}
|
|
|