qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

isel3.ssa (1689B)


      1 export function w $slt(w %x, w %y) {
      2 @start
      3 	%r =w csltw %x, %y
      4 	ret %r
      5 }
      6 
      7 export function w $sle(w %x, w %y) {
      8 @start
      9 	%r =w cslew %x, %y
     10 	ret %r
     11 }
     12 
     13 export function w $sgt(w %x, w %y) {
     14 @start
     15 	%r =w csgtw %x, %y
     16 	ret %r
     17 }
     18 
     19 export function w $sge(w %x, w %y) {
     20 @start
     21 	%r =w csgew %x, %y
     22 	ret %r
     23 }
     24 
     25 export function w $ult(w %x, w %y) {
     26 @start
     27 	%r =w cultw %x, %y
     28 	ret %r
     29 }
     30 
     31 export function w $ule(w %x, w %y) {
     32 @start
     33 	%r =w culew %x, %y
     34 	ret %r
     35 }
     36 
     37 export function w $ugt(w %x, w %y) {
     38 @start
     39 	%r =w cugtw %x, %y
     40 	ret %r
     41 }
     42 
     43 export function w $uge(w %x, w %y) {
     44 @start
     45 	%r =w cugew %x, %y
     46 	ret %r
     47 }
     48 
     49 export function w $eq(w %x, w %y) {
     50 @start
     51 	%r =w ceqw %x, %y
     52 	ret %r
     53 }
     54 
     55 export function w $ne(w %x, w %y) {
     56 @start
     57 	%r =w cnew %x, %y
     58 	ret %r
     59 }
     60 
     61 # >>> driver
     62 # #include <math.h>
     63 # extern int slt(int, int);
     64 # extern int sle(int, int);
     65 # extern int sgt(int, int);
     66 # extern int sge(int, int);
     67 # extern int ult(unsigned, unsigned);
     68 # extern int ule(unsigned, unsigned);
     69 # extern int ugt(unsigned, unsigned);
     70 # extern int uge(unsigned, unsigned);
     71 # extern int eq(unsigned, unsigned);
     72 # extern int ne(unsigned, unsigned);
     73 # int main(void) {
     74 # 	/*     LessThan      Equal        GreaterThan */
     75 # 	return !slt(-1, 0) + slt(0, 0)  + slt(0, -1)
     76 # 	     + !sle(-1, 0) + !sle(0, 0) + sle(0, -1)
     77 # 	     + sgt(-1, 0)  + sgt(0, 0)  + !sgt(0, -1)
     78 # 	     + sge(-1, 0)  + !sge(0, 0) + !sge(0, -1)
     79 # 	     + !ult(0, -1) + ult(0, 0)  + ult(-1, 0)
     80 # 	     + !ule(0, -1) + !ule(0, 0) + ule(-1, 0)
     81 # 	     + ugt(0, -1)  + ugt(0, 0)  + !ugt(-1, 0)
     82 # 	     + uge(0, -1)  + !uge(0, 0) + !uge(-1, 0)
     83 # 	     + eq(0, 1)    + !eq(0, 0)  + eq(1, 0)
     84 # 	     + !ne(0, 1)   + ne(0, 0)   + !ne(1, 0)
     85 # 	     ;
     86 # }
     87 # <<<