brintos

brintos / llvm-project-archived public Read only

0
0
Text · 460 B · fb9948e Raw
17 lines · plain
1; REQUIRES: asserts2; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -stats 2>&1 | \3; RUN:   grep "4 .*Number of machine instrs printed"4 5;; Integer absolute value, should produce something as good as:6;;      srawi r2, r3, 317;;      add r3, r3, r28;;      xor r3, r3, r29;;      blr 10define i32 @test(i32 %a) {11        %tmp1neg = sub i32 0, %a12        %b = icmp sgt i32 %a, -113        %abs = select i1 %b, i32 %a, i32 %tmp1neg14        ret i32 %abs15}16 17