1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
2017-03-21 14:04:44 +00:00

18 lines
561 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
define double @x(i32 %a, i32 %b) {
; CHECK-LABEL: @x(
; CHECK-NEXT: [[M:%.*]] = lshr i32 [[A:%.*]], 24
; CHECK-NEXT: [[N:%.*]] = and i32 [[M]], [[B:%.*]]
; CHECK-NEXT: [[ADDCONV:%.*]] = add nuw nsw i32 [[N]], 1
; CHECK-NEXT: [[P:%.*]] = sitofp i32 [[ADDCONV]] to double
; CHECK-NEXT: ret double [[P]]
;
%m = lshr i32 %a, 24
%n = and i32 %m, %b
%o = sitofp i32 %n to double
%p = fadd double %o, 1.0
ret double %p
}