diff --git a/signal/micro/kernels/xtensa/filter_bank_square_root.cc b/signal/micro/kernels/xtensa/filter_bank_square_root.cc.bak similarity index 100% rename from signal/micro/kernels/xtensa/filter_bank_square_root.cc rename to signal/micro/kernels/xtensa/filter_bank_square_root.cc.bak diff --git a/signal/micro/kernels/xtensa/xtensa_square_root.S b/signal/micro/kernels/xtensa/xtensa_square_root.S.bak similarity index 100% rename from signal/micro/kernels/xtensa/xtensa_square_root.S rename to signal/micro/kernels/xtensa/xtensa_square_root.S.bak diff --git a/signal/src/msb_32.cc b/signal/src/msb_32.cc index 424a63ec2b5..0e381844446 100644 --- a/signal/src/msb_32.cc +++ b/signal/src/msb_32.cc @@ -27,7 +27,7 @@ namespace tflm_signal { // TODO(b/291167350): can allow __builtin_clz to be used in more cases here uint32_t MostSignificantBit32(uint32_t x) { -#if defined(XTENSA) +#if defined(XTENSA) && defined(XT_NSAU) // XT_NSAU returns the number of left shifts needed to put the MSB in the // leftmost position. Returns 32 if the argument is 0. return 32 - XT_NSAU(x); diff --git a/signal/src/msb_64.cc b/signal/src/msb_64.cc index ce99590fe06..50416c12c99 100644 --- a/signal/src/msb_64.cc +++ b/signal/src/msb_64.cc @@ -26,7 +26,7 @@ namespace tflm_signal { // TODO(b/286250473): remove namespace once de-duped libraries above uint32_t MostSignificantBit64(uint64_t x) { -#if defined(XTENSA) +#if defined(XTENSA) && defined(XT_NSAU) // XT_NSAU returns the number of left shifts needed to put the MSB in the // leftmost position. Returns 32 if the argument is 0. uint32_t upper = 64 - XT_NSAU((uint32_t)(x >> 32)); diff --git a/tensorflow/lite/micro/micro_allocation_info.cc b/tensorflow/lite/micro/micro_allocation_info.cc index a89a5e6c29a..d0e751145f6 100644 --- a/tensorflow/lite/micro/micro_allocation_info.cc +++ b/tensorflow/lite/micro/micro_allocation_info.cc @@ -23,6 +23,7 @@ limitations under the License. #include "tensorflow/lite/micro/memory_helpers.h" #include "tensorflow/lite/micro/memory_planner/greedy_memory_planner.h" #include "tensorflow/lite/micro/micro_log.h" +#include "tensorflow/lite/schema/schema_utils.h" namespace tflite { @@ -59,7 +60,7 @@ TfLiteStatus AllocationInfoBuilder::MarkSubgraphLifetimesIfNecessary( int second_subgraph_index = -1; const OperatorCode* opcode = model_->operator_codes()->Get(op->opcode_index()); - switch (opcode->builtin_code()) { + switch (GetBuiltinCode(opcode)) { case BuiltinOperator_IF: { first_subgraph_index = op->builtin_options_as_IfOptions()->then_subgraph_index();