瀏覽代碼

+ Aarch64: create better code for not(<byte>)

git-svn-id: trunk@49135 -
florian 4 年之前
父節點
當前提交
c90616944d
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      compiler/aarch64/cgcpu.pas

+ 7 - 2
compiler/aarch64/cgcpu.pas

@@ -1336,8 +1336,13 @@ implementation
           OP_NEG,
           OP_NOT:
             begin
-              list.concat(taicpu.op_reg_reg(TOpCG2AsmOpReg[op],dst,src));
-              maybeadjustresult(list,op,size,dst);
+              if (op=OP_NOT) and (size in [OS_8,OS_S8]) then
+                list.concat(taicpu.op_reg_reg_const(A_EOR,dst,src,255))
+              else
+                begin
+                  list.concat(taicpu.op_reg_reg(TOpCG2AsmOpReg[op],dst,src));
+                  maybeadjustresult(list,op,size,dst);
+                end;
             end
           else
             a_op_reg_reg_reg(list,op,size,src,dst,dst);