Skip to content

Commit fe367f5

Browse files
Carl PetoCarl Peto
authored andcommitted
start fixes for 16-bit
1 parent b54f4d0 commit fe367f5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stdlib/public/core/IntegerTypes.swift.gyb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,9 @@ ${assignmentOperatorComment(x.operator, True)}
16591659
@_transparent
16601660
public // @testable
16611661
init(_ _v: Builtin.Word) {
1662-
% if BuiltinName == 'Int32':
1662+
% if BuiltinName == 'Int16':
1663+
self._value = Builtin.truncOrBitCast_Word_Int16(_v)
1664+
% elif BuiltinName == 'Int32':
16631665
self._value = Builtin.truncOrBitCast_Word_Int32(_v)
16641666
% elif BuiltinName == 'Int64':
16651667
self._value = Builtin.${z}extOrBitCast_Word_Int64(_v)
@@ -1669,7 +1671,9 @@ ${assignmentOperatorComment(x.operator, True)}
16691671
@_transparent
16701672
public // @testable
16711673
var _builtinWordValue: Builtin.Word {
1672-
% if BuiltinName == 'Int32':
1674+
% if BuiltinName == 'Int16':
1675+
return Builtin.${z}extOrBitCast_Int16_Word(_value)
1676+
% elif BuiltinName == 'Int32':
16731677
return Builtin.${z}extOrBitCast_Int32_Word(_value)
16741678
% elif BuiltinName == 'Int64':
16751679
return Builtin.truncOrBitCast_Int64_Word(_value)

test/Parse/ConditionalCompilation/avrTargetWithStdlib.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import Swift
44

5-
#if arch(avr) && os(none) && _runtime(_Native) && _endian(little)
5+
#if arch(avr) && os(none) && _runtime(_Native) && _endian(little) && _pointerBitWidth(_16)
66
let i: Int = 1
77
#endif
88

0 commit comments

Comments
 (0)