1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=sparc | FileCheck %s -check-prefix=SPARC
4 define i32 @test_andn(i32 %x) nounwind {
5 ; SPARC-LABEL: test_andn:
6 ; SPARC: ! %bb.0: ! %entry
7 ; SPARC-NEXT: sethi 4194272, %o1
9 ; SPARC-NEXT: andn %o0, %o1, %o0
11 %and = and i32 %x, 32767
15 define i32 @test_orn(i32 %x) nounwind {
16 ; SPARC-LABEL: test_orn:
17 ; SPARC: ! %bb.0: ! %entry
18 ; SPARC-NEXT: sethi 4194272, %o1
20 ; SPARC-NEXT: orn %o0, %o1, %o0
22 %or = or i32 %x, 32767
26 ; If constant is used more than once it is probably
27 ; better to keep it in its original form.
28 define i32 @test_used_more_than_once(i32 %x) nounwind {
29 ; SPARC-LABEL: test_used_more_than_once:
30 ; SPARC: ! %bb.0: ! %entry
31 ; SPARC-NEXT: sethi 31, %o1
32 ; SPARC-NEXT: or %o1, 1023, %o1
33 ; SPARC-NEXT: or %o0, %o1, %o2
34 ; SPARC-NEXT: and %o0, %o1, %o0
36 ; SPARC-NEXT: xor %o2, %o0, %o0
39 %and = and i32 %x, 32767
40 %res = xor i32 %0, %and