Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion signal/src/msb_32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion signal/src/msb_64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion tensorflow/lite/micro/micro_allocation_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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();
Expand Down
Loading