// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details1#pragma once23namespace Luau4{5namespace CodeGen6{7namespace A648{910// See Table C1-1 on page C1-229 of Arm ARM for A-profile architecture11enum class ConditionA6412{13// EQ: integer (equal), floating-point (equal)14Equal,15// NE: integer (not equal), floating-point (not equal or unordered)16NotEqual,1718// CS: integer (carry set), unsigned integer (greater than, equal), floating-point (greater than, equal or unordered)19CarrySet,20// CC: integer (carry clear), unsigned integer (less than), floating-point (less than)21CarryClear,2223// MI: integer (negative), floating-point (less than)24Minus,25// PL: integer (positive or zero), floating-point (greater than, equal or unordered)26Plus,2728// VS: integer (overflow), floating-point (unordered)29Overflow,30// VC: integer (no overflow), floating-point (ordered)31NoOverflow,3233// HI: integer (unsigned higher), floating-point (greater than, or unordered)34UnsignedGreater,35// LS: integer (unsigned lower or same), floating-point (less than or equal)36UnsignedLessEqual,3738// GE: integer (signed greater than or equal), floating-point (greater than or equal)39GreaterEqual,40// LT: integer (signed less than), floating-point (less than, or unordered)41Less,4243// GT: integer (signed greater than), floating-point (greater than)44Greater,45// LE: integer (signed less than or equal), floating-point (less than, equal or unordered)46LessEqual,4748// AL: always49Always,5051Count,5253UnsignedLess = CarryClear,54UnsignedGreaterEqual = CarrySet,55};5657// Returns a condition that for 'a op b' will result in 'b op a'58// Only a subset of conditions is allowed59inline ConditionA64 getInverseCondition(ConditionA64 cond)60{61switch (cond)62{63case ConditionA64::Equal:64return ConditionA64::Equal;65case ConditionA64::NotEqual:66return ConditionA64::NotEqual;67case ConditionA64::UnsignedGreater:68return ConditionA64::UnsignedLess;69case ConditionA64::UnsignedLessEqual:70return ConditionA64::UnsignedGreaterEqual;71case ConditionA64::GreaterEqual:72return ConditionA64::LessEqual;73case ConditionA64::Less:74return ConditionA64::Greater;75case ConditionA64::Greater:76return ConditionA64::Less;77case ConditionA64::LessEqual:78return ConditionA64::GreaterEqual;79default:80CODEGEN_ASSERT(!"invalid ConditionA64 value for getInverseCondition");81}8283return ConditionA64::Count;84}8586} // namespace A6487} // namespace CodeGen88} // namespace Luau899091