[PATCH] D46802: The return value of a comparison operator is -1 if true and 0 if false

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 13 03:02:05 PDT 2018


niravd added inline comments.


================
Comment at: lib/MC/MCExpr.cpp:805
+    case MCBinaryExpr::GTE:
+    case MCBinaryExpr::LAnd:
+    case MCBinaryExpr::LOr:
----------------
The docs say Land and LOr must be 0 or 1. 


================
Comment at: test/MC/Mips/memory-offsets.s:21
     lw $31, 4 | 8 ($29)                 # CHECK: lw  $ra, 12($sp)     # encoding: [0x8f,0xbf,0x00,0x0c]
-    lw $31, 4 || 8 ($29)                # CHECK: lw  $ra, 1($sp)      # encoding: [0x8f,0xbf,0x00,0x01]
+    lw $31, -(4 || 8) ($29)             # CHECK: lw  $ra, 1($sp)      # encoding: [0x8f,0xbf,0x00,0x01]
     lw $31, 8 & 8 ($29)                 # CHECK: lw  $ra, 8($sp)      # encoding: [0x8f,0xbf,0x00,0x08]
----------------
This should be reverted given above.


https://reviews.llvm.org/D46802





More information about the llvm-commits mailing list