From ce91eeafde741ead11055855c8369c8324b86645 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <barracuda@macos-powerpc.org>
Date: Fri, 4 Apr 2025 06:39:00 +0800
Subject: [PATCH] V8_TARGET_ARCH_PPC64: use macros correctly

---
 v8/src/compiler/backend/ppc/code-generator-ppc.cc | 8 ++++----
 v8/src/wasm/baseline/ppc/liftoff-assembler-ppc.h  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/v8/src/compiler/backend/ppc/code-generator-ppc.cc b/v8/src/compiler/backend/ppc/code-generator-ppc.cc
index addbd76f..c853ba40 100644
--- a/v8/src/compiler/backend/ppc/code-generator-ppc.cc
+++ b/v8/src/compiler/backend/ppc/code-generator-ppc.cc
@@ -895,7 +895,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
       // they might need to be patched individually.
       if (instr->InputAt(0)->IsImmediate()) {
         Constant constant = i.ToConstant(instr->InputAt(0));
-#ifdef V8_TARGET_ARCH_PPC64
+#if V8_TARGET_ARCH_PPC64
         Address wasm_code = static_cast<Address>(constant.ToInt64());
 #else
         Address wasm_code = static_cast<Address>(constant.ToInt32());
@@ -938,7 +938,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
       // they might need to be patched individually.
       if (instr->InputAt(0)->IsImmediate()) {
         Constant constant = i.ToConstant(instr->InputAt(0));
-#ifdef V8_TARGET_ARCH_S390X
+#if V8_TARGET_ARCH_PPC64
         Address wasm_code = static_cast<Address>(constant.ToInt64());
 #else
         Address wasm_code = static_cast<Address>(constant.ToInt32());
@@ -1018,7 +1018,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
       AssemblePrepareTailCall();
       break;
     case kArchComment:
-#ifdef V8_TARGET_ARCH_PPC64
+#if V8_TARGET_ARCH_PPC64
       __ RecordComment(reinterpret_cast<const char*>(i.InputInt64(0)));
 #else
       __ RecordComment(reinterpret_cast<const char*>(i.InputInt32(0)));
@@ -2101,7 +2101,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
       __ extsw(output, temp1);
       break;
     }
-#ifdef V8_TARGET_ARCH_PPC64
+#if V8_TARGET_ARCH_PPC64
     case kPPC_ByteRev64: {
       Register input = i.InputRegister(0);
       Register output = i.OutputRegister();
diff --git a/v8/src/wasm/baseline/ppc/liftoff-assembler-ppc.h b/v8/src/wasm/baseline/ppc/liftoff-assembler-ppc.h
index 3b5a5f3a..7abda937 100644
--- a/v8/src/wasm/baseline/ppc/liftoff-assembler-ppc.h
+++ b/v8/src/wasm/baseline/ppc/liftoff-assembler-ppc.h
@@ -330,7 +330,7 @@ UNIMPLEMENTED_I32_SHIFTOP(i32_shr)
 UNIMPLEMENTED_I64_BINOP_I(i64_add)
 UNIMPLEMENTED_I64_BINOP(i64_sub)
 UNIMPLEMENTED_I64_BINOP(i64_mul)
-#ifdef V8_TARGET_ARCH_PPC64
+#if V8_TARGET_ARCH_PPC64
 UNIMPLEMENTED_I64_BINOP_I(i64_and)
 UNIMPLEMENTED_I64_BINOP_I(i64_or)
 UNIMPLEMENTED_I64_BINOP_I(i64_xor)
@@ -450,7 +450,7 @@ void LiftoffAssembler::emit_i64_ctz(LiftoffRegister dst, LiftoffRegister src) {
 }
 
 void LiftoffAssembler::emit_u32_to_intptr(Register dst, Register src) {
-#ifdef V8_TARGET_ARCH_PPC64
+#if V8_TARGET_ARCH_PPC64
   bailout(kUnsupportedArchitecture, "emit_u32_to_intptr");
 #else
 // This is a nop on ppc32.
