1 ; RUN: llc -march=mips < %s | FileCheck %s -check-prefixes=ALL,MIPS
2 ; RUN: llc -march=mips < %s -mattr=+micromips | FileCheck %s -check-prefixes=ALL,MM
4 ; Test the patterns used for constant materialization.
6 ; Constants generated using li16
7 define i32 @Li16LowBoundary() {
9 ; ALL-LABEL: Li16LowBoundary:
10 ; MIPS: addiu $2, $zero, -1
20 define i32 @Li16HighBoundary() {
22 ; ALL-LABEL: Li16HighBoundary:
23 ; MIPS: addiu $2, $zero, 126
33 ; Constants generated using addiu
34 define i32 @AddiuLowBoundary() {
36 ; ALL-LABEL: AddiuLowBoundary:
37 ; ALL: addiu $2, $zero, -32768
45 define i32 @AddiuZero() {
47 ; ALL-LABEL: AddiuZero:
48 ; MIPS: addiu $2, $zero, 0
58 define i32 @AddiuHighBoundary() {
60 ; ALL-LABEL: AddiuHighBoundary:
61 ; ALL: addiu $2, $zero, 32767
69 ; Constants generated using ori
70 define i32 @OriLowBoundary() {
72 ; ALL-LABEL: OriLowBoundary:
73 ; ALL: ori $2, $zero, 32768
81 define i32 @OriHighBoundary() {
83 ; ALL-LABEL: OriHighBoundary:
84 ; ALL: ori $2, $zero, 65535
92 ; Constants generated using lui
93 define i32 @LuiPositive() {
95 ; ALL-LABEL: LuiPositive:
104 define i32 @LuiNegative() {
106 ; ALL-LABEL: LuiNegative:
115 ; Constants generated using a combination of lui and ori
116 define i32 @LuiWithLowBitsSet() {
118 ; ALL-LABEL: LuiWithLowBitsSet:
127 define i32 @BelowAddiuLowBoundary() {
129 ; ALL-LABEL: BelowAddiuLowBoundary:
131 ; ALL: ori $2, $1, 32767