Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Pisal <[email protected]>
  • Loading branch information
sacpis committed Jan 2, 2025
1 parent 47e0812 commit 044b8b7
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions python/cudaq/kernel/ast_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3380,28 +3380,25 @@ def visit_Compare(self, node):
left_type = left.type
right_type = right.type

if IntegerType.isinstance(left_type) and F64Type.isinstance(
right_type):
if IntegerType.isinstance(left_type) and F64Type.isinstance(right_type):
left = arith.SIToFPOp(self.getFloatType(), left).result
elif F64Type.isinstance(left_type) and IntegerType.isinstance(
right_type):
right = arith.SIToFPOp(self.getFloatType(), right).result
elif IntegerType.isinstance(left_type) and IntegerType.isinstance(
right_type):
if IntegerType(left_type).width < IntegerType(
right_type).width:
if IntegerType(left_type).width < IntegerType(right_type).width:
zeroext = IntegerType(left_type).width == 1
left = cc.CastOp(right_type,
left,
sint=not zeroext,
zint=zeroext).result
elif IntegerType(left_type).width > IntegerType(
right_type).width:
elif IntegerType(left_type).width > IntegerType(right_type).width:
zeroext = IntegerType(right_type).width == 1
right = cc.CastOp(left_type,
right,
sint=not zeroext,
zint=zeroext).result
right,
sint=not zeroext,
zint=zeroext).result

if isinstance(op, ast.Gt):
if F64Type.isinstance(left.type):
Expand Down

0 comments on commit 044b8b7

Please sign in to comment.