binaryIntInstructions.3.2.ll 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. ; RUN: llvm-dis < %s.bc| FileCheck %s
  2. ; RUN: verify-uselistorder < %s.bc
  3. ; BinaryIntOperation.3.2.ll.bc was generated by passing this file to llvm-as-3.2.
  4. ; The test checks that LLVM does not misread binary integer instructions from
  5. ; older bitcode files.
  6. define void @add(i1 %x1, i8 %x2 ,i16 %x3, i32 %x4, i64 %x5){
  7. entry:
  8. ; CHECK: %res1 = add i1 %x1, %x1
  9. %res1 = add i1 %x1, %x1
  10. ; CHECK-NEXT: %res2 = add i8 %x2, %x2
  11. %res2 = add i8 %x2, %x2
  12. ; CHECK-NEXT: %res3 = add i16 %x3, %x3
  13. %res3 = add i16 %x3, %x3
  14. ; CHECK-NEXT: %res4 = add i32 %x4, %x4
  15. %res4 = add i32 %x4, %x4
  16. ; CHECK-NEXT: %res5 = add i64 %x5, %x5
  17. %res5 = add i64 %x5, %x5
  18. ; CHECK: %res6 = add nuw i1 %x1, %x1
  19. %res6 = add nuw i1 %x1, %x1
  20. ; CHECK: %res7 = add nsw i1 %x1, %x1
  21. %res7 = add nsw i1 %x1, %x1
  22. ; CHECK: %res8 = add nuw nsw i1 %x1, %x1
  23. %res8 = add nuw nsw i1 %x1, %x1
  24. ret void
  25. }
  26. define void @addvec8NuwNsw(<2 x i8> %x1, <3 x i8> %x2 ,<4 x i8> %x3, <8 x i8> %x4, <16 x i8> %x5){
  27. entry:
  28. ; CHECK: %res1 = add nuw nsw <2 x i8> %x1, %x1
  29. %res1 = add nuw nsw <2 x i8> %x1, %x1
  30. ; CHECK-NEXT: %res2 = add nuw nsw <3 x i8> %x2, %x2
  31. %res2 = add nuw nsw <3 x i8> %x2, %x2
  32. ; CHECK-NEXT: %res3 = add nuw nsw <4 x i8> %x3, %x3
  33. %res3 = add nuw nsw <4 x i8> %x3, %x3
  34. ; CHECK-NEXT: %res4 = add nuw nsw <8 x i8> %x4, %x4
  35. %res4 = add nuw nsw <8 x i8> %x4, %x4
  36. ; CHECK-NEXT: %res5 = add nuw nsw <16 x i8> %x5, %x5
  37. %res5 = add nuw nsw <16 x i8> %x5, %x5
  38. ret void
  39. }
  40. define void @addvec16NuwNsw(<2 x i16> %x1, <3 x i16> %x2 ,<4 x i16> %x3, <8 x i16> %x4, <16 x i16> %x5){
  41. entry:
  42. ; CHECK: %res1 = add nuw nsw <2 x i16> %x1, %x1
  43. %res1 = add nuw nsw <2 x i16> %x1, %x1
  44. ; CHECK-NEXT: %res2 = add nuw nsw <3 x i16> %x2, %x2
  45. %res2 = add nuw nsw <3 x i16> %x2, %x2
  46. ; CHECK-NEXT: %res3 = add nuw nsw <4 x i16> %x3, %x3
  47. %res3 = add nuw nsw <4 x i16> %x3, %x3
  48. ; CHECK-NEXT: %res4 = add nuw nsw <8 x i16> %x4, %x4
  49. %res4 = add nuw nsw <8 x i16> %x4, %x4
  50. ; CHECK-NEXT: %res5 = add nuw nsw <16 x i16> %x5, %x5
  51. %res5 = add nuw nsw <16 x i16> %x5, %x5
  52. ret void
  53. }
  54. define void @addvec32NuwNsw(<2 x i32> %x1, <3 x i32> %x2 ,<4 x i32> %x3, <8 x i32> %x4, <16 x i32> %x5){
  55. entry:
  56. ; CHECK: %res1 = add nuw nsw <2 x i32> %x1, %x1
  57. %res1 = add nuw nsw <2 x i32> %x1, %x1
  58. ; CHECK-NEXT: %res2 = add nuw nsw <3 x i32> %x2, %x2
  59. %res2 = add nuw nsw <3 x i32> %x2, %x2
  60. ; CHECK-NEXT: %res3 = add nuw nsw <4 x i32> %x3, %x3
  61. %res3 = add nuw nsw <4 x i32> %x3, %x3
  62. ; CHECK-NEXT: %res4 = add nuw nsw <8 x i32> %x4, %x4
  63. %res4 = add nuw nsw <8 x i32> %x4, %x4
  64. ; CHECK-NEXT: %res5 = add nuw nsw <16 x i32> %x5, %x5
  65. %res5 = add nuw nsw <16 x i32> %x5, %x5
  66. ret void
  67. }
  68. define void @addvec64NuwNsw(<2 x i64> %x1, <3 x i64> %x2 ,<4 x i64> %x3, <8 x i64> %x4, <16 x i64> %x5){
  69. entry:
  70. ; CHECK: %res1 = add nuw nsw <2 x i64> %x1, %x1
  71. %res1 = add nuw nsw <2 x i64> %x1, %x1
  72. ; CHECK-NEXT: %res2 = add nuw nsw <3 x i64> %x2, %x2
  73. %res2 = add nuw nsw <3 x i64> %x2, %x2
  74. ; CHECK-NEXT: %res3 = add nuw nsw <4 x i64> %x3, %x3
  75. %res3 = add nuw nsw <4 x i64> %x3, %x3
  76. ; CHECK-NEXT: %res4 = add nuw nsw <8 x i64> %x4, %x4
  77. %res4 = add nuw nsw <8 x i64> %x4, %x4
  78. ; CHECK-NEXT: %res5 = add nuw nsw <16 x i64> %x5, %x5
  79. %res5 = add nuw nsw <16 x i64> %x5, %x5
  80. ret void
  81. }
  82. define void @sub(i8 %x1){
  83. entry:
  84. ; CHECK: %res1 = sub i8 %x1, %x1
  85. %res1 = sub i8 %x1, %x1
  86. ; CHECK: %res2 = sub nuw i8 %x1, %x1
  87. %res2 = sub nuw i8 %x1, %x1
  88. ; CHECK: %res3 = sub nsw i8 %x1, %x1
  89. %res3 = sub nsw i8 %x1, %x1
  90. ; CHECK: %res4 = sub nuw nsw i8 %x1, %x1
  91. %res4 = sub nuw nsw i8 %x1, %x1
  92. ret void
  93. }
  94. define void @mul(i8 %x1){
  95. entry:
  96. ; CHECK: %res1 = mul i8 %x1, %x1
  97. %res1 = mul i8 %x1, %x1
  98. ret void
  99. }
  100. define void @udiv(i8 %x1){
  101. entry:
  102. ; CHECK: %res1 = udiv i8 %x1, %x1
  103. %res1 = udiv i8 %x1, %x1
  104. ; CHECK-NEXT: %res2 = udiv exact i8 %x1, %x1
  105. %res2 = udiv exact i8 %x1, %x1
  106. ret void
  107. }
  108. define void @sdiv(i8 %x1){
  109. entry:
  110. ; CHECK: %res1 = sdiv i8 %x1, %x1
  111. %res1 = sdiv i8 %x1, %x1
  112. ; CHECK-NEXT: %res2 = sdiv exact i8 %x1, %x1
  113. %res2 = sdiv exact i8 %x1, %x1
  114. ret void
  115. }
  116. define void @urem(i32 %x1){
  117. entry:
  118. ; CHECK: %res1 = urem i32 %x1, %x1
  119. %res1 = urem i32 %x1, %x1
  120. ret void
  121. }
  122. define void @srem(i32 %x1){
  123. entry:
  124. ; CHECK: %res1 = srem i32 %x1, %x1
  125. %res1 = srem i32 %x1, %x1
  126. ret void
  127. }