[PATCH] D17541: X86: Load and ZeroExtend i1 value

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 23 09:38:43 PST 2016

qcolombet added inline comments.

Comment at: ../docs/LangRef.rst:1756
@@ +1755,3 @@
+i1 is a 1-bit integer type stored in 8-bit (byte) in zero-extended form.
+Upper bits cleanup should be executed before ``store``.
I don’t think this part of the patch makes sense.
This may be the right thing to do for x86 but maybe not for all the targets. Ih other words, I don’t think we want to make this a requirement for all targets, unless this was already a requirement we forgot to document so far?

Comment at: ../lib/Target/X86/X86InstrCompiler.td:1142
@@ -1141,4 +1141,3 @@
 // zextload bool -> zextload byte
-def : Pat<(zextloadi8i1  addr:$src), (AND8ri (MOV8rm addr:$src), (i8 1))>;
-def : Pat<(zextloadi16i1 addr:$src), (AND16ri8 (MOVZX16rm8 addr:$src), (i16 1))>;
-def : Pat<(zextloadi32i1 addr:$src), (AND32ri8 (MOVZX32rm8 addr:$src), (i32 1))>;
+def : Pat<(zextloadi8i1  addr:$src), (MOV8rm addr:$src)>;
+def : Pat<(zextloadi16i1 addr:$src), (MOVZX16rm8 addr:$src)>;
Add the comment regarding i1 being zero extended before store here.



More information about the llvm-commits mailing list