llvm.org GIT mirror llvm / release_29 test / CodeGen / CellSPU / div_ops.ll
release_29

Tree @release_29 (Download .tar.gz)

div_ops.ll @release_29raw · history · blame

; RUN: llc --march=cellspu %s -o - | FileCheck %s

; signed division rounds towards zero, rotma don't.
define i32 @sdivide (i32 %val )
{
; CHECK: rotmai
; CHECK: rotmi
; CHECK: a
; CHECK: rotmai
; CHECK: bi $lr
   %rv = sdiv i32 %val, 4
   ret i32 %rv
}

define i32 @udivide (i32 %val )
{
; CHECK: rotmi
; CHECK: bi $lr
   %rv = udiv i32 %val, 4
   ret i32 %rv
}